New issue
Advanced search Search tips

Issue 592131 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

cronet crashes when wifi ssid changed

Reported by zhihua....@snapchat.com, Mar 4 2016

Issue description

Example URL:

Steps to reproduce the problem:
1. It happens to one of our test phone samsung s4 mini on Android 4.4, when the wifi ssid changed, here is the crash stack.

Android: 4.4.2
Manufacturer: samsung
Model: GT-I9195

java.lang.RuntimeException: Error receiving broadcast Intent { act=android.net.wifi.RSSI_CHANGED flg=0x4000010 (has extras) } in org.chromium.net.NetworkChangeNotifierAutoDetect@42ed6480
	at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:782)
	at android.os.Handler.handleCallback(Handler.java:733)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at android.os.Looper.loop(Looper.java:146)
	at android.app.ActivityThread.main(ActivityThread.java:5593)
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:515)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
	at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
	at android.os.Parcel.readException(Parcel.java:1471)
	at android.os.Parcel.readException(Parcel.java:1419)
	at android.net.wifi.IWifiManager$Stub$Proxy.getConnectionInfo(IWifiManager.java:1177)
	at android.net.wifi.WifiManager.getConnectionInfo(WifiManager.java:1260)
	at org.chromium.net.NetworkChangeNotifierAutoDetect.org.chromium.net.NetworkChangeNotifierAutoDetect$WifiManagerDelegate.getLinkSpeedInMbps(SourceFile:5228)
                                                     getCurrentMaxBandwidthInMbps
	at org.chromium.net.NetworkChangeNotifierAutoDetect.maxBandwidthChanged(SourceFile:689)
	at org.chromium.net.NetworkChangeNotifierAutoDetect.onReceive(SourceFile:673)
	at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:772)
	... 9 more

What is the expected behavior?
not crash.

What went wrong?
crashed.

Did this work before? N/A 

Chrome version: 48.0.2564.116  Channel: n/a
OS Version: OS X 10.10.5
Flash Version: Shockwave Flash 20.0 r0
 
Cc: mef@chromium.org
Components: -Internals>Network Internals>Network>Library
Owner: xunji...@chromium.org
Status: Assigned (was: Unconfirmed)
Components: Internals>Network>Connectivity
If we can reliably produce this crash or narrow down to a particular device, it will be helpful. But from talking to the reporter, this seems to be a one-off thing. You could check if the app has android.permission.ACCESS_NETWORK_STATE permission, but I think it probably does.
Cc: jkarlin@chromium.org
This is a long-standing issue that seems to affect sdk level <= 21 / Android 5.0. We could wrap the calls in try/catch. But that's not supposed to be necessary. The crash count is pretty low.
b/23041361 is an internal report of this crash.  We haven't seen this cause a significant number of crashes in the wild so we've been reluctant to add an ugly try/catch block here.  This also may not be specific to WifiManager so we're reluctant to add many try/catch blocks.  Does this cause a significant number of crashes or just this one?

Comment 6 by mef@chromium.org, Jun 14 2016

Status: WontFix (was: Assigned)
Per internal discussion this is issue in Android, so there isn't anything particularly useful that could be done in Cronet.
Status: Assigned (was: WontFix)
Actually there may be solutions, see https://codereview.chromium.org/2067633003/
Project Member

Comment 8 by bugdroid1@chromium.org, Jun 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/cff08ce07f12b978a4439dd59f83d76d82c3f9fe

commit cff08ce07f12b978a4439dd59f83d76d82c3f9fe
Author: pauljensen <pauljensen@chromium.org>
Date: Wed Jun 15 13:37:51 2016

Add UMA to measure NPEs coming from Android Wifi/Connectivity services

The UMA being added measures how often we get NullPointerExceptions
when trying to query via WifiManager.getConnectionInfo() and
ConnectivityManager.getNetworkInfo(Network).  If it fails the
first time, the call is repeated and the result is again recorded
with UMA.

BUG= 592131 
R=xunjieli@chromium.org,isherman@chromium.org

Review-Url: https://codereview.chromium.org/2067633003
Cr-Commit-Position: refs/heads/master@{#399888}

[modify] https://crrev.com/cff08ce07f12b978a4439dd59f83d76d82c3f9fe/net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java
[modify] https://crrev.com/cff08ce07f12b978a4439dd59f83d76d82c3f9fe/tools/metrics/histograms/histograms.xml

Owner: pauljensen@chromium.org
Labels: -Pri-2 Pri-3
So far my UMA has caught 0 instances of this crash.
Project Member

Comment 11 by bugdroid1@chromium.org, Aug 18 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ebf40db43a06950a2900842c04a94b63f71ad201

commit ebf40db43a06950a2900842c04a94b63f71ad201
Author: pauljensen <pauljensen@chromium.org>
Date: Thu Aug 18 17:47:45 2016

Prevent crashing when collecting some UMA about possible crashing

Previously we were rethrowing exceptions which caused Chrome to
crash which threw away our UMA data. Instead return some default
values in the rare instances when we would have crashed. This
should facilitate collecting UMA on the possible crashes with
the only side effect of slightly inaccurate network information
in the rare instances where there would have been a crash.

BUG= 592131 
R=xunjieli

Review-Url: https://codereview.chromium.org/2258953002
Cr-Commit-Position: refs/heads/master@{#412886}

[modify] https://crrev.com/ebf40db43a06950a2900842c04a94b63f71ad201/net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java

Project Member

Comment 12 by bugdroid1@chromium.org, May 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1c8889efcad513d89995f0c6eb2a3d6a0f3d4216

commit 1c8889efcad513d89995f0c6eb2a3d6a0f3d4216
Author: pauljensen <pauljensen@chromium.org>
Date: Sat May 13 03:28:59 2017

Remove histograms for system IPCs returning NPEs.

The histograms aren't serving an important purpose anymore.
Leave in code to retry as this does help sometimes.
Catch the NPE to avoid crashing.

BUG= 592131 
R=xunjieli@chromium.org

Review-Url: https://codereview.chromium.org/2872353003
Cr-Commit-Position: refs/heads/master@{#471547}

[modify] https://crrev.com/1c8889efcad513d89995f0c6eb2a3d6a0f3d4216/net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java
[modify] https://crrev.com/1c8889efcad513d89995f0c6eb2a3d6a0f3d4216/tools/metrics/histograms/histograms.xml

Status: Fixed (was: Assigned)
This was fixed in 54.0.2833.0 with the catching of the NPEs.

Sign in to add a comment