Last Comment Bug 774072 - android.os.NetworkOnMainThreadException: at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java) on Honeycomb and above
: android.os.NetworkOnMainThreadException: at android.os.StrictMode$AndroidBloc...
Status: RESOLVED FIXED
[native-crash]
: crash, regression, reproducible, topcrash
Product: Firefox for Android
Classification: Client Software
Component: General (show other bugs)
: 15 Branch
: ARM Android
: -- critical (vote)
: Firefox 17
Assigned To: Brian Nicholson (:bnicholson) (on PTO through June 3)
:
Mentors:
Depends on:
Blocks: 762691
  Show dependency treegraph
 
Reported: 2012-07-15 05:56 PDT by Scoobidiver (away)
Modified: 2012-07-26 06:51 PDT (History)
5 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
+
verified
fixed


Attachments
Close Favicons on background thread (1.12 KB, patch)
2012-07-17 12:43 PDT, Brian Nicholson (:bnicholson) (on PTO through June 3)
mark.finkle: review+
akeybl: approval‑mozilla‑aurora+
akeybl: approval‑mozilla‑beta+
Details | Diff | Review

Description Scoobidiver (away) 2012-07-15 05:56:31 PDT
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
Comment 1 Scoobidiver (away) 2012-07-16 14:34:24 PDT
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.
Comment 2 Brian Nicholson (:bnicholson) (on PTO through June 3) 2012-07-17 12:43:53 PDT
Created attachment 643095 [details] [diff] [review]
Close Favicons on background thread

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
Comment 3 Brian Nicholson (:bnicholson) (on PTO through June 3) 2012-07-17 12:48:52 PDT
I don't understand why 16 is unaffected -- we don't seem to do anything differently.
Comment 4 Scoobidiver (away) 2012-07-17 13:30:48 PDT
(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?
Comment 5 Cristian Nicolae (:xti) 2012-07-18 02:38:47 PDT
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
Comment 6 Scoobidiver (away) 2012-07-18 02:53:23 PDT
Christian, does it happen in Aurora?
Comment 7 Cristian Nicolae (:xti) 2012-07-18 04:35:54 PDT
(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 8 Brian Nicholson (:bnicholson) (on PTO through June 3) 2012-07-18 10:13:10 PDT
http://hg.mozilla.org/integration/mozilla-inbound/rev/b5f68f2de649
Comment 9 Brian Nicholson (:bnicholson) (on PTO through June 3) 2012-07-18 10:14:24 PDT
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
Comment 10 Ed Morley [:emorley] 2012-07-19 07:35:02 PDT
https://hg.mozilla.org/mozilla-central/rev/b5f68f2de649
Comment 11 Alex Keybl [:akeybl] 2012-07-20 15:18:36 PDT
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.
Comment 12 Brian Nicholson (:bnicholson) (on PTO through June 3) 2012-07-23 11:27:40 PDT
http://hg.mozilla.org/releases/mozilla-aurora/rev/285eb81b4367
Comment 13 Brian Nicholson (:bnicholson) (on PTO through June 3) 2012-07-23 11:32:03 PDT
http://hg.mozilla.org/releases/mozilla-beta/rev/df0d32a83f79
Comment 14 Cristian Nicolae (:xti) 2012-07-26 06:51:42 PDT
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

Note You need to log in before you can comment on or make changes to this bug.