Closed Bug 799877 Opened 7 years ago Closed 7 years ago

java.lang.IllegalStateException: at android.widget.ListView.layoutChildren(ListView.java) with Adapter(class org.mozilla.gecko.AllPagesTab$AwesomeBarCursorAdapter)

Categories

(Firefox for Android :: General, defect, critical)

16 Branch
ARM
Android
defect
Not set
critical

Tracking

()

RESOLVED FIXED
Firefox 19
Tracking Status
firefox16 + ---
firefox17 + fixed
firefox18 --- fixed
fennec + ---

People

(Reporter: scoobidiver, Assigned: bnicholson)

Details

(Keywords: crash, steps-wanted, topcrash, Whiteboard: [native-crash][startupcrash])

Crash Data

Attachments

(1 file)

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
Scoobidiver - Do we have any correlations to devices or kernels ?
(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.
Whiteboard: [native-crash] → [native-crash][startupcrash]
mfinkle/blassey - who would be in the best position to investigate this for mobile?
Assignee: nobody → lucasr.at.mozilla
tracking-fennec: ? → +
Keywords: qawanted
OS: Linux → Android
Hardware: All → ARM
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).
Keywords: qawanted
I have not been able to reproduce this. 

Bug 732902 comment #8 expresses a speculative fix.
Keywords: qawanted
(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.
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.
Assignee: lucasr.at.mozilla → mark.finkle
Assignee: mark.finkle → lucasr.at.mozilla
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.
Assignee: lucasr.at.mozilla → bnicholson
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
Attachment #676324 - Flags: review?(mark.finkle)
Comment on attachment 676324 [details] [diff] [review]
Call notifyDataSetChanged() after setting search engines

Good investigation!
Attachment #676324 - Flags: review?(mark.finkle) → review+
I assume we want this simple fix uplifted too
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
Attachment #676324 - Flags: approval-mozilla-beta?
Attachment #676324 - Flags: approval-mozilla-aurora?
http://hg.mozilla.org/mozilla-central/rev/a5ab93cf9fea
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 19
Comment on attachment 676324 [details] [diff] [review]
Call notifyDataSetChanged() after setting search engines

build on trunk looks ok - approving for branches.
Attachment #676324 - Flags: approval-mozilla-beta?
Attachment #676324 - Flags: approval-mozilla-beta+
Attachment #676324 - Flags: approval-mozilla-aurora?
Attachment #676324 - Flags: approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.