Closed Bug 732902 Opened 12 years ago Closed 11 years ago

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

Categories

(Firefox for Android Graveyard :: General, defect, P1)

18 Branch
ARM
Android
defect

Tracking

(firefox17 wontfix, firefox18 wontfix, firefox19+ fixed, firefox20 fixed, firefox21 fixed, fennec18+)

RESOLVED FIXED
Firefox 21
Tracking Status
firefox17 --- wontfix
firefox18 --- wontfix
firefox19 + fixed
firefox20 --- fixed
firefox21 --- fixed
fennec 18+ ---

People

(Reporter: scoobidiver, Assigned: lucasr)

Details

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

Crash Data

Attachments

(2 files)

There is one crash so far in 13.0a1/20120304: bp-ade0e9d6-4a45-41fd-b88e-3f8fa2120304

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(2131492896, class android.widget.ListView) with Adapter(class org.mozilla.gecko.AwesomeBarTabs$AwesomeBarCursorAdapter)]
	at android.widget.ListView.layoutChildren(ListView.java:1538)
	at android.widget.AbsListView$CheckForTap.run(AbsListView.java:2728)
	at android.os.Handler.handleCallback(Handler.java:605)
	at android.os.Handler.dispatchMessage(Handler.java:92)
	at android.os.Looper.loop(Looper.java:137)
	at org.mozilla.gecko.GeckoApp$35.run(GeckoApp.java:1766)
	at android.os.Handler.handleCallback(Handler.java:605)
	at android.os.Handler.dispatchMessage(Handler.java:92)
	at android.os.Looper.loop(Looper.java:137)
	at android.app.ActivityThread.main(ActivityThread.java:4424)
	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:784)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
	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
Not blocking, still would be good to get a fix.
blocking-fennec1.0: --- → -
Priority: -- → P1
Summary: java.lang.IllegalStateException: at android.widget.ListView.layoutChildren(ListView.java) at android.widget.AbsListView$CheckForTap.run(AbsListView.java) → java.lang.IllegalStateException: at android.widget.ListView.layoutChildren(ListView.java) at android.widget.AbsListView$CheckForTap.run(AbsListView.java) with Adapter(class org.mozilla.gecko.AwesomeBarTabs$AwesomeBarCursorAdapter)
lucars, does this crash look related to bug 723499, another AwesomeBarTabs layoutChildren() exception you fixed a few months ago?

This is currently the #2 topcrash for 14.0b2.
Keywords: topcrash
Renom then.
blocking-fennec1.0: - → ?
(In reply to Chris Peterson (:cpeterson) from comment #2)
> This is currently the #2 topcrash for 14.0b2.
Bug 732901 is #2 top crasher in 14.0b2, not this one. Stacks are different.
blocking-fennec1.0: ? → ---
Keywords: topcrash
I'm not seeing this crash at all in recent builds (I just looked at the most recent 20 on crash-stats, and they were all the TabsTray crash).

The crash in comment 0 was from 13.0a1. Are there any more of these crashes on more recent builds?
Thanks, Scoobidiver. I was confused because Socorro had aggregated these exceptions because they all originated from android.widget.ListView (but with different code paths).

Since we haven't seen this stack trace in recently, can we just close it WORKSFORME?
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
Seen in 14.0b3: bp-bd73216f-98a1-48f6-a94d-d35892120527.
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Version: Firefox 13 → Firefox 14
The fix for this will likely be similar to the fix for bug 732901. We should look into AwesomeBarCursorAdapter and make sure we're calling notifyDataSetChanged if it changes.
It's #115 top crasher in 14.0.1, #128 in 15.0b4, #30 in 16.0a2 and #19 in 17.0a1.
Summary: java.lang.IllegalStateException: at android.widget.ListView.layoutChildren(ListView.java) at android.widget.AbsListView$CheckForTap.run(AbsListView.java) with Adapter(class org.mozilla.gecko.AwesomeBarTabs$AwesomeBarCursorAdapter) → java.lang.IllegalStateException: at android.widget.ListView.layoutChildren(ListView.java) with Adapter(class org.mozilla.gecko.AwesomeBarTabs$AwesomeBarCursorAdapter)
mfinkle, this bug looks like it might be related to bug 799877, which is assigned to you.
(In reply to Chris Peterson (:cpeterson) from comment #10)
> mfinkle, this bug looks like it might be related to bug 799877, which is
> assigned to you.

Assigning both to Lucas to see if he can find the cause.
Assignee: nobody → lucasr.at.mozilla
There are still crashes after the fix of bug 799877.
Summary: java.lang.IllegalStateException: at android.widget.ListView.layoutChildren(ListView.java) with Adapter(class org.mozilla.gecko.AwesomeBarTabs$AwesomeBarCursorAdapter) → java.lang.IllegalStateException: at android.widget.ListView.layoutChildren(ListView.java) with Adapter(class org.mozilla.gecko.AllPagesTab$AwesomeBarCursorAdapter)
Version: Firefox 14 → Firefox 17
It's #5 top crasher in 18.0.
tracking-fennec: --- → ?
Keywords: topcrash
Version: Firefox 17 → Firefox 18
tracking-fennec: ? → 18+
Lucas - what are the next steps in your investigation here?
Flags: needinfo?(lucasr.at.mozilla)
This is unlikely the real cause of this bug but it's probably a good idea to set the list of search engines in one step instead of emptying it and adding items incrementally.
Attachment #704917 - Flags: review?(mark.finkle)
Flags: needinfo?(lucasr.at.mozilla)
And here's what I think is the real fix for this bug. This exception only happens when there's a mismatch between the number of items that the ListView think the adapter has and the actual number of items returned from getCount(). So, the problem here is definitely related to how we count items in AwesomeBarCursorAdapter.

The cursor is updated using the FilterQueryProvider, which can't really be the cause. As far as I could see, all updates to mSearchEngines are done in the UI thread so this is not the problem either.

The actual bug seems to be in how we update mSearchTerm. Although updates to mSearchTerm do affect what we return in getCount(), we were not calling notifyDataSetChanged() when we do so (opening a possible window of time where getCount() returns a new value that the ListView doesn't know about).
Attachment #704921 - Flags: review?(mark.finkle)
Attachment #704917 - Flags: review?(mark.finkle) → review+
Attachment #704921 - Flags: review?(mark.finkle) → review+
Status: REOPENED → ASSIGNED
https://hg.mozilla.org/mozilla-central/rev/b9864e375b6f
https://hg.mozilla.org/mozilla-central/rev/27066b1bf86b
Status: ASSIGNED → RESOLVED
Closed: 12 years ago11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 21
Comment on attachment 704917 [details] [diff] [review]
Set list of search engines in one step

[Approval Request Comment]
Bug caused by (feature/regressing bug #): n/a
User impact if declined: one of the top crashers we have right now.
Testing completed (on m-c, etc.): landed in m-c, no issues found so far.
Risk to taking this patch (and alternatives if risky): Fairly low, patch is very simple.
String or UUID changes made by this patch: none.
Attachment #704917 - Flags: approval-mozilla-aurora?
Comment on attachment 704921 [details] [diff] [review]
Notify adapter updates when search term changes

[Approval Request Comment]
Bug caused by (feature/regressing bug #): n/a
User impact if declined: one of the top crashers we have right now.
Testing completed (on m-c, etc.): landed in m-c, no issues found so far.
Risk to taking this patch (and alternatives if risky): Fairly low, patch is very simple.
String or UUID changes made by this patch: none.
Attachment #704921 - Flags: approval-mozilla-aurora?
Comment on attachment 704917 [details] [diff] [review]
Set list of search engines in one step

Nice - hope this brings the crash volume down! If so, we'll take for beta 4 or beta 5.
Attachment #704917 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Attachment #704921 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment on attachment 704917 [details] [diff] [review]
Set list of search engines in one step

Requesting approval for Beta to get wider testing (as discussed with akeybl)
Attachment #704917 - Flags: approval-mozilla-beta?
Comment on attachment 704921 [details] [diff] [review]
Notify adapter updates when search term changes

Requesting approval for Beta to get wider testing (as discussed with akeybl)
Attachment #704921 - Flags: approval-mozilla-beta?
Comment on attachment 704917 [details] [diff] [review]
Set list of search engines in one step

Approving on beta to get wider testing. Please land asap. Thanks !
Attachment #704917 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #704921 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
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: