Closed Bug 850875 Opened 10 years ago Closed 10 years ago

Regressed Setting environment variable for Fennec


(Firefox for Android Graveyard :: General, defect)

Not set


(Not tracked)

Firefox 22


(Reporter: BenWa, Assigned: kats)



(Keywords: regression)


(1 file)

As of about March 10 it appears that we can no longer set environment variables in Fennec using this syntax:
adb shell am start -n org.mozilla.fennec_$USER/.App --es env0 MOZ_PROFILER_STARTUP=1

This should be handled from loadMozGlue but it fails because !(context instanceof Activity) is true. Context is of type 'org.mozilla.gecko.GeckoApplication' and it's being invoked from here:
W/System.err(15847): java.lang.RuntimeException: 
W/System.err(15847): 	at org.mozilla.gecko.mozglue.GeckoLoader.loadMozGlue(
W/System.err(15847): 	at org.mozilla.gecko.GeckoApplication.onCreate(
W/System.err(15847): 	at
W/System.err(15847): 	at
W/System.err(15847): 	at$1300(
W/System.err(15847): 	at$H.handleMessage(
W/System.err(15847): 	at android.os.Handler.dispatchMessage(
W/System.err(15847): 	at android.os.Looper.loop(
W/System.err(15847): 	at
W/System.err(15847): 	at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err(15847): 	at java.lang.reflect.Method.invoke(
W/System.err(15847): 	at$
W/System.err(15847): 	at
W/System.err(15847): 	at dalvik.system.NativeStart.main(Native Method)
This worked on the March 9th nightly, so the regression must have occurred sometime after that was built.
OS: Mac OS X → Android
Product: Fennec → Firefox for Android
Hardware: x86 → All
By the way, this breaks profiling for fennec.
Yay for unintended consequences.
Attached patch PatchSplinter Review
Try build in progress at Once that's done, BenWa, can you verify that build doesn't suffer from the same problem?
Assignee: nobody → bugmail.mozilla
Attachment #724734 - Flags: review?(cpeterson)
Attachment #724734 - Flags: review?(bgirard)
(In reply to Kartikaya Gupta ( from comment #4)

> Try build in progress at
> Once that's done,
> BenWa, can you verify that build doesn't suffer from the same problem?

Just verified that the try build fixed the issue. FWIW, here's the reproduction steps for the bug:

adb shell am start -W -n org.mozilla.fennec/.App -a android.intent.action.VIEW --es env0 MOZ_PROFILER_STARTUP=true -d


Should see the following types of entries in the logcat:

E/Profiler(  842): Registering start signal
E/Profiler(  842): Sampler started
E/Profiler(  842): Request signal
E/Profiler(  842): Signal installed
E/Profiler(  842): Profiler thread started
Comment on attachment 724734 [details] [diff] [review]

Review of attachment 724734 [details] [diff] [review]:

Thanks for the quick fix
Attachment #724734 - Flags: review?(bgirard) → review+
Comment on attachment 724734 [details] [diff] [review]

Switching reviewer since cpeterson is on PTO
Attachment #724734 - Flags: review?(cpeterson) → review?(blassey.bugs)
Attachment #724734 - Flags: review?(blassey.bugs) → review+
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 22
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.