Closed Bug 888676 Opened 6 years ago Closed 6 years ago

java.lang.NullPointerException: at org.mozilla.gecko.GeckoApp$17.run(GeckoApp.java)

Categories

(Firefox for Android :: General, defect, critical)

23 Branch
ARM
Android
defect
Not set
critical

Tracking

()

RESOLVED FIXED
Firefox 25
Tracking Status
firefox23 --- fixed
firefox24 --- fixed

People

(Reporter: scoobidiver, Assigned: rnewman)

Details

(Keywords: crash, Whiteboard: [native-crash])

Crash Data

Attachments

(1 file)

It's currently #27 crasher in 23.0b1.

Here is a crash report, bp-3a862d20-2f2f-4124-b9c6-8296b2130629, where the user says in Italian: "block occurred in private browsing"

java.lang.NullPointerException
	at org.mozilla.gecko.GeckoApp$17.run(GeckoApp.java:1702)
	at android.os.Handler.handleCallback(Handler.java:605)
	at android.os.Handler.dispatchMessage(Handler.java:92)
	at android.os.Looper.loop(Looper.java:154)
	at org.mozilla.gecko.util.GeckoBackgroundThread.run(GeckoBackgroundThread.java:32)

Here is the faulty line, https://mxr.mozilla.org/mozilla-beta/source/mobile/android/base/GeckoApp.java#1702, i.e. mHealthRecorder.recordJavaStartupTime(javaDuration).

More reports at:
https://crash-stats.mozilla.com/report/list?product=FennecAndroid&signature=java.lang.NullPointerException%3A+at+org.mozilla.gecko.GeckoApp%2417.run%28GeckoApp.java%29
This implies that onDestroy() has occurred prior to initialize()'s background runnable being hit, or something is throwing prior to line 1484 (where mHealthRecorder is assigned).

Both seem very unlikely, unless the user has "Destroy all activities" set and they're really quick on the finger.

I'll band-aid this on Monday.
Untested.
Assignee: nobody → rnewman
Status: NEW → ASSIGNED
Attachment #769454 - Flags: review?(nalexander)
Comment on attachment 769454 [details] [diff] [review]
Proposed patch. v1

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

There's one other unprotected |mHealthRecorder| access at http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/GeckoApp.java#561.  That would be a shutdown race, but are you feeling lucky, punk?

::: mobile/android/base/GeckoApp.java
@@ +1525,5 @@
>              @Override
>              public void run() {
> +                final BrowserHealthRecorder rec = mHealthRecorder;
> +                if (rec != null) {
> +                    rec.recordJavaStartupTime(javaDuration);

Maybe log? epsilon fg.
Attachment #769454 - Flags: review?(nalexander) → review+
https://hg.mozilla.org/services/services-central/rev/2ae11ca43e44
Whiteboard: [native-crash] → [native-crash][fixed in services]
https://hg.mozilla.org/mozilla-central/rev/2ae11ca43e44
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Whiteboard: [native-crash][fixed in services] → [native-crash]
Target Milestone: --- → Firefox 25
Comment on attachment 769454 [details] [diff] [review]
Proposed patch. v1

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 
  Initial FHR landing.

User impact if declined: 
  Some number of crashes.

Testing completed (on m-c, etc.): 
  Landed on m-c; can't really verify until we see whether crash rate goes down.

Risk to taking this patch (and alternatives if risky): 
  Should be none: just null checks.

String or IDL/UUID changes made by this patch:
  None.
Attachment #769454 - Flags: approval-mozilla-beta?
Attachment #769454 - Flags: approval-mozilla-aurora?
Attachment #769454 - Flags: approval-mozilla-beta?
Attachment #769454 - Flags: approval-mozilla-beta+
Attachment #769454 - Flags: approval-mozilla-aurora?
Attachment #769454 - Flags: approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.