Closed Bug 774072 Opened 12 years ago Closed 12 years ago

android.os.NetworkOnMainThreadException: at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java) on Honeycomb and above

Categories

(Firefox for Android Graveyard :: General, defect)

15 Branch
ARM
Android
defect
Not set
critical

Tracking

(firefox15+ verified, firefox16 fixed)

RESOLVED FIXED
Firefox 17
Tracking Status
firefox15 + verified
firefox16 --- fixed

People

(Reporter: scoobidiver, Assigned: bnicholson)

References

Details

(4 keywords, Whiteboard: [native-crash])

Crash Data

Attachments

(1 file)

It first appeared in 15.0a2/20120714. Here is a crash report: bp-65f081cc-b785-4625-9120-ab1a52120715.
It also occurs in 14.0a2/20120710172204 and 14.0a2/20120704192430 that are not supposed to exist!
The Aurora regression range is:
http://hg.mozilla.org/releases/mozilla-aurora/pushloghtml?fromchange=88382a387a66&tochange=7140e39a6427

android.os.NetworkOnMainThreadException
	at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1099)
	at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.close(OpenSSLSocketImpl.java:922)
	at org.apache.http.impl.SocketHttpClientConnection.close(SocketHttpClientConnection.java:205)
	at org.apache.http.impl.conn.DefaultClientConnection.close(DefaultClientConnection.java:161)
	at org.apache.http.impl.conn.tsccm.AbstractConnPool.closeConnection(AbstractConnPool.java:320)
	at org.apache.http.impl.conn.tsccm.ConnPoolByRoute.shutdown(ConnPoolByRoute.java:678)
	at org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager.shutdown(ThreadSafeClientConnManager.java:257)
	at android.net.http.AndroidHttpClient.close(AndroidHttpClient.java:238)
	at org.mozilla.gecko.Favicons.close(Favicons.java:211)
	at org.mozilla.gecko.GeckoApp.onDestroy(GeckoApp.java:2230)
	at org.mozilla.gecko.BrowserApp.onDestroy(BrowserApp.java:210)
	at android.app.Activity.performDestroy(Activity.java:4726)
	at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1083)
	at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3113)
	at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3144)
	at android.app.ActivityThread.access$1200(ActivityThread.java:128)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1194)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:137)
	at android.app.ActivityThread.main(ActivityThread.java:4514)
	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:993)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760)
	at dalvik.system.NativeStart.main(Native Method)

More reports at:
https://crash-stats.mozilla.com/report/list?signature=android.os.NetworkOnMainThreadException%3A+at+android.os.StrictMode%24AndroidBlockGuardPolicy.onNetwork%28StrictMode.java%29
Summary: android.os.NetworkOnMainThreadException: at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java) → android.os.NetworkOnMainThreadException: at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java) on Honeycomb and above
It's currently #9 top crasher in 15.0a2.

I think it's a regression from bug 762691. Another patch that landed in 16.0a1 is required in 15.0 Beta.
Looks like this is only Honeycomb and higher because that's when this exception was introduced: http://developer.android.com/reference/android/os/NetworkOnMainThreadException.html
Assignee: nobody → bnicholson
Attachment #643095 - Flags: review?(mark.finkle)
I don't understand why 16 is unaffected -- we don't seem to do anything differently.
(In reply to Brian Nicholson (:bnicholson) from comment #3)
> I don't understand why 16 is unaffected -- we don't seem to do anything
> differently.
It's weird because the Nightly and Aurora populations are close: 1600 ADU on Nightly, 2400 ADU on Aurora.

Can you fill in the Blocks field?
Blocks: 762691
Attachment #643095 - Flags: review?(mark.finkle) → review+
Firefox 15.0b1 (2012-07-18)
Device: Galaxy Nexus
OS: Android 4.0.4

Steps to reproduce:
1. Open Firefox
2. Browse to any webpage
3. Put Firefox in background by tapping on the device Home button
4. Change the OS language
5. Reopen Firefox

Expected result:
No crash should occur at start up.

Actual result:
This crash always occur after step 5.

Crash report: https://crash-stats.mozilla.com/report/index/bp-ea35cc87-08c6-4b6a-af43-e93d12120718
Keywords: reproducible
Christian, does it happen in Aurora?
(In reply to Scoobidiver from comment #6)
> Christian, does it happen in Aurora?

Affirmative. Here is the crash report for the latest Aurora build: 
https://crash-stats.mozilla.com/report/index/bp-5f82c9fc-5f67-432d-a080-8131a2120718

--
Firefox 16.0a2 (2012-07-17)
Device: Galaxy Nexus
OS: Android 4.0.4
Comment on attachment 643095 [details] [diff] [review]
Close Favicons on background thread

[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 762691
User impact if declined: crash possibility
Testing completed (on m-c, etc.): just landed on m-i
Risk to taking this patch (and alternatives if risky): low risk
String or UUID changes made by this patch: none
Attachment #643095 - Flags: approval-mozilla-beta?
Attachment #643095 - Flags: approval-mozilla-aurora?
https://hg.mozilla.org/mozilla-central/rev/b5f68f2de649
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 17
Comment on attachment 643095 [details] [diff] [review]
Close Favicons on background thread

[Triage Comment]
Although we have low ADI on FF15b1, this is already at the top of the list. Approving for Aurora 16 and Beta 15.
Attachment #643095 - Flags: approval-mozilla-beta?
Attachment #643095 - Flags: approval-mozilla-beta+
Attachment #643095 - Flags: approval-mozilla-aurora?
Attachment #643095 - Flags: approval-mozilla-aurora+
This crash is not reproducible anymore on the latest Beta build.

--
Firefox 15.0b2 (2012-07-24)
Device: Acer Iconia TAB A500
OS: Android 3.2
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: