Closed
Bug 733434
Opened 12 years ago
Closed 12 years ago
Breakpad not reporting uncaught Java exceptions
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 13
People
(Reporter: cpeterson, Assigned: cpeterson)
Details
Attachments
(2 files, 2 obsolete files)
2.82 KB,
patch
|
blassey
:
review+
|
Details | Diff | Splinter Review |
4.90 KB,
patch
|
blassey
:
review+
|
Details | Diff | Splinter Review |
We try to catch and report unexpected Java exceptions, but there are some code paths where our exception handler is not in the call stack. We should investigate whether we can integrate Java's UncaughtExceptionHandler and Breakpad: https://developer.android.com/reference/java/lang/Thread.UncaughtExceptionHandler.html http://www.javapractices.com/topic/TopicAction.do?Id=229 Bug 730890 is an example of an uncaught Java exception that causes a Dalvik 0xdeadd00d abort. Those stack traces are pretty much useless for us.
Comment 1•12 years ago
|
||
I think Scott also filed a similar bug 733434.
Comment 2•12 years ago
|
||
(bug 731903)
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → cpeterson
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•12 years ago
|
||
Register a global UncaughtExceptionHandler that calls Breakpad for uncaught exceptions on *any* thread.
Attachment #603459 -
Flags: review?(doug.turner)
Attachment #603459 -
Flags: review?(blassey.bugs)
Assignee | ||
Comment 4•12 years ago
|
||
Remove old exception handlers made redundant by global UncaughtExceptionHandler. blassey, this patch removes sTryCatchAttached. Do we even need the Looper.loop() runnable if the global UncaughtExceptionHandler will call Breakpad without needing a try/catch?
Attachment #603462 -
Flags: review?(doug.turner)
Attachment #603462 -
Flags: review?(blassey.bugs)
Comment 5•12 years ago
|
||
Comment on attachment 603459 [details] [diff] [review] bug-733434-part-1-register-global-exception-handler.patch Review of attachment 603459 [details] [diff] [review]: ----------------------------------------------------------------- overall, good stuff. I want to see a patch that registers for other threads though. ::: mobile/android/base/GeckoApp.java @@ +1601,5 @@ > /** Called when the activity is first created. */ > @Override > public void onCreate(Bundle savedInstanceState) > { > + GeckoAppShell.registerBreakpadExceptionHandler(); this only registers for the main ui thread. We should probably do this for the gecko thread and the background thread as well. As well as any other thread that accesses JNI (perhaps doing it in GetJNIForThread()
Attachment #603459 -
Flags: review?(blassey.bugs) → review-
Comment 6•12 years ago
|
||
Comment on attachment 603462 [details] [diff] [review] bug-733434-part-2-remove-old-exception-handlers.patch Review of attachment 603462 [details] [diff] [review]: ----------------------------------------------------------------- r+ for the GeckoApp.java and GeckoThread.java changes. Obviously need the first patch before landing though. ::: mobile/android/base/GeckoApp.java @@ +1744,5 @@ > + mMainHandler.post(new Runnable() { > + public void run() { > + Looper.loop(); > + } > + }); not really needed anymore, just delete entirely ::: mobile/android/base/GeckoAppShell.java @@ +156,5 @@ > StringWriter sw = new StringWriter(); > PrintWriter pw = new PrintWriter(sw); > e.printStackTrace(pw); > pw.flush(); > + return sw.toString(); roll all of these changes into the previous patch. ::: mobile/android/base/GeckoThread.java @@ -106,5 @@ > - mUri, > - mRestoreSession); > - } catch (Exception e) { > - GeckoAppShell.reportJavaCrash(e); > - } as I understand it, your previous patch will not catch these exceptions. Gotta fix that before removing this try/catch
Attachment #603462 -
Flags: review?(blassey.bugs) → review+
Assignee | ||
Comment 7•12 years ago
|
||
> this only registers for the main ui thread. We should probably do this for the gecko > thread and the background thread as well. As well as any other thread that accesses JNI > (perhaps doing it in GetJNIForThread() UncaughtExceptionHandler is global. It will trap uncaught exceptions from any Java thread. That's why the uncaughtException() method takes a Thread parameter: https://developer.android.com/reference/java/lang/Thread.UncaughtExceptionHandler.html I confirmed this by spawning a new Thread and throwing an exception, which was successfully trapped by the global UncaughtExceptionHandler.
Assignee | ||
Comment 8•12 years ago
|
||
patch part 1 v2: * Renamed registerBreakpadExceptionHandler() to registerGlobalExceptionHandler() to clarify its scope. * Migrated reportJavaCrash(getStackTraceString(e)) change from patch 2.
Attachment #603459 -
Attachment is obsolete: true
Attachment #603798 -
Flags: review?(blassey.bugs)
Attachment #603459 -
Flags: review?(doug.turner)
Assignee | ||
Comment 9•12 years ago
|
||
patch part 2 v2: * Removed extraneous Looper runnable.
Attachment #603462 -
Attachment is obsolete: true
Attachment #603802 -
Flags: review?(blassey.bugs)
Attachment #603462 -
Flags: review?(doug.turner)
Updated•12 years ago
|
Attachment #603798 -
Flags: review?(blassey.bugs) → review+
Updated•12 years ago
|
Attachment #603802 -
Flags: review?(blassey.bugs) → review+
Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
Comment 10•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/9cbfd556de65 https://hg.mozilla.org/integration/mozilla-inbound/rev/14515a9d0ab7 BTW Brad, you are not currently listed as a Fennec peer on the Modules wiki. You should probably fix that :-) https://wiki.mozilla.org/Modules/All
Keywords: checkin-needed
Comment 11•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/9cbfd556de65 https://hg.mozilla.org/mozilla-central/rev/14515a9d0ab7
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 13
Updated•3 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
•