Last Comment Bug 799877 - java.lang.IllegalStateException: at android.widget.ListView.layoutChildren(ListView.java) with Adapter(class org.mozilla.gecko.AllPagesTab$AwesomeBarCursorAdapter)
: java.lang.IllegalStateException: at android.widget.ListView.layoutChildren(Li...
Status: RESOLVED FIXED
[native-crash][startupcrash]
: crash, steps-wanted, topcrash
Product: Firefox for Android
Classification: Client Software
Component: General (show other bugs)
: 16 Branch
: ARM Android
: -- critical (vote)
: Firefox 19
Assigned To: Brian Nicholson (:bnicholson)
:
: Sebastian Kaspari (:sebastian)
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-10 02:45 PDT by Scoobidiver (away)
Modified: 2016-07-29 14:29 PDT (History)
8 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
+
+
fixed
fixed
+


Attachments
Call notifyDataSetChanged() after setting search engines (1.13 KB, patch)
2012-10-29 14:38 PDT, Brian Nicholson (:bnicholson)
mark.finkle: review+
lukasblakk+bugs: approval‑mozilla‑aurora+
lukasblakk+bugs: approval‑mozilla‑beta+
Details | Diff | Splinter Review

Description Scoobidiver (away) 2012-10-10 02:45:31 PDT
It's similar to bug 732902 but this one is #5 top crasher in 16.0.

java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. [in ListView(-1, class android.widget.ListView) with Adapter(class org.mozilla.gecko.AllPagesTab$AwesomeBarCursorAdapter)]
	at android.widget.ListView.layoutChildren(ListView.java:1538)
	at android.widget.AbsListView.onTouchEvent(AbsListView.java:3445)
	at android.view.View.dispatchTouchEvent(View.java:5717)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1956)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1717)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1962)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1731)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1962)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1731)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1962)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1731)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1962)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1731)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1962)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1731)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1962)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1731)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1962)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1731)
	at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2064)
	at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1400)
	at android.app.Activity.dispatchTouchEvent(Activity.java:2369)
	at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2012)
	at android.view.View.dispatchPointerEvent(View.java:5897)
	at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3115)
	at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2657)
	at android.view.ViewRootImpl.processInputEvents(ViewRootImpl.java:1021)
	at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2666)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:137)
	at android.app.ActivityThread.main(ActivityThread.java:4511)
	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:986)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:753)
	at dalvik.system.NativeStart.main(Native Method)

More reports at:
https://crash-stats.mozilla.com/report/list?signature=java.lang.IllegalStateException%3A+at+android.widget.ListView.layoutChildren%28ListView.java%29
Comment 1 bhavana bajaj [:bajaj] 2012-10-10 11:22:14 PDT
Scoobidiver - Do we have any correlations to devices or kernels ?
Comment 2 Scoobidiver (away) 2012-10-10 12:05:52 PDT
(In reply to bhavana bajaj [:bajaj] from comment #1)
> Scoobidiver - Do we have any correlations to devices or kernels ?
There are crashes from Froyo to JB.
The solution is in bug 732902 comment 8.
Comment 4 Alex Keybl [:akeybl] 2012-10-10 15:44:29 PDT
mfinkle/blassey - who would be in the best position to investigate this for mobile?
Comment 5 Alex Keybl [:akeybl] 2012-10-23 16:53:30 PDT
Aaron - any luck with reproducing?

Lucas - any next steps from the engineering angle? Speculative fixes should land on mozilla-beta in the next week (before b4 goes to build on 10/30).
Comment 6 Aaron Train [:aaronmt] 2012-10-23 19:53:35 PDT
I have not been able to reproduce this. 

Bug 732902 comment #8 expresses a speculative fix.
Comment 7 Lucas Rocha (:lucasr) 2012-10-24 05:05:05 PDT
(In reply to Aaron Train [:aaronmt] from comment #6)
> I have not been able to reproduce this. 
> 
> Bug 732902 comment #8 expresses a speculative fix.

The problem here is that the stack trace doesn't give any clue as to where the illegal change to the adapter is coming from. I'd need at least a reliable way to reproduce this in order to work on a patch.
Comment 8 Lukas Blakk [:lsblakk] use ?needinfo 2012-10-26 15:04:12 PDT
Mark - we're out of ideas here, this is still at #5 topcrash on both 16.0.1 and 17.0b3 so a fix would be most welcome for uplift.
Comment 9 Brian Nicholson (:bnicholson) 2012-10-29 12:28:00 PDT
I've been testing different phones to see if I can reproduce this crash. I've finally been able to get it to happen somewhat often on a Droid Pro by tapping on the URL bar, then quickly trying to scroll the list while mashing letters on the keyboard at the same time (if it doesn't crash within a second or two, close the AwesomeScreen and repeat). These STR are far from consistent, but it works often enough that I might be able to pin this down.
Comment 10 Brian Nicholson (:bnicholson) 2012-10-29 14:38:36 PDT
Created attachment 676324 [details] [diff] [review]
Call notifyDataSetChanged() after setting search engines

We add entries to the search engine at [1], and the list of search engines is used for getCount() at [2]. However, we never call notifyDataSetChanged() in between, resulting in the crash.

[1] http://hg.mozilla.org/integration/mozilla-inbound/file/b45a4dcb88c1/mobile/android/base/awesomebar/AllPagesTab.java#l522
[2] http://hg.mozilla.org/integration/mozilla-inbound/file/b45a4dcb88c1/mobile/android/base/awesomebar/AllPagesTab.java#l299
Comment 11 Mark Finkle (:mfinkle) (use needinfo?) 2012-10-30 06:44:27 PDT
Comment on attachment 676324 [details] [diff] [review]
Call notifyDataSetChanged() after setting search engines

Good investigation!
Comment 12 Mark Finkle (:mfinkle) (use needinfo?) 2012-10-30 06:45:17 PDT
I assume we want this simple fix uplifted too
Comment 13 Brian Nicholson (:bnicholson) 2012-10-30 10:50:56 PDT
Comment on attachment 676324 [details] [diff] [review]
Call notifyDataSetChanged() after setting search engines

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 
User impact if declined: awesomescreen crashes
Testing completed (on m-c, etc.): locally
Risk to taking this patch (and alternatives if risky): very low
String or UUID changes made by this patch: none
Comment 14 Brian Nicholson (:bnicholson) 2012-10-30 11:02:43 PDT
http://hg.mozilla.org/mozilla-central/rev/a5ab93cf9fea
Comment 15 Lukas Blakk [:lsblakk] use ?needinfo 2012-10-30 13:38:42 PDT
Comment on attachment 676324 [details] [diff] [review]
Call notifyDataSetChanged() after setting search engines

build on trunk looks ok - approving for branches.
Comment 16 Brian Nicholson (:bnicholson) 2012-10-30 14:20:01 PDT
http://hg.mozilla.org/releases/mozilla-aurora/rev/50c5626641e2
Comment 17 Brian Nicholson (:bnicholson) 2012-10-30 14:23:47 PDT
http://hg.mozilla.org/releases/mozilla-beta/rev/92c8acaff4c8

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