6/3 UPDATE
There's a recent significant spike of this crash in Nightly starting May, 19:
https://sentry.prod.mozaws.net/operations/fenix-nightly/issues/6457309/
Various cases of this fixed before: https://github.com/mozilla-mobile/fenix/issues?q=is%3Aissue+FragmentManager+has+been+destroyed+is%3Aclosed
The PWA will be launched
The PWA activity appears briefly, but then fenix crashes.
02-13 10:18:37.498 22826 22899 W FirefoxAccountStateMachine: Got invalid event Event$Init for state AuthenticatedWithProfile.
02-13 10:18:37.524 1929 3234 I InputDispatcher: Focus entered window: Window{e806487 u0 org.mozilla.fenix.nightly/org.mozilla.fenix.customtabs.ExternalAppBrowserActivity}
02-13 10:18:37.530 1929 3234 I ActivityManager: Displayed org.mozilla.fenix.nightly/org.mozilla.fenix.customtabs.ExternalAppBrowserActivity: +333ms (total +608ms)
02-13 10:18:37.531 1929 3234 I ActivityManager: Fully drawn org.mozilla.fenix.nightly/org.mozilla.fenix.customtabs.ExternalAppBrowserActivity: +333ms (total +608ms)
02-13 10:18:37.551 22826 22826 D GeckoSession: handleMessage GeckoView:PageStart uri=about:blank
02-13 10:18:37.555 22826 22826 D GeckoSession: handleMessage GeckoView:LocationChange uri=about:blank
02-13 10:18:37.555 22826 22826 D GeckoSession: handleMessage GeckoView:PageStop uri=null
02-13 10:18:37.556 22826 22826 D GeckoSession: handleMessage GeckoView:OnLoadRequest uri=https://web.telegram.org/?utm_source=web_app_manifest
02-13 10:18:37.559 22826 22826 D GeckoSession: handleMessage GeckoView:OnLoadRequest uri=https://web.telegram.org/?utm_source=web_app_manifest
02-13 10:18:37.571 22826 22826 W GeckoEventDispatcher: No listener for GeckoView:AccessibilityEnabled
02-13 10:18:37.573 22826 25271 D SessionStorage/AutoSave: Saved state to disk [446ms]
02-13 10:18:37.577 22826 22885 D GeckoScreenOrientation: unlocking
02-13 10:18:37.696 22826 22899 W FirefoxAccountStateMachine: Got invalid event Event$Init for state AuthenticatedWithProfile.
02-13 10:18:37.711 22826 22826 W DecorView[]: The visibility of the navigation bar is low, color=ffffffff, hasLightNavBar=false
02-13 10:18:37.732 1929 3800 I InputDispatcher: Focus entered window: Window{7a586aa u0 org.mozilla.fenix.nightly/org.mozilla.fenix.customtabs.ExternalAppBrowserActivity}
02-13 10:18:37.752 22826 22826 D AndroidRuntime: Shutting down VM
02-13 10:18:37.753 22826 22826 E AndroidRuntime: FATAL EXCEPTION: main
02-13 10:18:37.753 22826 22826 E AndroidRuntime: Process: org.mozilla.fenix.nightly, PID: 22826
02-13 10:18:37.753 22826 22826 E AndroidRuntime: java.lang.IllegalStateException: FragmentManager has been destroyed
02-13 10:18:37.753 22826 22826 E AndroidRuntime: at androidx.fragment.app.FragmentManager.ensureExecReady(FragmentManager.java:4)
02-13 10:18:37.753 22826 22826 E AndroidRuntime: at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1)
02-13 10:18:37.753 22826 22826 E AndroidRuntime: at androidx.fragment.app.FragmentManager$4.run(FragmentManager.java:1)
02-13 10:18:37.753 22826 22826 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:873)
02-13 10:18:37.753 22826 22826 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
02-13 10:18:37.753 22826 22826 E AndroidRuntime: at android.os.Looper.loop(Looper.java:280)
02-13 10:18:37.753 22826 22826 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6744)
02-13 10:18:37.753 22826 22826 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
02-13 10:18:37.753 22826 22826 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
02-13 10:18:37.753 22826 22826 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
02-13 10:18:37.754 22826 22885 D GeckoScreenOrientation: unlocking
I tried to reproduce this but for me the PWA opens and functions correctly. Can someone from QA try to reproduce this?
I tried to reproduce this issue but without any success.
No crash is displayed using the PWA with Private Browsing.
Devices:
Build: Firefox Preview Nightly 2/21 #20520606.
I also can no longer reproduce this.
Closing as fixed
Hi, Still reproducible on the latest Nightly Build #20570604 from 02/26 using the following devices:
• Huawei Mate 20 Lite (Android 8.1.0)
• Samsung Galaxy S7 (Android 7)
• OnePlus A3 (Android 6.0.1)
• LG Nexus 4 (Android 5.1.1)
❗ Not reproducible on Google Pixel 3a (Android 9)
► Video

► Crashlog
--------- beginning of crash
2020-02-26 11:35:06.682 29357-29357/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: org.mozilla.fenix.nightly, PID: 29357
java.lang.RuntimeException: Unable to resume activity {org.mozilla.fenix.nightly/org.mozilla.fenix.nightly.App}: java.lang.RuntimeException: Failed to call observer method
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4278)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4319)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2065)
at android.os.Handler.dispatchMessage(Handler.java:109)
at android.os.Looper.loop(Looper.java:166)
at android.app.ActivityThread.main(ActivityThread.java:7555)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:469)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:963)
Caused by: java.lang.RuntimeException: Failed to call observer method
at androidx.lifecycle.ClassesInfoCache$MethodReference.invokeCallback(ClassesInfoCache.java:6)
at androidx.lifecycle.ClassesInfoCache$CallbackInfo.invokeMethodsForEvent(ClassesInfoCache.java:2)
at androidx.lifecycle.ClassesInfoCache$CallbackInfo.invokeCallbacks(ClassesInfoCache.java:1)
at androidx.lifecycle.ReflectiveGenericLifecycleObserver.onStateChanged(ReflectiveGenericLifecycleObserver.java:1)
at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:3)
at androidx.lifecycle.LifecycleRegistry.forwardPass(LifecycleRegistry.java:9)
at androidx.lifecycle.LifecycleRegistry.sync(LifecycleRegistry.java:12)
at androidx.lifecycle.LifecycleRegistry.moveToState(LifecycleRegistry.java:5)
at androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent(LifecycleRegistry.java:2)
at androidx.fragment.app.Fragment.performStart(Fragment.java:7)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:108)
at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:4)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:218)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3)
at androidx.fragment.app.Fragment.performStart(Fragment.java:14)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:108)
at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:4)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:218)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3)
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:18)
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:1)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1340)
at android.app.Activity.performStart(Activity.java:7364)
at android.app.Activity.performRestart(Activity.java:7439)
at android.app.Activity.performResume(Activity.java:7444)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4246)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4319)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2065)
at android.os.Handler.dispatchMessage(Handler.java:109)
at android.os.Looper.loop(Looper.java:166)
at android.app.ActivityThread.main(ActivityThread.java:7555)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:469)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:963)
Caused by: java.lang.IllegalStateException: SET SESSION: Current activity: HomeActivity Other activity: ExternalAppBrowserActivity
at mozilla.components.browser.engine.gecko.GeckoEngineView.render(GeckoEngineView.kt:17)
at mozilla.components.feature.session.EngineViewPresenter.renderSession$feature_session_release(EngineViewPresenter.kt:1)
at mozilla.components.feature.session.SessionFeature.start(SessionFeature.kt:6)
at mozilla.components.support.base.feature.ViewBoundFeatureWrapper.start$support_base_release(ViewBoundFeatureWrapper.kt:1)
at mozilla.components.support.base.feature.LifecycleBinding.start(ViewBoundFeatureWrapper.kt:1)
at java.lang.reflect.Method.invoke(Native Method)
at androidx.lifecycle.ClassesInfoCache$MethodReference.invokeCallback(ClassesInfoCache.java:4)
at androidx.lifecycle.ClassesInfoCache$CallbackInfo.invokeMethodsForEvent(ClassesInfoCache.java:2)
at androidx.lifecycle.ClassesInfoCache$CallbackInfo.invokeCallbacks(ClassesInfoCache.java:1)
at androidx.lifecycle.ReflectiveGenericLifecycleObserver.onStateChanged(ReflectiveGenericLifecycleObserver.java:1)
at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:3)
at androidx.lifecycle.LifecycleRegistry.forwardPass(LifecycleRegistry.java:9)
at androidx.lifecycle.LifecycleRegistry.sync(LifecycleRegistry.java:12)
at androidx.lifecycle.LifecycleRegistry.moveToState(LifecycleRegistry.java:5)
at androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent(LifecycleRegistry.java:2)
at androidx.fragment.app.Fragment.performStart(Fragment.java:7)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:108)
at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:4)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:218)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3)
at androidx.fragment.app.Fragment.performStart(Fragment.java:14)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:108)
at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:4)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:218)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3)
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:18)
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:1)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1340)
at android.app.Activity.performStart(Activity.java:7364)
at android.app.Activity.performRestart(Activity.java:7439)
at android.app.Activity.performResume(Activity.java:7444)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4246)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4319)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2065)
at android.os.Handler.dispatchMessage(Handler.java:109)
at android.os.Looper.loop(Looper.java:166)
at android.app.ActivityThread.main(ActivityThread.java:7555)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:469)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:963)
Caused by: java.lang.IllegalStateException: Display already acquired
at org.mozilla.geckoview.GeckoSession.acquireDisplay(GeckoSession.java:5)
2020-02-26 11:35:06.682 29357-29357/? E/AndroidRuntime: at org.mozilla.geckoview.GeckoView.setSession(GeckoView.java:7)
at mozilla.components.browser.engine.gecko.GeckoEngineView.render(GeckoEngineView.kt:10)
... 39 more
2020-02-26 11:35:06.683 29357-29357/? I/mozac/CrashReporter: Received crash: UncaughtExceptionCrash(throwable=java.lang.RuntimeException: Unable to resume activity {org.mozilla.fenix.nightly/org.mozilla.fenix.nightly.App}: java.lang.RuntimeException: Failed to call observer method, breadcrumbs=[Breadcrumb(message=Changing to fragment homeFragment, isCustomTab: false, data={}, category=DestinationChanged, level=INFO, type=DEFAULT, date=Wed Feb 26 11:34:40 GMT+02:00 2020), Breadcrumb(message=Changing to fragment settingsFragment, isCustomTab: false, data={}, category=DestinationChanged, level=INFO, type=DEFAULT, date=Wed Feb 26 11:34:43 GMT+02:00 2020), Breadcrumb(message=Changing to fragment privateBrowsingFragment, isCustomTab: false, data={}, category=DestinationChanged, level=INFO, type=DEFAULT, date=Wed Feb 26 11:34:44 GMT+02:00 2020), Breadcrumb(message=Changing to fragment settingsFragment, isCustomTab: false, data={}, category=DestinationChanged, level=INFO, type=DEFAULT, date=Wed Feb 26 11:34:54 GMT+02:00 2020), Breadcrumb(message=Changing to fragment homeFragment, isCustomTab: false, data={}, category=DestinationChanged, level=INFO, type=DEFAULT, date=Wed Feb 26 11:34:55 GMT+02:00 2020), Breadcrumb(message=Changing to fragment externalAppBrowserFragment, isCustomTab: true, data={}, category=DestinationChanged, level=INFO, type=DEFAULT, date=Wed Feb 26 11:34:58 GMT+02:00 2020), Breadcrumb(message=Changing to fragment externalAppBrowserFragment, isCustomTab: true, data={}, category=DestinationChanged, level=INFO, type=DEFAULT, date=Wed Feb 26 11:35:06 GMT+02:00 2020), Breadcrumb(message=Changing to fragment browserFragment, isCustomTab: false, data={}, category=DestinationChanged, level=INFO, type=DEFAULT, date=Wed Feb 26 11:35:06 GMT+02:00 2020)])
2020-02-26 11:35:06.683 29357-29357/? I/mozac/CrashReporter: Showing prompt
Thanks @AndiAJ ! Slightly different trace now but that's good info to keep looking into
With the original STR I'm still seeing on my Pixel 3 (but only sometimes)
2020-04-17 17:00:54.708 18721-18721/org.mozilla.fenix.debug E/AndroidRuntime: FATAL EXCEPTION: main
Process: org.mozilla.fenix.debug, PID: 18721
java.lang.IllegalStateException: FragmentManager has been destroyed
at androidx.fragment.app.FragmentManager.ensureExecReady(FragmentManager.java:1783)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1843)
at androidx.fragment.app.FragmentManager$4.run(FragmentManager.java:413)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
This seems to be related to one of the most common signatures we are seeing on Nightly. Crash in [@ java.lang.IllegalStateException: at androidx.fragment.app.FragmentManager.ensureExecReady(FragmentManager.java)] [bug 1641040](https://bugzilla.mozilla.org/show_bug.cgi?id=1641040)
I'm going to dupe these to #10709, and I've moved STRs over bc these all have the same crash signature.
My bad, this is not the same bug as #10709, will do some un-duping.
This is currently our top crasher on Firefox Beta at 5% rollout: https://crash-stats.mozilla.org/topcrashers/?product=Fenix&version=77.0.0-b
and on Firefox Preview too, top crashes 1 & 2 with an uptick in the past few days:
https://sentry.prod.mozaws.net/operations/firefox-nightly/?query=release%3Aorg.mozilla.fenix-5.1.0&sort=priority&statsPeriod=14d
(crash-stats link for reference) https://crash-stats.mozilla.org/topcrashers/?product=Fenix&version=5.1.0-b
also updating the title to make this more searchable by crash signature.
@grigoryk @NotWoods what do you think of this one?
fwiw this is probably some kind of race, bc this STR has been around for a while, but has really spiked on Nightly as of May 19.
From: https://www.reddit.com/r/firefox/comments/gvaru6/firefox_preview_nightly_still_crashing_on_samsung/
I have been running the Joey Reddit app as a standalone app and I will occasionally open a post externally in Firefox Preview Nightly to bookmark it. Then I hit the back button twice to go back to the Joey app and as soon as it goes back, I get the message that Firefox has crashed. I tried to duplicate the problem just now and I wasn't able to. It only occasionally happens.
@ekager backx2? #10718
@grigoryk if you're looking into this, might be related to app restarts when swapping themes (because Private Browsing is a separate theme and requires application recreate to apply).
Chatted w/ @boek and @ekager about one solution being, removing the PB theming and instead, dynamically setting UI colors for PB Mode.
Yeah the backx2 issue was #10718 🤔
@ekager this landed on the 18th and fits the STR https://github.com/mozilla-mobile/fenix/commit/d46369696f1d43385f335936f50abb31176845ef
Yes, I'm convinced that the spike is related to https://github.com/mozilla-mobile/fenix/commit/d46369696f1d43385f335936f50abb31176845ef but think it is just exposing another pathway to an issue that already existed when finishing activities (ie the previous STR also involved "open in Fenix" which finishes an activity). There's clearly another root issue at play here - probably some race condition as the activity finishes, but for now we can revert the finish.
I just repro-ed the crash on the original STR.
Took me about 10-15 tries and then reproed a second time as well.
@ekager does this still repro with the backout?
A few things we decided to do here for this bug:
I was able to reproduce the crash on OnePlus 5T (Android 9) on 6/5 Nightly build, with the following steps:
Fenix either crashes or displayed the "Unable to send RETRY" snackbar.
I wasn't able to reproduce the crash on Beta 77.0.0-beta.2 (beta 5.1.1).
https://crash-stats.mozilla.org/report/index/4e6c3a43-8992-4286-bed1-701680200605
I just repro-ed the crash on the original STR.
- Have Fenix open in PBM homescreen
- Background Fenix, Open PWA
- Click away from main PWA scope to get toolbar
- Select "Open in Fenix" from toolbar
Took me about 10-15 tries and then reproed a second time as well.
I got an ANR error with these steps on 77.0.0-beta2.
logANR.txt
@softvision-miralobontiu I think this might be a different bug, but is also fragmentmanager related.
Stack trace here specifically is java.lang.IllegalStateException: FragmentManager has been destroyed
androidx.fragment.app.FragmentManager.ensureExecReady(FragmentManager.java:4)
androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1)
Okay, here's some really consistent STR for me, at least 1/5 times.
Have open links in Private Browsing turned on
Open a link from another app (like from gmail)
Click back immediately (which will close PB mode bc it's the last tab)
The crash seems to happen when the PB system icon goes away.
@liuche with those step, I can repro on Nightly ~1/5 times, but I'm seeing a native crash (id bc606679-2815-41ea-9c81-e0b87e3809fb) , not this FragmentManager trace :/
I also just repro-ed this on the most recent Nightly, and I'm also getting a native crash, here's the socorro link: https://crash-stats.mozilla.org/report/index/c2d90164-a401-4802-bd6d-7658f0200618
Not sure why it changed.
It also looks like this has decreased in Sentry over the last couple of weeks: https://sentry.prod.mozaws.net/operations/firefox-nightly/?query=is%3Aunresolved+ensureexec&statsPeriod=14d
I was able to repro the fragmentmanager crash once, but of the 5 times I crashed with similar STR to https://github.com/mozilla-mobile/fenix/issues/8374#issuecomment-642777126, 4 were the native crash
Do we know why this was a native crash sometimes - is it two issues somehow, and we're only handling one of them? Or the native crash is getting triggered racily.
We've tried the steps to reproduce this on Fenix Beta 78.0.1 & 79.0.1 and looks like it is fixed. Marking this as fixed and closing.