Closed Bug 636663 Opened 15 years ago Closed 15 years ago

Android Java Crash java.lang.IllegalArgumentException

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
critical

Tracking

(fennec2.0+)

RESOLVED DUPLICATE of bug 663447
Tracking Status
fennec 2.0+ ---

People

(Reporter: pavlov, Assigned: blassey)

References

Details

(Keywords: crash)

Attachments

(1 file, 1 obsolete file)

java.lang.IllegalArgumentException: View not attached to window manager at android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:391) at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:236) at android.view.Window$LocalWindowManager.removeView(Window.java:432) at android.app.Dialog.dismissDialog(Dialog.java:278) at android.app.Dialog.access$000(Dialog.java:71) at android.app.Dialog$1.run(Dialog.java:111) at android.os.Handler.handleCallback(Handler.java:587) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:143) at android.app.ActivityThread.main(ActivityThread.java:5068) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:521) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) at dalvik.system.NativeStart.main(Native Method)
Keywords: crash
OS: Windows 7 → Android
Hardware: x86 → ARM
Stuart, how did you get this crash in the Android OS? Does it have something to do with Fennec?
Severity: normal → critical
tracking-fennec: --- → ?
tracking-fennec: ? → 2.0-
tracking-fennec: 2.0- → ?
stuart, str? were you rotating the screen when this happened?
Assignee: nobody → doug.turner
So, the window manager owns a view. When we change the view, it is best to be on the main thread or things become racy. You can change the view by simply calling dismiss on a view. This happens in the crash reporting code. finish() calls .dismiss on the progress dialog: http://mxr.mozilla.org/mozilla-central/source/embedding/android/CrashReporter.java.in#94 We call finish after posting the crash report on a separate thread here: http://mxr.mozilla.org/mozilla-central/source/embedding/android/CrashReporter.java.in#301 So, if the orientation changes, you will see this throw. It is easy enough to wrap the dimiss() with a try/catch. However, do the reports suggest that there are other ways of crashing? Looking through gecko, i don't see other android system dialogs that are dismissed. mwu, blassey?
Assignee: doug.turner → nobody
Assignee: nobody → doug.turner
The other thing I noticed is that at startup I see 4 calls on AndroidBridge that are not on the main thread: Init() SetSurfaceView() SetMainThread() AttachThread() Can any of these race on anything view related? I don't think so, but not sure.
tracking-fennec: ? → 2.0+
Attached patch patch (obsolete) — Splinter Review
Assignee: doug.turner → blassey.bugs
Attachment #516881 - Flags: review?(doug.turner)
Whiteboard: [needs-review (dougt)]
Comment on attachment 516881 [details] [diff] [review] patch in order to prevent multiple doFinish() calls, you should move: mHandler = new Handler() into doFinish() like so: void doFinish() { if (mHandler == null) { mHandler = new Handler() mHandler.post(new Runnable(){ public void run() { finish(); }}); } }
Attachment #516881 - Flags: review?(doug.turner) → review-
No, the handler needs ti be created on thee main thread. That's the whole point of this. Besides there shouldn't be anything dangerous about multiple finish () calls, nor do I think thur code can even do that
could you comment why the handler is created where it is? if so, i am happy with that.
Whiteboard: [needs-review (dougt)]
Attached patch patchSplinter Review
added comment dougt asked for on irc
Attachment #516881 - Attachment is obsolete: true
Attachment #516991 - Flags: review?(doug.turner)
Attachment #516991 - Flags: review?(doug.turner) → review+
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Stuart, can you provide steps to reproduce please?
I don't have STR -- this was reported from the Android market java crash stats
Can someone please verify this bug ?
Not fixed. We still see this crash in beta 5 (see bug 663447). Making a dup of bug 663447 so we can keep tracking it.
Resolution: FIXED → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: