Open Bug 1497143 Opened Last year Updated 7 months ago

Crash in java.lang.IllegalStateException: at android.support.v4.app.FragmentManagerImpl.saveAllState(FragmentManager.java)

Categories

(Firefox for Android :: Awesomescreen, defect, P3, critical)

Unspecified
Android
defect

Tracking

()

Tracking Status
firefox63 --- wontfix
firefox64 --- fix-optional
firefox65 --- fix-optional
firefox66 --- fix-optional
firefox67 --- fix-optional
firefox68 --- affected

People

(Reporter: gsvelto, Unassigned)

References

Details

(Keywords: crash, regression, stalled)

Crash Data

This bug was filed from the Socorro interface and is
report bp-644b7855-1371-46dc-83e2-5cc380181007.
=============================================================

Java stack trace:

java.lang.IllegalStateException
	at android.support.v4.app.FragmentManagerImpl.saveAllState(FragmentManager.java:2968)
	at android.support.v4.app.FragmentController.saveAllState(FragmentController.java:125)
	at android.support.v4.app.FragmentActivity.onSaveInstanceState(FragmentActivity.java:528)
	at android.support.v7.app.AppCompatActivity.onSaveInstanceState(AppCompatActivity.java:509)
	at org.mozilla.gecko.GeckoApp.onSaveInstanceState(GeckoApp.java:622)
	at org.mozilla.gecko.BrowserApp.onSaveInstanceState(BrowserApp.java:2272)
	at android.app.Activity.performSaveInstanceState(Activity.java:1555)
	at android.app.Instrumentation.callActivityOnSaveInstanceState(Instrumentation.java:1392)
	at android.app.ActivityThread.callCallActivityOnSaveInstanceState(ActivityThread.java:4943)
	at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:4231)
	at android.app.ActivityThread.handleStopActivity(ActivityThread.java:4290)
	at android.app.ActivityThread.-wrap25(Unknown Source:0)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1730)
	at android.os.Handler.dispatchMessage(Handler.java:105)
	at android.os.Looper.loop(Looper.java:164)
	at android.app.ActivityThread.main(ActivityThread.java:6940)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Unfortunately the stack trace doesn't give an immediate clue as to what exactly is failing. We had/have some issues with the tab session history fragment that is shown when long-pressing the back/forward button, but unlike in bug 1338670 or bug 1427076 this time it doesn't appear in the stack trace.

In any case this is not about session restore proper, though.
Component: Session Restore → General
Depends on: 1499625
Updating to add the affected branches. #7 overall top crash on release. Comments don't seem to particularly helpful.
Could someone with full crash report access take a look at the original, unsanitised/simplified exception messages of a few reports? Those should hopefully have some details *which* Fragment(s?) precisely is/are causing the crash.
Hi Jan - I sampled 4 reports, from different branches - hopefully this is along the lines of what you are looking for?:

java.lang.IllegalStateException: Failure saving state: active ActivityStreamHomeFragment{afcfeba} has cleared index: -1

Java.lang.IllegalStateException: Failure saving state: active BookmarksPanel{1f64b66} has cleared index: -1

java.lang.IllegalStateException: Failure saving state: active ActivityStreamHomeFragment{c26b22f} has cleared index: -1

java.lang.IllegalStateException: Failure saving state: active ActivityStreamHomeFragment{21bf2f78} has cleared index: -1
Yes, that's what I meant. So the session history popup isn't in fact to blame, it's the home panels that are having problems here. Unfortunately I'm not at all familiar with how we're handling those.
Component: General → Awesomescreen
Looking at the raw stack traces the "java.lang.IllegalStateException: Failure saving state: active ActivityStreamHomeFragment{******} has cleared index: -1" failure is the most common by far, representing over 90% of the crashes. I also found this one in a few dozen:

java.lang.IllegalStateException: Failure saving state: active CombinedHistoryPanel{ec535c0} has cleared index: -1
Re ActivityStreamHomeFragment: This is the new implementation of the "Top Sites" panel and I guess that most people don't change the default panel, so the Top Sites panel will naturally appear most frequently.
And the CombinedHistoryPanel is the third member of our home panels family.
Assignee: nobody → petru.lingurar
Status: NEW → ASSIGNED
The crash seems to be coming from when Android tries to save the state of the Fragments [1] following the app being put in background.

It's interesting that there are some user reports which say the users were happily browsing when this happened, which would imply no user action to put the app in background.

Tried to reproduce this but I couldn't yet.

[1] https://android.googlesource.com/platform/frameworks/support/+/oreo-release/fragment/java/android/support/v4/app/FragmentManager.java#2968
Still could not reproduce by putting the app in background on purpose, irrespective of what I was doing before.
I think something else happens inside the app that triggers this without user's input.

Since this is a high crash volume bug I'm unassigning myself while I'm on PTO if somebody else want to work on this but will keep it as a NI to come back to this.
Flags: needinfo?(petru.lingurar)
Assignee: petru.lingurar → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(petru.lingurar)
Flags: needinfo?(petru.lingurar)

Tried to force this today again but couldn't.

I'm hoping the QA team can find some STRs.

Flags: needinfo?(petru.lingurar) → needinfo?(andrei.bodea)

I wasn't able to reproduce this issue, tested with Samsung Galaxy Note 9 (A 8.1), Samsung Galaxy S8(A 8.0), Samsung Galaxy S7(A 7.0) everything worked as expected.
I will keep an eye out for this while testing and If ill manage to reproduce the issue I will come back with the information.

Flags: needinfo?(andrei.bodea)

Here are the most recent correlations showing up - comments are not useful:

100.0% in signature vs 25.31% overall) moz_crash_reason = MOZ_CRASH(Uncaught Java exception)
(100.0% in signature vs 46.75% overall) address = 0x0
(100.0% in signature vs 70.15% overall) reason = SIGSEGV /SEGV_MAPERR
(53.14% in signature vs 34.82% overall) Module "browser.db (deleted)" = true
(99.94% in signature vs 84.19% overall) Module "webappsstore.sqlite-shm" = true
(76.54% in signature vs 58.97% overall) Module "NotoSansCanadianAboriginal-Regular.ttf" = true
(75.99% in signature vs 58.52% overall) Module "NotoSansTaiViet-Regular.ttf" = true
(75.99% in signature vs 58.52% overall) Module "NotoSansTifinagh-Regular.ttf" = true
(75.99% in signature vs 58.52% overall) Module "NotoSansBalinese-Regular.ttf" = true
(75.99% in signature vs 58.52% overall) Module "NotoSansSundanese-Regular.ttf" = true
(75.99% in signature vs 58.52% overall) Module "NotoSansCham-Bold.ttf" = true
(75.99% in signature vs 58.52% overall) Module "NotoSansSylotiNagri-Regular.ttf" = true
(75.99% in signature vs 58.52% overall) Module "NotoSansCham-Regular.ttf" = true
(75.99% in signature vs 58.52% overall) Module "NotoSansSaurashtra-Regular.ttf" = true
(75.99% in signature vs 58.54% overall) Module "NotoSansMeeteiMayek-Regular.ttf" = true
(97.81% in signature vs 82.38% overall) Module "Roboto-Light.ttf" = true
(74.22% in signature vs 57.73% overall) Module "NotoSansBamum-Regular.ttf" = true
(74.22% in signature vs 57.73% overall) Module "NotoSansNKo-Regular.ttf" = true
(57.83% in signature vs 41.74% overall) Module "libradio.so" = true
(64.47% in signature vs 49.35% overall) Module "NotoNaskhArabicUI-Bold.ttf" = true

Bulk change for all regression bugs with status-firefox67 as 'fix-optional' to be marked 'affected' for status-firefox68.

This is still in the top 10 in the most recent Fennec 68 beta. Here are the most recent correlations:

(100.0% in signature vs 31.48% overall) moz_crash_reason = MOZ_CRASH(Uncaught Java exception)
(100.0% in signature vs 52.33% overall) address = 0x0
(93.02% in signature vs 50.88% overall) Module "bouncycastle.jar" = true [93.02% vs 56.34% if platform = Android]

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