Closed
Bug 1066175
Opened 11 years ago
Closed 11 years ago
Make pre-Gecko crashes easier to diagnose
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(firefox33 fixed, firefox34 fixed, firefox35 fixed)
RESOLVED
FIXED
Firefox 35
People
(Reporter: jchen, Assigned: jchen)
References
Details
Attachments
(2 files, 1 obsolete file)
|
1.47 KB,
patch
|
snorp
:
review+
|
Details | Diff | Splinter Review |
|
3.09 KB,
patch
|
jchen
:
review+
Sylvestre
:
approval-mozilla-aurora+
Sylvestre
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
If we crash before Gecko loads (due to Java exception, abort(), etc.), we want the Play Store to catch our crash with an informative message.
| Assignee | ||
Comment 1•11 years ago
|
||
If we fail to annotate the crash report, most likely the crash reporter hasn't been initialized yet. If we force Fennec to crash, the crash reporter won't catch the crash, and we will lose any information about the Java exception. Instead, we should return here and invoke the system crash handler instead.
Attachment #8488143 -
Flags: review?(snorp)
| Assignee | ||
Comment 3•11 years ago
|
||
When the Gecko crash reporter is unavailable, uncaught Java exceptions can end up being ignored. We should try more ways to report the exception.
For Nightly/Aurora builds that don't report crashes to the Play Store, we can cause a hang and get an ANR report sent. For official builds, we can use the system handler to send a report to the Play Store.
Attachment #8488149 -
Flags: review?(snorp)
Updated•11 years ago
|
Attachment #8488143 -
Flags: review?(snorp) → review+
Comment 4•11 years ago
|
||
Comment on attachment 8488149 [details] [diff] [review]
Use other means to handle uncaught exception when Gecko is unavailable (v1)
Review of attachment 8488149 [details] [diff] [review]:
-----------------------------------------------------------------
I have some questions, and not sure we need all of this.
::: mobile/android/base/GeckoAppShell.java
@@ +496,1 @@
> reportJavaCrash(getStackTraceString(e));
What happens when we call this and libxul isn't even loaded yet? Could it cause a native crash, or just throw an exception? Should we check GeckoThread state before calling?
@@ +501,5 @@
> + try {
> + // reportJavaCrash should have caused us to hard crash. If we're still here,
> + // it probably means Gecko is not loaded, and we should do something else.
> + if (AppConstants.MOZ_UPDATER) {
> + // If we are using our own updater, we were not installed from
I'm not a big fan of this. I think we should just skip the hang and let it fallback to the system crash handler (and maybe logcat it, but I assume system handler will do that too). Otherwise, I think it looks like the hang is a symptom of the crash.
@@ +525,5 @@
> + hangRunnable.run();
> + }
> + } finally {
> + // In any case, bring up the app crashed dialog so we don't crash silently.
> + if (systemUncaughtHandler != null) {
Do we actually need to do this? I think the Android one gets these anyway, otherwise we wouldn't have crashes in Google Play.
Attachment #8488149 -
Flags: review?(snorp)
| Assignee | ||
Comment 5•11 years ago
|
||
(In reply to James Willcox (:snorp) (jwillcox@mozilla.com) from comment #4)
> Comment on attachment 8488149 [details] [diff] [review]
> Use other means to handle uncaught exception when Gecko is unavailable (v1)
>
> Review of attachment 8488149 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> I have some questions, and not sure we need all of this.
>
> ::: mobile/android/base/GeckoAppShell.java
> @@ +496,1 @@
> > reportJavaCrash(getStackTraceString(e));
>
> What happens when we call this and libxul isn't even loaded yet? Could it
> cause a native crash, or just throw an exception? Should we check
> GeckoThread state before calling?
It's an UnsatisfiedLinkError that'll be caught by the try block.
> @@ +501,5 @@
> > + try {
> > + // reportJavaCrash should have caused us to hard crash. If we're still here,
> > + // it probably means Gecko is not loaded, and we should do something else.
> > + if (AppConstants.MOZ_UPDATER) {
> > + // If we are using our own updater, we were not installed from
>
> I'm not a big fan of this. I think we should just skip the hang and let it
> fallback to the system crash handler (and maybe logcat it, but I assume
> system handler will do that too). Otherwise, I think it looks like the hang
> is a symptom of the crash.
For Nightly/Aurora, the system handler will just display a dialog. We won't know of the crash until it shows up in the Play Store for Beta and Release. That's what I'm worried about. I guess generating an ANR report won't help much. We should really send something to Socorro.
> @@ +525,5 @@
> > + hangRunnable.run();
> > + }
> > + } finally {
> > + // In any case, bring up the app crashed dialog so we don't crash silently.
> > + if (systemUncaughtHandler != null) {
>
> Do we actually need to do this? I think the Android one gets these anyway,
> otherwise we wouldn't have crashes in Google Play.
Only for the main thread. If we crash in a background thread, the thread will die but we'll just keep going, unless we call the system handler specifically.
Comment 6•11 years ago
|
||
Error is not a subclass of Exception. Be careful when you write your catch blocks!
Comment 7•11 years ago
|
||
(In reply to Jim Chen [:jchen :nchen] from comment #5)
>
> > @@ +501,5 @@
> > > + try {
> > > + // reportJavaCrash should have caused us to hard crash. If we're still here,
> > > + // it probably means Gecko is not loaded, and we should do something else.
> > > + if (AppConstants.MOZ_UPDATER) {
> > > + // If we are using our own updater, we were not installed from
> >
> > I'm not a big fan of this. I think we should just skip the hang and let it
> > fallback to the system crash handler (and maybe logcat it, but I assume
> > system handler will do that too). Otherwise, I think it looks like the hang
> > is a symptom of the crash.
>
> For Nightly/Aurora, the system handler will just display a dialog. We won't
> know of the crash until it shows up in the Play Store for Beta and Release.
> That's what I'm worried about. I guess generating an ANR report won't help
> much. We should really send something to Socorro.
Brad and I were talking about having some stuff to generate Java crash reports without native code. I think that's the next step. I think we should work on that instead of relying on ANR for this.
>
> > @@ +525,5 @@
> > > + hangRunnable.run();
> > > + }
> > > + } finally {
> > > + // In any case, bring up the app crashed dialog so we don't crash silently.
> > > + if (systemUncaughtHandler != null) {
> >
> > Do we actually need to do this? I think the Android one gets these anyway,
> > otherwise we wouldn't have crashes in Google Play.
>
> Only for the main thread. If we crash in a background thread, the thread
> will die but we'll just keep going, unless we call the system handler
> specifically.
Interesting! That's probably worth a comment.
From rnewman's comment it sounds like you need to specifically catch UnsatisfiedLinkError. If you fix that and remove the ANR generation it's a r+ from me. And then we should work on submitting Java crashes without native code. With this stuff in place, I believe we should never get a Google Play crash report. Oh, we'll need to hook all of this up to the other activities/services as well (sync, etc).
Comment 8•11 years ago
|
||
(In reply to James Willcox (:snorp) (jwillcox@mozilla.com) from comment #7)
> Oh, we'll need to hook all of this up to the other
> activities/services as well (sync, etc).
Note that Sync is currently so well guarded that it basically never reports a crash -- because the UX is so bad if a syncadapter falls over. We'd actually like to change that, reporting pseudo-crashes without actually crashing.
| Assignee | ||
Comment 9•11 years ago
|
||
Removed the ANR block, and changed the remaining catch to using Throwable.
Attachment #8488149 -
Attachment is obsolete: true
Attachment #8488760 -
Flags: review+
| Assignee | ||
Comment 10•11 years ago
|
||
Comment 11•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/a0118051b162
https://hg.mozilla.org/mozilla-central/rev/20704dcbd253
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 35
| Assignee | ||
Comment 12•11 years ago
|
||
Comment on attachment 8488760 [details] [diff] [review]
Use other means to handle uncaught exception when Gecko is unavailable (v2)
Approval Request Comment
[Feature/regressing bug #]: N/A
[User impact if declined]: Some crashes not being reported
[Describe test coverage new/current, TBPL]: Locally, m-c
[Risks and why]: Some risk of more crash reports coming in; this bug makes us report crashes that we would have (erroneously) ignored before.
[String/UUID change made/needed]: None
Attachment #8488760 -
Flags: approval-mozilla-beta?
Attachment #8488760 -
Flags: approval-mozilla-aurora?
Updated•11 years ago
|
Updated•11 years ago
|
Attachment #8488760 -
Flags: approval-mozilla-beta?
Attachment #8488760 -
Flags: approval-mozilla-beta+
Attachment #8488760 -
Flags: approval-mozilla-aurora?
Attachment #8488760 -
Flags: approval-mozilla-aurora+
Comment 13•11 years ago
|
||
Updated•5 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
•