Closed Bug 606178 Opened 9 years ago Closed 9 years ago

Android Fennec can not restart

Categories

(Firefox for Android Graveyard :: General, defect, critical)

ARM
Android
defect
Not set
critical

Tracking

(fennec2.0b2+)

VERIFIED FIXED
Tracking Status
fennec 2.0b2+ ---

People

(Reporter: ioana.chiorean, Assigned: blassey)

References

(Depends on 1 open bug)

Details

Attachments

(3 files)

Device: Motorola Droid 2
BuildID: Mozilla /5.0 (Maemo;Linux armv7l;rv:2.0b8pre)Gecko/20101021
Firefox/4.0b8pre Fennec /4.0b2pre 

Steps to reproduce:
1. Open Fennec
2. Go to add-ons manager/ beta test tool/ AMO
3. Install a recommended add-on/ select yes to show error console
4. A restart notification is displayed after the add-on is installed/ after pressing yes to error 

Expected results:
- the application should restart and install the add-on/ error console

Actual results:
- the application doesn't restart 

Note:
-  when you open manually the application the add-on/ error console are isntalled
Attached image error console messages
Yep, I can confirmed on Android build:

Mozilla/5.0 (Android; Linux armv71; rv:2.0b8pre) Gecko/20101021 Namoroka/4.0b8pre Fennec/4.0b2pre

This does not happen on Maemo. Nominating to blocking-fennec
tracking-fennec: --- → ?
tracking-fennec: ? → 2.0b2+
we still restart after a crash report is submitted and that uses the same code path on the java side of things. Is this a front end issue? Is it reproducible on maemo?
Not Maemo
Don't know if it's a front-end issue.

We can't reproduce with today's builds. Can QA try to reproduce with next nightlies?
Device: Motorola Droid 2
BuildID: Mozilla /5.0 (Maemo;Linux armv7l;rv:2.0b8pre)Gecko/20101022
Firefox/4.0b8pre Fennec /4.0b2pre 

With the latest night build the behavior did change: pressing restart will bring up a crash report. (add-ons manager)

http://crash-stats.mozilla.com/report/index/bp-e88fc126-2d63-440a-ab22-65a8d2101022
Duplicate of this bug: 606510
Wes is taking a look
Assignee: nobody → wjohnston
Not sure about the crash report. I am seeing Fennec fail to restart though. I think that problem is caused by crashreporter. Without crash reporter, restart fires an activity manager notification:

http://mxr.mozilla.org/mozilla-central/source/embedding/android/GeckoApp.java#460

that (for me) looks like:

/system/bin/am broadcast -a org.mozilla.gecko.restartfennec
  --es env0 XRE_PROFILE_NAME=default
  --es env1 XUL_APP_FILE=
  --es env2 ASEC_MOUNTPOINT=/mnt/asec
  --es env3 NSS_DISABLE_UNLOAD=1
  --es env4 XRE_PROFILE_LOCAL_PATH=/data/data/org.mozilla.fennec/mozilla/aguto703.default
  --es env5 XRE_PROFILE_PATH=/data/data/org.mozilla.fennec/mozilla/aguto703.default
  --es env6 HOME=/data
  --es env7 XRE_START_OFFLINE=
  --es env8 XRE_BINARY_PATH=
  --es env9 XRE_IMPORT_PROFILES=
  --es env10 MOZ_LAUNCHED_CHILD=1
  --es env11 NO_EM_RESTART=
  -n org.mozilla.fennec/org.mozilla.fennec.Restarter

with breakpad a few lines are added:

I/GeckoAppJava( 7133): /system/bin/am broadcast -a org.mozilla.gecko.restartfennec
  --es env0 XUL_APP_FILE=
  --es env1 ASEC_MOUNTPOINT=/mnt/asec
  --es env2 MOZ_CRASHREPORTER_DATA_DIRECTORY=/data/data/org.mozilla.fennec/mozilla/Crash Reports
  --es env3 NSS_DISABLE_UNLOAD=1
  --es env4 XRE_PROFILE_LOCAL_PATH=/data/data/org.mozilla.fennec/mozilla/p37egct5.default
  --es env5 XRE_PROFILE_PATH=/data/data/org.mozilla.fennec/mozilla/p37egct5.default
  --es env6 XRE_START_OFFLINE=
  --es env7 XRE_IMPORT_PROFILES=
  --es env8 MOZ_LAUNCHED_CHILD=1
  --es env9 NO_EM_RESTART=
  --es env10 XRE_PROFILE_NAME=default
  --es env11 MOZ_CRASHREPORTER_RESTART_ARG_0=/data/app/org.mozilla.fennec-1.apk
  --es env12 MOZ_CRASHREPORTER_RESTART_ARG_1=-omnijar
  --es env13 HOME=/data
  --es env14 MOZ_CRASHREPORTER_RESTART_ARG_2=/data/app/org.mozilla.fennec-1.apk
  --es env15 MOZ_CRASHREPORTER_RESTART_ARG_3=
  --es env16 XRE_BINARY_PATH=
  -n org.mozilla.fennec/org.mozilla.fennec.Restarter

Removing the line:

  --es env2 MOZ_CRASHREPORTER_DATA_DIRECTORY=/data/data/org.mozilla.fennec/mozilla/Crash Reports

(and fixing the env numbering) I sent the same command through the shell and Fennec restarted, so I'm guessing it is this unescaped string causing the restarts not to fire. mwu reported that his builds were restarting even with breakpad. I'm not sure what that was.
(In reply to comment #8)
> (and fixing the env numbering) I sent the same command through the shell and
> Fennec restarted, so I'm guessing it is this unescaped string causing the
> restarts not to fire. mwu reported that his builds were restarting even with
> breakpad. I'm not sure what that was.

Yes, removing the env strings fixes the updater.

also, in order to reproduce you need "export MOZILLA_OFFICIAL=1" in your mozconfig
this is a platform bug, taking it
Assignee: wjohnston → blassey.bugs
Attached patch patchSplinter Review
Attachment #485605 - Flags: review?(mwu)
Comment on attachment 485605 [details] [diff] [review]
patch

Wow. Much better than before. This is how it should've been done.
Attachment #485605 - Flags: review?(mwu) → review+
pushed http://hg.mozilla.org/mozilla-central/rev/df51ba69a839
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
This is not still not working (no change from the reported behavior) on the Nexus One and Vibrant via build:

Mozilla/5.0 (Android; Linux armv71; rv:2.0b8pre) Gecko/20101025 Namoroka/4.0b8pre Fennec/4.0b2pre
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
I'm seeing this in my log on the i9000: 
I/GeckoAppJava(13819): scheduling restart
I/GeckoAppJava(13819): XRE exited
I/GeckoAppJava(13819): Intent { act=org.mozilla.gecko.restartfennec flg=0x10000000 cmp=org.mozilla.fennec/.Restarter (has extras) }
E/ActivityManager( 2242): Activity Manager Crash
E/ActivityManager( 2242): java.lang.IllegalArgumentException: Can't use FLAG_RECEIVER_BOOT_UPGRADE here
E/ActivityManager( 2242): 	at com.android.server.am.ActivityManagerService.broadcastIntent(ActivityManagerService.java:12016)
E/ActivityManager( 2242): 	at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:260)
E/ActivityManager( 2242): 	at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:1543)
E/ActivityManager( 2242): 	at android.os.Binder.execTransact(Binder.java:287)
E/ActivityManager( 2242): 	at dalvik.system.NativeStart.run(Native Method)
I/GeckoAppJava(13819): java.lang.IllegalArgumentException: Can't use FLAG_RECEIVER_BOOT_UPGRADE here
I/GeckoApp(13819): pause
I/dalvikvm(13819): In threadExitCheck 0x126ed0
E/dalvikvm(13819): Native thread exited without telling us
E/dalvikvm(13819): VM aborting
Attached patch follow up patchSplinter Review
FLAG_RECEIVER_BOOT_UPGRADE is an internal flag which happens to have the same value as FLAG_ACTIVITY_NEW_TASK. It turns out that FLAG_ACTIVITY_NEW_TASK has no effect for broadcast receivers anyway, so dropping this is safe.

For what its worth, this worked all along for me on my nexus one running froyo, but it didn't work on my i9000 running eclair. Perhaps this was fixed on the android side in froyo???
Attachment #485781 - Flags: review?(mwu)
Comment on attachment 485781 [details] [diff] [review]
follow up patch

Hm, I assumed there was a reason for this getting set but I guess not.
Attachment #485781 - Flags: review?(mwu) → review+
(In reply to comment #17)
> Comment on attachment 485781 [details] [diff] [review]
> follow up patch
> 
> Hm, I assumed there was a reason for this getting set but I guess not.

We need it set for the intent in Restarter.java.in. Figured it wouldn't hurt to set it here too, I was wrong.
pushed http://hg.mozilla.org/mozilla-central/rev/4e8cfc63fbc3
Status: REOPENED → RESOLVED
Closed: 9 years ago9 years ago
Resolution: --- → FIXED
Verified for install trigger (system notification, then restart button) and plugins installed through the plugins tab in the control panel:

Mozilla/5.0 (Android; Linux armv71; rv2.0b8pre) Gecko/20101026 Firefox/4.0b8pre Fennec/4.0b2pre
Status: RESOLVED → VERIFIED
Depends on: 842209
You need to log in before you can comment on or make changes to this bug.