Closed
Bug 792702
Opened 11 years ago
Closed 11 years ago
java.lang.IllegalThreadStateException: Expected thread 1 ("main"), but running on thread <n> ("GeckoBackgroundThread) at org.mozilla.gecko.GeckoApp.assertOnThread(GeckoApp.java)
Categories
(Firefox for Android Graveyard :: General, defect, P1)
Tracking
(firefox16 fixed, firefox17 verified, firefox18 verified, firefox19 verified, firefox20 verified)
VERIFIED
FIXED
Firefox 18
People
(Reporter: scoobidiver, Assigned: cpeterson)
References
()
Details
(Keywords: crash, regression, reproducible, Whiteboard: [native-crash])
Crash Data
Attachments
(1 file)
1.07 KB,
patch
|
kats
:
review+
lsblakk
:
approval-mozilla-aurora+
lsblakk
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
There's one crash in 18.0a1/20120919: bp-249094c2-7759-4ef3-817d-5f49c2120920. java.lang.IllegalThreadStateException: Expected thread 1 ("main"), but running on thread 9 ("GeckoBackgroundThread) at org.mozilla.gecko.GeckoApp.assertOnThread(GeckoApp.java:2658) at org.mozilla.gecko.GeckoApp.assertOnUiThread(GeckoApp.java:2645) at org.mozilla.gecko.PromptService.show(PromptService.java:186) at org.mozilla.gecko.ActivityHandlerHelper$FilePickerPromptRunnable.run(ActivityHandlerHelper.java:240) at android.os.Handler.handleCallback(Handler.java:587) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:130) at org.mozilla.gecko.util.GeckoBackgroundThread.run(GeckoBackgroundThread.java:31) More reports at: https://crash-stats.mozilla.com/report/list?signature=java.lang.IllegalThreadStateException%3A+Expected+thread+1+%28%22main%22%29%2C+but+running+on+thread+9+%28%22GeckoBackgroundThread%29+at+org.mozilla.gecko.GeckoApp.assertOnThread%28GeckoApp.java%29
Assignee | ||
Comment 1•11 years ago
|
||
kats, I think the FilePickerPromptRunnable should be posted to the UI thread' GeckoAppShell.getMainHandler(), not the GeckoBackgroundThread's GeckoAppShell.getHandler(): https://hg.mozilla.org/mozilla-central/annotate/6a2d1a3556b9/mobile/android/base/ActivityHandlerHelper.java#l151 I think we should rename these GeckoAppShell Handler getters to something clearer like getUiThreadHandler() and getBackgroundThreadHandler() (and remove getGeckoHandler() because it is not used).
Priority: -- → P2
Comment 2•11 years ago
|
||
Sounds reasonable to me. Do you want me to do it or will you?
Assignee | ||
Comment 3•11 years ago
|
||
I can fix the crash, since I added the assertOnUiThread() call when fixing a related PromptService bug. :) Aurora 17 and Beta 16 don't call assertOnUiThread() here, but they still have the bug. This bug is likely contributing to the CalledFromWrongThreadException topcrashes.
Assignee: nobody → cpeterson
Status: NEW → ASSIGNED
Priority: P2 → P1
Assignee | ||
Comment 4•11 years ago
|
||
STR: 1. Load http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_input_type_file 2. Press "Browse..." button 3. Choose a file 4. CRASH!
status-firefox18:
--- → affected
Keywords: reproducible
Assignee | ||
Comment 5•11 years ago
|
||
Post FilePicker dialog to UI thread, not GeckoBackgroundThread.
Attachment #663128 -
Flags: review?(bugmail.mozilla)
Assignee | ||
Comment 6•11 years ago
|
||
btw, my fix reveals a bunch of FilePicker StrictMode warnings. I confirmed that these warnings at not a regression from my patch, so I filed new bug 792973.
Updated•11 years ago
|
Attachment #663128 -
Flags: review?(bugmail.mozilla) → review+
Assignee | ||
Comment 7•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/dbed92805ae7
Target Milestone: --- → Firefox 18
Assignee | ||
Comment 8•11 years ago
|
||
Comment on attachment 663128 [details] [diff] [review] post-FilePicker-to-UI-thread.patch [Approval Request Comment] Bug caused by (feature/regressing bug #): bug 786312 User impact if declined: Nightly 18 has 100% repro crashes when trying to use FilePicker (e.g. Bugzilla attachment). Aurora 17 and Beta 16 don't immediately crash here, but they still have the logic bug. This bug is likely contributing to 17 and 16's CalledFromWrongThreadException topcrashes. Testing completed (on m-c, etc.): Tested locally with 100% STR Risk to taking this patch (and alternatives if risky): Low risk. Android-only java one-liner. Some UI code was running on a background thread, but it should only run on the UI thread. String or UUID changes made by this patch: N/A
Attachment #663128 -
Flags: approval-mozilla-beta?
Attachment #663128 -
Flags: approval-mozilla-aurora?
Reporter | ||
Updated•11 years ago
|
Keywords: regression
Version: Trunk → Firefox 16
Reporter | ||
Updated•11 years ago
|
Crash Signature: [@ java.lang.IllegalThreadStateException: Expected thread 1 ("main"), but running on thread 9 ("GeckoBackgroundThread) at org.mozilla.gecko.GeckoApp.assertOnThread(GeckoApp.java)] → [@ java.lang.IllegalThreadStateException: Expected thread 1 ("main"), but running on thread 9 ("GeckoBackgroundThread) at org.mozilla.gecko.GeckoApp.assertOnThread(GeckoApp.java)]
[@ java.lang.IllegalThreadStateException: Expected thread 1 ("main") but r…
Summary: java.lang.IllegalThreadStateException: Expected thread 1 ("main"), but running on thread 9 ("GeckoBackgroundThread) at org.mozilla.gecko.GeckoApp.assertOnThread(GeckoApp.java) → java.lang.IllegalThreadStateException: Expected thread 1 ("main"), but running on thread <n> ("GeckoBackgroundThread) at org.mozilla.gecko.GeckoApp.assertOnThread(GeckoApp.java)
Reporter | ||
Updated•11 years ago
|
Crash Signature: [@ java.lang.IllegalThreadStateException: Expected thread 1 ("main"), but running on thread 9 ("GeckoBackgroundThread) at org.mozilla.gecko.GeckoApp.assertOnThread(GeckoApp.java)]
[@ java.lang.IllegalThreadStateException: Expected thread 1 ("main") but r… → [@ java.lang.IllegalThreadStateException: Expected thread 1 ("main"), but running on thread 9 ("GeckoBackgroundThread) at org.mozilla.gecko.GeckoApp.assertOnThread(GeckoApp.java) ]
[@ java.lang.IllegalThreadStateException: Expected thread 1 ("main") but …
Comment 9•11 years ago
|
||
Triage drive-by: Likely we can take this on Monday if it has been landed on trunk before then without any known fallout.
Assignee | ||
Comment 10•11 years ago
|
||
(In reply to Lukas Blakk [:lsblakk] from comment #9) > Triage drive-by: Likely we can take this on Monday if it has been landed on > trunk before then without any known fallout. I am testing a band-aid fix now.
Assignee | ||
Comment 11•11 years ago
|
||
^ oops! My comment about a "band-aid fix" was intended for bug 747629, not this bug! <:)
Comment 12•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/dbed92805ae7
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Assignee | ||
Comment 13•11 years ago
|
||
Comment on attachment 663128 [details] [diff] [review] post-FilePicker-to-UI-thread.patch (In reply to Lukas Blakk [:lsblakk] from comment #9) > Triage drive-by: Likely we can take this on Monday if it has been landed on > trunk before then without any known fallout. lsblakk, renomming for aurora? and beta? I landed my patch on 09-21, so the first build to include my fix was 09-22. Before my fix, I see about a dozen crash reports in builds 09-20 and 09-21. After my fix, I see no crash reports in builds 09-22, 09-23, or 09-24.
Updated•11 years ago
|
Attachment #663128 -
Flags: approval-mozilla-beta?
Attachment #663128 -
Flags: approval-mozilla-beta+
Attachment #663128 -
Flags: approval-mozilla-aurora?
Attachment #663128 -
Flags: approval-mozilla-aurora+
Updated•11 years ago
|
status-firefox16:
--- → affected
status-firefox17:
--- → affected
Assignee | ||
Comment 14•11 years ago
|
||
https://hg.mozilla.org/releases/mozilla-aurora/rev/628cc50702f8 https://hg.mozilla.org/releases/mozilla-beta/rev/c085464581b6
Comment 15•11 years ago
|
||
This crash doesn't occur on any branch if I perform the STR from comment #4. Closing bug as verified fixed on: Firefox 20.0a1 (2012-11-21) Device: Galaxy S2 OS: Android 4.0.3
Updated•2 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•