Closed
Bug 746938
Opened 13 years ago
Closed 13 years ago
java.lang.NullPointerException: at org.mozilla.gecko.GeckoNetworkManager.getNetworkType(GeckoNetworkManager.java)
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(firefox14 affected, firefox15 affected, blocking-fennec1.0 -)
RESOLVED
FIXED
Firefox 16
People
(Reporter: scoobidiver, Assigned: gbrown)
References
Details
(Keywords: crash, Whiteboard: [native-crash])
Crash Data
Attachments
(2 files, 2 obsolete files)
|
2.15 KB,
patch
|
gbrown
:
review+
|
Details | Diff | Splinter Review |
|
2.13 KB,
patch
|
gbrown
:
review+
|
Details | Diff | Splinter Review |
There are four crashes so far, the latest one in 14.0a1/20120414: bp-9a3a7822-e6b4-4a91-b084-0e82b2120419.
java.lang.NullPointerException
at org.mozilla.gecko.GeckoNetworkManager.getNetworkType(GeckoNetworkManager.java:226)
at org.mozilla.gecko.GeckoNetworkManager.updateNetworkType(GeckoNetworkManager.java:183)
at org.mozilla.gecko.GeckoNetworkManager.start(GeckoNetworkManager.java:158)
at org.mozilla.gecko.GeckoApp.onApplicationResume(GeckoApp.java:2147)
at org.mozilla.gecko.GeckoApplication.onActivityResume(GeckoApplication.java:55)
at org.mozilla.gecko.GeckoActivity.onResume(GeckoActivity.java:33)
at org.mozilla.gecko.GeckoApp.onResume(GeckoApp.java:1987)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1154)
at android.app.Activity.performResume(Activity.java:4539)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2434)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2472)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1173)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
More reports at:
https://crash-stats.mozilla.com/report/list?signature=java.lang.NullPointerException%3A+at+org.mozilla.gecko.GeckoNetworkManager.getNetworkType%28GeckoNetworkManager.java%29
Comment 1•13 years ago
|
||
| Assignee | ||
Comment 2•13 years ago
|
||
I do not understand what is going wrong here, but we can be more careful about checking for null in getNetworkType.
Assignee: nobody → gbrown
| Assignee | ||
Comment 3•13 years ago
|
||
Attachment #625688 -
Flags: review?(mounir)
Comment 4•13 years ago
|
||
Comment on attachment 625688 [details] [diff] [review]
check for null returns from system calls in getNetworkType
Review of attachment 625688 [details] [diff] [review]:
-----------------------------------------------------------------
::: embedding/android/GeckoNetworkManager.java
@@ +193,5 @@
>
> + NetworkInfo ni = cm.getActiveNetworkInfo();
> +
> + if (ni == null) {
> + Log.w("GeckoNetworkManager", "Could not get network info");
No need to warn: this is expected when offline IIRC.
Attachment #625688 -
Flags: review?(mounir) → review+
| Assignee | ||
Comment 5•13 years ago
|
||
Extra warning removed as per review comment.
r=mounir carried.
Attachment #625688 -
Attachment is obsolete: true
Attachment #625702 -
Flags: review+
| Assignee | ||
Updated•13 years ago
|
Keywords: checkin-needed
Comment 6•13 years ago
|
||
Keywords: checkin-needed
Target Milestone: --- → Firefox 15
Comment 7•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
| Reporter | ||
Updated•13 years ago
|
status-firefox14:
--- → affected
Comment 9•13 years ago
|
||
It is marked as fixed in Firefox 15 so it isn't surprising to be still visible in Firefox 14, right?
Updated•13 years ago
|
blocking-fennec1.0: ? → -
| Reporter | ||
Comment 10•13 years ago
|
||
There are still crashes in 15.0a2.
| Assignee | ||
Comment 11•13 years ago
|
||
(In reply to Scoobidiver from comment #10)
> There are still crashes in 15.0a2.
Oh no -- I patched the wrong file!!
I updated embedding/android/GeckoNetworkManager.java instead of mobile/android/base/GeckoNetworkManager.java.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
| Assignee | ||
Comment 12•13 years ago
|
||
Same as the previously landed patch, but applied to the native Fennec version of GeckoNetworkManager.
Attachment #625702 -
Attachment is obsolete: true
Attachment #634999 -
Flags: review?(mounir)
| Assignee | ||
Updated•13 years ago
|
Attachment #625702 -
Attachment is obsolete: false
Comment 13•13 years ago
|
||
Comment on attachment 634999 [details] [diff] [review]
check for null returns from system calls in getNetworkType - native!
Review of attachment 634999 [details] [diff] [review]:
-----------------------------------------------------------------
r=me with the changes listed below.
::: mobile/android/base/GeckoNetworkManager.java
@@ +187,5 @@
> ConnectivityManager cm =
> (ConnectivityManager)GeckoApp.mAppContext.getSystemService(Context.CONNECTIVITY_SERVICE);
>
> + if (cm == null) {
> + Log.w("GeckoNetworkManager", "Could not access Connectivity service");
According to the docs [1], the value returned is "The service or null if the name does not exist.". So, I would suggest to switch to an error (because we expect it to exist, right?) and update the message accordingly.
[1] http://developer.android.com/reference/android/content/Context.html#getSystemService(java.lang.String)
@@ +192,5 @@
> return NetworkType.NETWORK_NONE;
> }
>
> + NetworkInfo ni = cm.getActiveNetworkInfo();
> +
nit: Could you remove that empty line?
@@ +215,5 @@
> TelephonyManager tm =
> (TelephonyManager)GeckoApp.mAppContext.getSystemService(Context.TELEPHONY_SERVICE);
>
> + if (tm == null) {
> + Log.w("GeckoNetworkManager", "Could not access Telephony service");
Same as above: should probably be an error and the message should be updated.
Attachment #634999 -
Flags: review?(mounir) → review+
| Assignee | ||
Comment 14•13 years ago
|
||
Updated for review comments - thanks! r=mounir
Attachment #634999 -
Attachment is obsolete: true
Attachment #635374 -
Flags: review+
| Assignee | ||
Comment 15•13 years ago
|
||
Comment 16•13 years ago
|
||
Status: REOPENED → RESOLVED
Closed: 13 years ago → 13 years ago
Resolution: --- → FIXED
Target Milestone: Firefox 15 → Firefox 16
| Reporter | ||
Updated•13 years ago
|
status-firefox15:
--- → affected
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
•