12

putenv is called too late during initialization

 3 years ago
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.
neoserver,ios ssh client
Closed Bug 1531632 Opened 2 years ago Closed 2 years ago

putenv is called too late during initialization

Categories

(Firefox for Android Graveyard :: General, defect)

Firefox for Android Graveyard ▾
General ▾

Tracking

(firefox66 wontfix, firefox67 fixed)

RESOLVED FIXED

Firefox 67

Tracking Status firefox66 --- wontfix firefox67 --- fixed

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.

Flags: needinfo?(snorp)

Snorp, help!

Flags: needinfo?(mh+mozilla)

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).

Flags: needinfo?(snorp)
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.

Flags: needinfo?(mh+mozilla)
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK