Closed Bug 850875 Opened 7 years ago Closed 7 years ago

Regressed Setting environment variable for Fennec

Categories

(Firefox for Android :: General, defect)

All
Android
defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 22

People

(Reporter: BenWa, Assigned: kats)

References

Details

(Keywords: regression)

Attachments

(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(GeckoLoader.java:239)
W/System.err(15847): 	at org.mozilla.gecko.GeckoApplication.onCreate(GeckoApplication.java:69)
W/System.err(15847): 	at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:999)
W/System.err(15847): 	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4151)
W/System.err(15847): 	at android.app.ActivityThread.access$1300(ActivityThread.java:130)
W/System.err(15847): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1255)
W/System.err(15847): 	at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err(15847): 	at android.os.Looper.loop(Looper.java:137)
W/System.err(15847): 	at android.app.ActivityThread.main(ActivityThread.java:4745)
W/System.err(15847): 	at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err(15847): 	at java.lang.reflect.Method.invoke(Method.java:511)
W/System.err(15847): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
W/System.err(15847): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
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 https://tbpl.mozilla.org/?tree=Try&rev=612b84067f06. 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 (email:kats@mozilla.com) from comment #4)

> Try build in progress at
> https://tbpl.mozilla.org/?tree=Try&rev=612b84067f06. 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 https://google.com

Expected: 

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]
Patch

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]
Patch

Switching reviewer since cpeterson is on PTO
Attachment #724734 - Flags: review?(cpeterson) → review?(blassey.bugs)
Attachment #724734 - Flags: review?(blassey.bugs) → review+
https://hg.mozilla.org/mozilla-central/rev/acc201607999
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 22
You need to log in before you can comment on or make changes to this bug.