putenv is called too late during initialization
source link: https://bugzilla.mozilla.org/show_bug.cgi?id=1531632
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
putenv is called too late during initialization
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(firefox66 wontfix, firefox67 fixed)
Firefox 67
People
(Reporter: glandium, Assigned: glandium)
References
Details
This has at least two known side effects:
- This prevents from the instrumentation part of PGO to use the LLVM_PROFILE_FILE environment variable
- This prevents from using MOZ_DEBUG_LINKER to enable the linker debug log (which used to work before because putenv was called earlier).
There are at least two known side effects of initializing it after
loading libxul:
- We can't set LLVM_PROFILE_FILE for the instrumentation part of PGO to
make the compiler-rt static initializer pick it. - We can't set MOZ_DEBUG_LINKER to enable the linker debug log (which
used to work when environment variables were set earlier).
This appears in the log:
No implementation found for void org.mozilla.gecko.mozglue.GeckoLoader.putenv(java.lang.String) (tried Java_org_mozilla_gecko_mozglue_GeckoLoader_putenv and Java_org_mozilla_gecko_mozglue_GeckoLoader_putenv__Ljava_lang_String_2)
which is interesting, because it suggests libmozglue is not loaded, which I guess makes sense, but why is it a problem only on x86_64?
(In reply to Mike Hommey [:glandium] from comment #4)
This appears in the log:
No implementation found for void org.mozilla.gecko.mozglue.GeckoLoader.putenv(java.lang.String) (tried Java_org_mozilla_gecko_mozglue_GeckoLoader_putenv and Java_org_mozilla_gecko_mozglue_GeckoLoader_putenv__Ljava_lang_String_2)
which is interesting, because it suggests libmozglue is not loaded, which I guess makes sense, but why is it a problem only on x86_64?
I don't see that it attempted any tests on ARM, so I'm sure it fails there too.
Snorp, help!
This fixes it for me. You need to wait for init() to be called, and it was happening too late (and doesn't need to wait for LIBS_READY state).
Comment on attachment 9049174 [details] [diff] [review] wait-init.diff Review of attachment 9049174 [details] [diff] [review]: ----------------------------------------------------------------- Thank you!
Oh, I missed the removal of the state check.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK