Closed Bug 1174725 Opened 9 years ago Closed 9 years ago

crash in java.lang.UnsatisfiedLinkError: putenv at org.mozilla.gecko.mozglue.GeckoLoader.putenv(Native Method)

Categories

(Firefox for Android Graveyard :: General, defect)

40 Branch
ARM
Android
defect
Not set
critical

Tracking

(firefox41 fixed)

RESOLVED FIXED
Firefox 41
Tracking Status
firefox41 --- fixed

People

(Reporter: aaronmt, Assigned: jchen)

Details

(Keywords: crash)

Crash Data

Attachments

(1 file)

This bug was filed from the Socorro interface and is 
report bp-0d9b6a30-0309-477a-ae4d-f01b22150614.
=============================================================

java.lang.UnsatisfiedLinkError: putenv
	at org.mozilla.gecko.mozglue.GeckoLoader.putenv(Native Method)
	at org.mozilla.gecko.mozglue.GeckoLoader.setupPluginEnvironment(GeckoLoader.java:74)
	at org.mozilla.gecko.mozglue.GeckoLoader.setupGeckoEnvironment(GeckoLoader.java:142)
	at org.mozilla.gecko.GeckoThread.initGeckoEnvironment(GeckoThread.java:113)
	at org.mozilla.gecko.GeckoThread.run(GeckoThread.java:169)
Flags: needinfo?(nchen)
Looks like a race condition. Should be a simple fix.
Flags: needinfo?(nchen)
Assignee: nobody → nchen
Status: NEW → ASSIGNED
There's a synchronization bug in GeckoLoader: we toggle the already-loaded flag before we actually do the loading outside the lock. So another thread could see the flag and think we already loaded the library, but we're still in the process of loading it.

This patch moves library loading to inside the lock, so things are consistent. This has no impact on performance except other threads will now wait for loading to finish, which is the correct behavior. I also got rid of the "lock object" in favor of using synchronized methods.
Attachment #8622711 - Flags: review?(snorp)
FWIW, a while ago I found a hackish way to do putenv without mozglue, it might be worth switching, since it would allow setting environment earlier, etc.

http://stackoverflow.com/questions/318239/how-do-i-set-environment-variables-from-java/22315463#22315463
Comment on attachment 8622711 [details] [diff] [review]
Fix GeckoLoader synchronization (v1)

Review of attachment 8622711 [details] [diff] [review]:
-----------------------------------------------------------------

yup. oops.
Attachment #8622711 - Flags: review?(snorp) → review+
https://hg.mozilla.org/mozilla-central/rev/8c88a4ed79db
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 41
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: