Closed Bug 1271020 Opened 8 years ago Closed 8 years ago

Crash in java.lang.NullPointerException: at org.mozilla.gecko.GeckoNetworkManager.updateNetworkStateAndConnectionType(GeckoNetworkManager.java)

Categories

(Firefox for Android Graveyard :: General, defect)

Unspecified
Android
defect
Not set
critical

Tracking

(firefox49+ fixed)

RESOLVED FIXED
Firefox 49
Tracking Status
firefox49 + fixed

People

(Reporter: dbaron, Assigned: Grisha)

References

Details

(Keywords: crash, topcrash)

Crash Data

Attachments

(1 file)

This bug was filed from the Socorro interface and is 
report bp-33bb2114-d4f1-4443-ad88-9cd7c2160506.
=============================================================

This is a new topcrash in May 6 nightly builds:
https://crash-stats.mozilla.com/signature/?product=FennecAndroid&release_channel=nightly&platform=Android&date=%3E%3D2016-04-01&signature=java.lang.NullPointerException%3A+at+org.mozilla.gecko.GeckoNetworkManager.updateNetworkStateAndConnectionType(GeckoNetworkManager.java)

java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object android.content.Context.getSystemService(java.lang.String)' on a null object reference
	at org.mozilla.gecko.GeckoNetworkManager.updateNetworkStateAndConnectionType(GeckoNetworkManager.java:266)
	at org.mozilla.gecko.GeckoNetworkManager.handleManagerEvent(GeckoNetworkManager.java:153)
	at org.mozilla.gecko.GeckoNetworkManager.enableNotifications(GeckoNetworkManager.java:130)
	at org.mozilla.gecko.GeckoAppShell$14.run(GeckoAppShell.java:2069)
	at android.os.Handler.handleCallback(Handler.java:739)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at android.os.Looper.loop(Looper.java:135)
	at android.app.ActivityThread.main(ActivityThread.java:5349)
	at java.lang.reflect.Method.invoke(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:372)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)


Presumably regression from:
https://hg.mozilla.org/mozilla-central/rev/3cac818d4803
Flags: needinfo?(gkruglov)
[Tracking Requested - why for this release]:
(In reply to Nicholas Nethercote [:njn] from comment #2)
> [Tracking Requested - why for this release]:

This is the #1 Fennec topcrash by a mile. 88 crashes in Nightly 20160506052037, which is enormously high for Fennec.
Assignee: nobody → gkruglov
Status: NEW → ASSIGNED
Comment on attachment 8749945 [details]
MozReview Request: Bug 1271020: Add a null check before acting upon applicationContext r=sebastian

https://reviewboard.mozilla.org/r/51257/#review48061

I saw this crash too (after resuming the app from background).

::: mobile/android/base/java/org/mozilla/gecko/GeckoNetworkManager.java:266
(Diff revision 1)
> +        if (applicationContext == null) {
> +            Log.i(LOGTAG, "applicationContext is null while trying to update network state");
> +            return;
> +        }

This is pretty weird. How can the application context be null? By definition it should never be null. This indicates that either this class or the callers are making a false assumption. I'll r+ to fix the crash (and you stated that this check existed before) but maybe we should investigate in a follow-up bug?
Attachment #8749945 - Flags: review?(s.kaspari) → review+
https://hg.mozilla.org/integration/fx-team/rev/9ecdf2bfc28baa20f86c2225b8dc9ff41977ed2e
Bug 1271020: Add a null check before acting upon applicationContext r=sebastian
See Also: → 1271318
(In reply to Sebastian Kaspari (:sebastian) from comment #4)
> Comment on attachment 8749945 [details]
> MozReview Request: Bug 1271020: Add a null check before acting upon
> applicationContext r=sebastian
> 
> https://reviewboard.mozilla.org/r/51257/#review48061
> 
> I saw this crash too (after resuming the app from background).
> 
> ::: mobile/android/base/java/org/mozilla/gecko/GeckoNetworkManager.java:266
> (Diff revision 1)
> > +        if (applicationContext == null) {
> > +            Log.i(LOGTAG, "applicationContext is null while trying to update network state");
> > +            return;
> > +        }
> 
> This is pretty weird. How can the application context be null? By definition
> it should never be null. This indicates that either this class or the
> callers are making a false assumption. I'll r+ to fix the crash (and you
> stated that this check existed before) but maybe we should investigate in a
> follow-up bug?

Agreed, it's pretty strange. I filed Bug 1271318 to investigate further.
Flags: needinfo?(gkruglov)
Tracking for 49.
https://hg.mozilla.org/mozilla-central/rev/9ecdf2bfc28b
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 49
¡Hola!

Did I just file a duplicate at https://bugzilla.mozilla.org/show_bug.cgi?id=1271871 ?

If so, I thoroughly apologize =(

¡Gracias!
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: