nightly crashes when switching back to normal mode from private browsing
Categories
(Firefox for Android :: Homepage, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox148 | --- | unaffected |
| firefox149 | --- | verified |
| firefox150 | --- | verified |
People
(Reporter: nish, Assigned: petru)
References
(Regression)
Details
(Keywords: regression, Whiteboard: [fxdroid][group3])
Attachments
(4 files)
|
4.19 MB,
text/plain
|
Details | |
|
48 bytes,
text/x-phabricator-request
|
Details | |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-release+
|
Details |
|
2.20 MB,
video/mp4
|
Details |
Steps to reproduce:
- go into private browsing (by clicking on private browsing icon on home page)
- switch back to normal mode by tapping on the private browsing icon again
Actual results:
firefox crashes
FATAL EXCEPTION: main
Process: org.mozilla.fenix, PID: 20052
java.lang.IllegalStateException: Can't access the Fragment View's LifecycleOwner for HomeFragment{eaaff28} (46d55697-f087-4f1c-a415-8c67ee808e32) when getView() is null i.e., before onCreateView() or after onDestroyView()
at androidx.fragment.app.Fragment.getViewLifecycleOwner(Fragment.java:16)
at org.mozilla.fenix.home.HomeFragment$applyWallpaper$1.invokeSuspend(HomeFragment.kt:275)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:9)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:112)
at android.os.Handler.handleCallback(Handler.java:959)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loopOnce(Looper.java:257)
at android.os.Looper.loop(Looper.java:342)
at android.app.ActivityThread.main(ActivityThread.java:9638)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:619)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:929)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@fd3ef27, Dispatchers.Main.immediate]
Expected results:
shouldnt crash
| Reporter | ||
Comment 1•2 months ago
|
||
looking at HomeFragment.kt with search fox, i think 2019462 is responsible for this, haven't verified it yet though
| Reporter | ||
Updated•2 months ago
|
Comment 2•2 months ago
|
||
:petru, since you are the author of the regressor, bug 2019462, could you take a look? Also, could you set the severity field?
For more information, please visit BugBot documentation.
| Reporter | ||
Comment 3•2 months ago
|
||
hmmm, so the crash happens only when using non default wallpapers in firefox nightly (like the 3rd wallpaper in Settings -> Homepage -> Wallpapers), which my locally built fenix-preview doesn't have...
some details on the device:
Name: Firefox Nightly
Version: 150.0a1
Build ID: 20260308092814
Android 15 - Samsung S9Fe+
| Assignee | ||
Comment 4•2 months ago
|
||
Deobfuscated stack trace:
Exception java.lang.IllegalStateException:
at androidx.fragment.app.Fragment.getViewLifecycleOwner (Fragment.java:390)
at org.mozilla.fenix.home.HomeFragment.observeWallpaperUpdates (HomeFragment.java:1425)
at org.mozilla.fenix.home.HomeFragment.access$observeWallpaperUpdates (HomeFragment.java:184)
at org.mozilla.fenix.home.HomeFragment$applyWallpaper$1.invokeSuspend (HomeFragment.kt:1418)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:34)
at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:98)
at android.os.Handler.handleCallback (Handler.java:938)
at android.os.Handler.dispatchMessage (Handler.java:99)
at android.os.Looper.loopOnce (Looper.java:201)
at android.os.Looper.loop (Looper.java:288)
at android.app.ActivityThread.main (ActivityThread.java:7842)
at java.lang.reflect.Method.invoke
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1003)
Updated•2 months ago
|
Comment 5•2 months ago
|
||
Set release status flags based on info from the regressing bug 2019462
| Assignee | ||
Comment 6•2 months ago
|
||
Enabled the FragmentManager logs and added a few of my own to better understand what's happening after pressing the button to change from private to normal homescreen:
08:47:33.085 I Mugurel: applyWallpaper from observeWallpaperUpdates of HomeFragment{ac8d272} (0e098b8b-25b3-45aa-b830-8b828db21db7 id=0x7f0901ee tag=f7c7e1a0-5e2d-4250-b6d1-8d7b7791e9c3)
08:47:33.085 I Mugurel: current theme private?: false
08:47:33.085 I Mugurel: current browsing mode: Normal
08:47:33.086 I Mugurel: Loading bitmap for Wallpaper(name=peeking-dark, collection=Collection(name=default, heading=null, description=null, learnMoreUrl=null, availableLocales=null, startDate=null, endDate=null), textColor=null, cardColorLight=null, cardColorDark=null, thumbnailFileState=Downloaded, assetsFileState=Downloaded)
08:47:33.104 D movefrom RESUMED: NavHostFragment{484970c} (291e3861-2e6b-480c-afc6-273bd7486f67 id=0x7f0901ee)
08:47:33.104 D movefrom RESUMED: HomeFragment{ac8d272} (0e098b8b-25b3-45aa-b830-8b828db21db7 id=0x7f0901ee tag=f7c7e1a0-5e2d-4250-b6d1-8d7b7791e9c3)
08:47:33.104 D OnBackPressedCallback for FragmentManager FragmentManager{743537d in HomeFragment{ac8d272}}} enabled state is false
08:47:33.108 D OnBackPressedCallback for FragmentManager FragmentManager{ecfdae3 in NavHostFragment{484970c}}} enabled state is false
08:47:33.109 D OnBackPressedCallback for FragmentManager FragmentManager{8971f27 in HostCallbacks{30055d4}}} enabled state is false
08:47:33.136 D movefrom STARTED: NavHostFragment{484970c} (291e3861-2e6b-480c-afc6-273bd7486f67 id=0x7f0901ee)
08:47:33.136 D movefrom STARTED: HomeFragment{ac8d272} (0e098b8b-25b3-45aa-b830-8b828db21db7 id=0x7f0901ee tag=f7c7e1a0-5e2d-4250-b6d1-8d7b7791e9c3)
08:47:33.137 D OnBackPressedCallback for FragmentManager FragmentManager{743537d in HomeFragment{ac8d272}}} enabled state is false
08:47:33.137 D OnBackPressedCallback for FragmentManager FragmentManager{ecfdae3 in NavHostFragment{484970c}}} enabled state is false
08:47:33.137 D OnBackPressedCallback for FragmentManager FragmentManager{8971f27 in HostCallbacks{30055d4}}} enabled state is false
08:47:33.142 D OnBackPressedCallback for FragmentManager FragmentManager{8971f27 in HostCallbacks{30055d4}}} enabled state is false
08:47:33.143 D OnBackPressedCallback for FragmentManager FragmentManager{ecfdae3 in NavHostFragment{484970c}}} enabled state is false
08:47:33.144 D OnBackPressedCallback for FragmentManager FragmentManager{743537d in HomeFragment{ac8d272}}} enabled state is false
08:47:33.153 D OnBackPressedCallback for FragmentManager FragmentManager{8971f27 in HostCallbacks{30055d4}}} enabled state is false
08:47:33.153 D movefrom ACTIVITY_CREATED: NavHostFragment{484970c} (291e3861-2e6b-480c-afc6-273bd7486f67 id=0x7f0901ee)
08:47:33.168 D movefrom CREATE_VIEW: NavHostFragment{484970c} (291e3861-2e6b-480c-afc6-273bd7486f67 id=0x7f0901ee)
08:47:33.168 D movefrom ACTIVITY_CREATED: HomeFragment{ac8d272} (0e098b8b-25b3-45aa-b830-8b828db21db7 id=0x7f0901ee tag=f7c7e1a0-5e2d-4250-b6d1-8d7b7791e9c3)
08:47:33.169 D movefrom CREATE_VIEW: HomeFragment{ac8d272} (0e098b8b-25b3-45aa-b830-8b828db21db7 id=0x7f0901ee tag=f7c7e1a0-5e2d-4250-b6d1-8d7b7791e9c3)
08:47:33.169 D OnBackPressedCallback for FragmentManager FragmentManager{743537d in HomeFragment{ac8d272}}} enabled state is false
08:47:33.186 D OnBackPressedCallback for FragmentManager FragmentManager{ecfdae3 in NavHostFragment{484970c}}} enabled state is false
08:47:33.186 D movefrom CREATED: NavHostFragment{484970c} (291e3861-2e6b-480c-afc6-273bd7486f67 id=0x7f0901ee)
08:47:33.186 D OnBackPressedCallback for FragmentManager FragmentManager{ecfdae3 in NavHostFragment{484970c}}} enabled state is false
08:47:33.186 D movefrom CREATED: HomeFragment{ac8d272} (0e098b8b-25b3-45aa-b830-8b828db21db7 id=0x7f0901ee tag=f7c7e1a0-5e2d-4250-b6d1-8d7b7791e9c3)
08:47:33.186 D OnBackPressedCallback for FragmentManager FragmentManager{743537d in HomeFragment{ac8d272}}} enabled state is false
08:47:33.186 D OnBackPressedCallback for FragmentManager FragmentManager{743537d in HomeFragment{ac8d272}}} enabled state is false
08:47:33.187 D movefrom ATTACHED: HomeFragment{ac8d272} (0e098b8b-25b3-45aa-b830-8b828db21db7 id=0x7f0901ee tag=f7c7e1a0-5e2d-4250-b6d1-8d7b7791e9c3)
08:47:33.188 D initState called for fragment: HomeFragment{ac8d272} (0e098b8b-25b3-45aa-b830-8b828db21db7 id=0x7f0901ee tag=f7c7e1a0-5e2d-4250-b6d1-8d7b7791e9c3)
08:47:33.188 D OnBackPressedCallback for FragmentManager FragmentManager{ecfdae3 in NavHostFragment{484970c}}} enabled state is false
08:47:33.189 D movefrom ATTACHED: NavHostFragment{484970c} (291e3861-2e6b-480c-afc6-273bd7486f67 id=0x7f0901ee)
08:47:33.189 D initState called for fragment: NavHostFragment{484970c} (291e3861-2e6b-480c-afc6-273bd7486f67 id=0x7f0901ee)
08:47:33.189 D OnBackPressedCallback for FragmentManager FragmentManager{8971f27 in HostCallbacks{30055d4}}} enabled state is false
08:47:33.203 D OnBackPressedCallback for FragmentManager FragmentManager{756480a in null}} enabled state is false
08:47:33.205 D moveto ATTACHED: NavHostFragment{dc69157} (291e3861-2e6b-480c-afc6-273bd7486f67 id=0x7f0901ee)
08:47:33.205 D OnBackPressedCallback for FragmentManager FragmentManager{756480a in NavHostFragment{dc69157}}} enabled state is false
08:47:33.205 D OnBackPressedCallback for FragmentManager FragmentManager{756480a in NavHostFragment{dc69157}}} enabled state is false
08:47:33.205 D moveto CREATED: NavHostFragment{dc69157} (291e3861-2e6b-480c-afc6-273bd7486f67 id=0x7f0901ee)
08:47:33.238 D FragmentManager FragmentManager{aebdf5e in HostCallbacks{530ef3f}}} enabling OnBackPressedCallback, caused by non-empty pending actions
08:47:33.239 D OnBackPressedCallback for FragmentManager FragmentManager{875400c in null}} enabled state is false
08:47:33.239 D moveto ATTACHED: HomeFragment{8b81d55} (0e098b8b-25b3-45aa-b830-8b828db21db7 id=0x7f0901ee tag=f7c7e1a0-5e2d-4250-b6d1-8d7b7791e9c3)
08:47:33.239 D OnBackPressedCallback for FragmentManager FragmentManager{875400c in HomeFragment{8b81d55}}} enabled state is false
08:47:33.239 D OnBackPressedCallback for FragmentManager FragmentManager{875400c in HomeFragment{8b81d55}}} enabled state is false
08:47:33.239 D moveto CREATED: HomeFragment{8b81d55} (0e098b8b-25b3-45aa-b830-8b828db21db7 id=0x7f0901ee tag=f7c7e1a0-5e2d-4250-b6d1-8d7b7791e9c3)
08:47:33.239 D OnBackPressedCallback for FragmentManager FragmentManager{875400c in HomeFragment{8b81d55}}} enabled state is false
08:47:33.240 D OnBackPressedCallback for FragmentManager FragmentManager{756480a in NavHostFragment{dc69157}}} enabled state is false
08:47:33.241 D OnBackPressedCallback for FragmentManager FragmentManager{756480a in NavHostFragment{dc69157}}} enabled state is false
08:47:33.241 D OnBackPressedCallback for FragmentManager FragmentManager{875400c in HomeFragment{8b81d55}}} enabled state is false
08:47:33.241 D OnBackPressedCallback for FragmentManager FragmentManager{756480a in NavHostFragment{dc69157}}} enabled state is false
08:47:33.241 D OnBackPressedCallback for FragmentManager FragmentManager{875400c in HomeFragment{8b81d55}}} enabled state is false
08:47:33.241 D OnBackPressedCallback for FragmentManager FragmentManager{aebdf5e in HostCallbacks{530ef3f}}} enabled state is false
08:47:33.256 D moveto CREATE_VIEW: NavHostFragment{dc69157} (291e3861-2e6b-480c-afc6-273bd7486f67 id=0x7f0901ee)
08:47:33.256 D Setting ViewLifecycleOwner on View androidx.fragment.app.FragmentContainerView{34b796e V.E...... ......I. 0,0-0,0 #7f0901ee app:id/container} for Fragment NavHostFragment{dc69157} (291e3861-2e6b-480c-afc6-273bd7486f67 id=0x7f0901ee)
08:47:33.256 D moveto VIEW_CREATED: NavHostFragment{dc69157} (291e3861-2e6b-480c-afc6-273bd7486f67 id=0x7f0901ee)
08:47:33.257 D moveto CREATE_VIEW: HomeFragment{8b81d55} (0e098b8b-25b3-45aa-b830-8b828db21db7 id=0x7f0901ee tag=f7c7e1a0-5e2d-4250-b6d1-8d7b7791e9c3)
08:47:33.269 I Mugurel: applyWallpaper from onCreateView of HomeFragment{8b81d55} (0e098b8b-25b3-45aa-b830-8b828db21db7 id=0x7f0901ee tag=f7c7e1a0-5e2d-4250-b6d1-8d7b7791e9c3)
08:47:33.270 I Mugurel: current theme private?: false
08:47:33.270 I Mugurel: current browsing mode: Normal
08:47:33.270 I Mugurel: Loading bitmap for Wallpaper(name=peeking-dark, collection=Collection(name=default, heading=null, description=null, learnMoreUrl=null, availableLocales=null, startDate=null, endDate=null), textColor=null, cardColorLight=null, cardColorDark=null, thumbnailFileState=Downloaded, assetsFileState=Downloaded)
08:47:33.284 D Setting ViewLifecycleOwner on View androidx.coordinatorlayout.widget.CoordinatorLayout{e7446ce V.E...... ......I. 0,0-0,0 #7f0902f5 app:id/homeLayout} for Fragment HomeFragment{8b81d55} (0e098b8b-25b3-45aa-b830-8b828db21db7 id=0x7f0901ee tag=f7c7e1a0-5e2d-4250-b6d1-8d7b7791e9c3)
08:47:33.284 D moveto VIEW_CREATED: HomeFragment{8b81d55} (0e098b8b-25b3-45aa-b830-8b828db21db7 id=0x7f0901ee tag=f7c7e1a0-5e2d-4250-b6d1-8d7b7791e9c3)
08:47:33.326 D OnBackPressedCallback for FragmentManager FragmentManager{875400c in HomeFragment{8b81d55}}} enabled state is false
08:47:33.326 D OnBackPressedCallback for FragmentManager FragmentManager{756480a in NavHostFragment{dc69157}}} enabled state is false
08:47:33.328 D moveto ACTIVITY_CREATED: NavHostFragment{dc69157} (291e3861-2e6b-480c-afc6-273bd7486f67 id=0x7f0901ee)
08:47:33.328 D moveto RESTORE_VIEW_STATE: NavHostFragment{dc69157} (291e3861-2e6b-480c-afc6-273bd7486f67 id=0x7f0901ee)
08:47:33.328 D moveto ACTIVITY_CREATED: HomeFragment{8b81d55} (0e098b8b-25b3-45aa-b830-8b828db21db7 id=0x7f0901ee tag=f7c7e1a0-5e2d-4250-b6d1-8d7b7791e9c3)
08:47:33.328 D moveto RESTORE_VIEW_STATE: HomeFragment{8b81d55} (0e098b8b-25b3-45aa-b830-8b828db21db7 id=0x7f0901ee tag=f7c7e1a0-5e2d-4250-b6d1-8d7b7791e9c3)
08:47:33.378 D OnBackPressedCallback for FragmentManager FragmentManager{875400c in HomeFragment{8b81d55}}} enabled state is false
08:47:33.378 D OnBackPressedCallback for FragmentManager FragmentManager{756480a in NavHostFragment{dc69157}}} enabled state is false
08:47:33.378 D OnBackPressedCallback for FragmentManager FragmentManager{aebdf5e in HostCallbacks{530ef3f}}} enabled state is false
08:47:33.378 D OnBackPressedCallback for FragmentManager FragmentManager{aebdf5e in HostCallbacks{530ef3f}}} enabled state is false
08:47:33.379 D moveto STARTED: NavHostFragment{dc69157} (291e3861-2e6b-480c-afc6-273bd7486f67 id=0x7f0901ee)
08:47:33.379 D OnBackPressedCallback for FragmentManager FragmentManager{756480a in NavHostFragment{dc69157}}} enabled state is false
08:47:33.379 D moveto STARTED: HomeFragment{8b81d55} (0e098b8b-25b3-45aa-b830-8b828db21db7 id=0x7f0901ee tag=f7c7e1a0-5e2d-4250-b6d1-8d7b7791e9c3)
08:47:33.379 D OnBackPressedCallback for FragmentManager FragmentManager{875400c in HomeFragment{8b81d55}}} enabled state is false
08:47:33.384 D OnBackPressedCallback for FragmentManager FragmentManager{875400c in HomeFragment{8b81d55}}} enabled state is false
08:47:33.385 D OnBackPressedCallback for FragmentManager FragmentManager{756480a in NavHostFragment{dc69157}}} enabled state is false
08:47:33.385 D OnBackPressedCallback for FragmentManager FragmentManager{aebdf5e in HostCallbacks{530ef3f}}} enabled state is false
08:47:33.393 D OnBackPressedCallback for FragmentManager FragmentManager{aebdf5e in HostCallbacks{530ef3f}}} enabled state is false
08:47:33.399 D moveto RESUMED: NavHostFragment{dc69157} (291e3861-2e6b-480c-afc6-273bd7486f67 id=0x7f0901ee)
08:47:33.399 D OnBackPressedCallback for FragmentManager FragmentManager{756480a in NavHostFragment{dc69157}}} enabled state is false
08:47:33.399 D moveto RESUMED: HomeFragment{8b81d55} (0e098b8b-25b3-45aa-b830-8b828db21db7 id=0x7f0901ee tag=f7c7e1a0-5e2d-4250-b6d1-8d7b7791e9c3)
08:47:33.399 D OnBackPressedCallback for FragmentManager FragmentManager{875400c in HomeFragment{8b81d55}}} enabled state is false
08:47:33.405 D OnBackPressedCallback for FragmentManager FragmentManager{875400c in HomeFragment{8b81d55}}} enabled state is false
08:47:33.407 D OnBackPressedCallback for FragmentManager FragmentManager{756480a in NavHostFragment{dc69157}}} enabled state is false
08:47:33.407 D OnBackPressedCallback for FragmentManager FragmentManager{aebdf5e in HostCallbacks{530ef3f}}} enabled state is false
08:47:33.783 I Mugurel: return @run from HomeFragment{ac8d272} (cee3b16e-7647-4848-bf9d-2598fcabc221)
08:47:33.795 E Uncaught exception handled:
java.lang.IllegalStateException: Can't access the Fragment View's LifecycleOwner for HomeFragment{ac8d272} (cee3b16e-7647-4848-bf9d-2598fcabc221) when getView() is null i.e., before onCreateView() or after onDestroyView()
So what happens is that upon pressing that button the private homescreen's observeWallpaperUpdates is trying to apply the current wallpaper through applyWallpaper(), this starting a coroutine that runs concurrently with destroying the private homescreen so that when applyWallpaper finishes with trying to register a new observer for wallpaper changes this tries to set a new one while the View has already been destroyed.
| Assignee | ||
Comment 7•2 months ago
|
||
| Reporter | ||
Comment 9•2 months ago
|
||
thanks for the quick fix!
Out of curiosity :D, how do you usually test the external wallpaper code paths locally? My local fenix .debug build didn't seem to have the custom wallpaper options enabled, so I struggled to reproduce the crash...
| Assignee | ||
Comment 10•2 months ago
|
||
(In reply to Nishchay [:nish] from comment #9)
thanks for the quick fix!
Out of curiosity :D, how do you usually test the external wallpaper code paths locally? My local fenix .debug build didn't seem to have the custom wallpaper options enabled, so I struggled to reproduce the crash...
Thank you for the report and all the details!
Indeed, seems like we need the remote wallpapers for this issue to reproduce.
Debug builds are missing the URL of the remote server to download these wallpapers from as this is not intended to be publicly available.
Comment 11•2 months ago
|
||
| bugherder | ||
Comment 12•2 months ago
|
||
| bugherder | ||
Comment 13•1 month ago
|
||
firefox-release Uplift Approval Request
- User impact if declined/Reason for urgency: Product requested - Help avoid a bug impacting the release of the new Kit wallpapers.
- Code covered by automated testing?: no
- Fix verified in Nightly?: yes
- Needs manual QE testing?: yes
- Steps to reproduce for manual QE testing: - https://bugzilla.mozilla.org/show_bug.cgi?id=2019462#c0
- https://bugzilla.mozilla.org/show_bug.cgi?id=2021783#c0
- Risk associated with taking this patch: low
- Explanation of risk level: Patches already part of Nightly and Beta, verified by QA.
- String changes made/needed?: --
- Is Android affected?: yes
| Assignee | ||
Comment 14•1 month ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D286605
Comment 15•1 month ago
|
||
149 is unaffected as the regressor landed in 150. Petru why are you requesting a 149 uplift? Thanks
Updated•1 month ago
|
Updated•1 month ago
|
Comment 16•1 month ago
|
||
| uplift | ||
| Assignee | ||
Comment 17•1 month ago
|
||
(In reply to Pascal Chevrel:pascalc from comment #15)
149 is unaffected as the regressor landed in 150. Petru why are you requesting a 149 uplift? Thanks
Talked "offline" also.
My intent was to actually uplift bug 2019462 to 149 which would also "uplift" this crash so with the uplift request wanted to ensure both patches are uplifted together to 149.
Comment 18•1 month ago
|
||
This issue is verified as fixed on Firefox 150 beta 3 and Firefox 149.0.1 using Samsung Galaxy s24 Ultra (Android 16). Confirming that no crash occurs when switching from private to normal browsing with a non-default wallpaper set.
Updated•1 month ago
|
Description
•