Crash in [@ android.util.AndroidRuntimeException: at com.android.internal.policy.impl.PhoneWindow.requestFeature(PhoneWindow.java)] "requestFeature() must be called before adding content"
Categories
(Firefox for Android :: General, defect, P2)
Tracking
()
People
(Reporter: cpeterson, Assigned: amejia)
References
(Regression)
Details
(Keywords: crash, regression, topcrash)
Crash Data
Attachments
(7 files, 1 obsolete file)
43.50 KB,
image/png
|
Details | |
59 bytes,
text/x-github-pull-request
|
Details | Review | |
59 bytes,
text/x-github-pull-request
|
diannaS
:
approval-mozilla-release+
|
Details | Review |
59 bytes,
text/x-github-pull-request
|
RyanVM
:
approval-mozilla-beta+
|
Details | Review |
59 bytes,
text/x-github-pull-request
|
Details | Review | |
59 bytes,
text/x-github-pull-request
|
diannaS
:
approval-mozilla-beta+
|
Details | Review |
60 bytes,
text/x-github-pull-request
|
diannaS
:
approval-mozilla-release+
|
Details | Review |
Crash report: https://crash-stats.mozilla.org/report/index/527e74fb-04ec-4175-9eeb-cd0b90230617
Java stack trace:
android.util.AndroidRuntimeException: requestFeature() must be called before adding content
at com.android.internal.policy.impl.PhoneWindow.requestFeature(PhoneWindow.java:359)
at com.android.internal.app.AlertController.installContent(AlertController.java:233)
at android.app.AlertDialog.onCreate(AlertDialog.java:356)
at android.app.Dialog.dispatchOnCreate(Dialog.java:463)
at android.app.Dialog.show(Dialog.java:288)
at androidx.fragment.app.DialogFragment.onStart(DialogFragment.java:11)
at androidx.fragment.app.FragmentStateManager.start(FragmentStateManager.java:30)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:57)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1139)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:92)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:74)
at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:4)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5951)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)
Reporter | ||
Updated•2 years ago
|
Comment 1•2 years ago
|
||
The bug is linked to a topcrash signature, which matches the following criterion:
- Top 10 AArch64 and ARM crashes on beta
:jonalmeida, could you consider increasing the severity of this top-crash bug?
For more information, please visit BugBot documentation.
Comment 2•2 years ago
|
||
Bryan, can you please help find an assignee for this Fenix topcrash? Thanks!
Reporter | ||
Comment 3•2 years ago
|
||
This crash looks like a regression in 115: we have crash reports from 115-117 (Nightly, Beta, and Release), but none before 115.
100% of the crash reports are from devices running API 21-23 (Android 5.0, 5.1, and 6.0). 70% are from ARMv7 devices.
Reporter | ||
Comment 4•2 years ago
|
||
While nearly all the crash reports are from Fenix, there are a few from Focus 115.0, so we know this crash is in code common to Fenix and Focus.
The first crash reports were from Nightly 115.0a1 build ID 20230510213701. If this crash was caused by a code change, it might have landed before this build, but here is the mozilla-central change log for build ID 20230510213701:
The only suspicious Android change in that change log is compositor bug 1824083. Seems more likely that a change in Fenix/Focus or A-C code would cause this crash related to fragments and alerts.
![]() |
Assignee | |
Comment 5•2 years ago
•
|
||
Comment 6•2 years ago
|
||
Hi Jamie, is this something that could possibly be related to bug 1824083?
Updated•2 years ago
|
Reporter | ||
Comment 7•2 years ago
|
||
Do we know what the stack trace is trying to do calling AlertDialog.onCreate()
and PhoneWindow.requestFeature()
? Is this code trying to ask the user for a new app permission?
android.util.AndroidRuntimeException: requestFeature() must be called before adding content
at com.android.internal.policy.impl.PhoneWindow.requestFeature(PhoneWindow.java:359)
at com.android.internal.app.AlertController.installContent(AlertController.java:233)
at android.app.AlertDialog.onCreate(AlertDialog.java:356)
at android.app.Dialog.dispatchOnCreate(Dialog.java:463)
at android.app.Dialog.show(Dialog.java:288)
at androidx.fragment.app.DialogFragment.onStart(DialogFragment.java:11)
at androidx.fragment.app.FragmentStateManager.start(FragmentStateManager.java:30)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:57)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1139)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:92)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:74)
at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:4)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5951)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)
Reporter | ||
Updated•2 years ago
|
Updated•2 years ago
|
Comment 8•2 years ago
|
||
(In reply to Roger Yang [:royang] from comment #6)
Hi Jamie, is this something that could possibly be related to bug 1824083?
It seems pretty unlikely given the stack trace, but to encounter that bug in the first place there had to be something strange going on, so I won't rule it out completely.
The nightly crash numbers are pretty low, with large gaps between build IDs that have >= 1 crash. So I don't think we can safely look at the changelog for a single nightly version. Also given the stack trace has nothing gecko-related in it, perhaps we ought to look at the android-components changelog too.
![]() |
Assignee | |
Comment 9•2 years ago
|
||
I think it's really unlikely this is gecko/GeckoView related, I think this is something that could be on the Android layer.
![]() |
Assignee | |
Comment 10•2 years ago
•
|
||
Checking the Sentry Android versions, it looks like is happening on older Android versions, where newest one is Android 6.0.1.
![]() |
Assignee | |
Updated•2 years ago
|
![]() |
Assignee | |
Comment 11•2 years ago
|
||
This patch seen a bit suspicious, I'm not completely sure if it could be the source.
Reporter | ||
Comment 12•2 years ago
|
||
(In reply to Arturo Mejia [:amejia] from comment #10)
Checking the Sentry Android versions, it looks like is happening on older Android versions, where newest one is Android 6.0.1.
Socorro shows the same pattern: 100% of the crash reports are from API 21, 22, or 23 (Android 5.0 - 6.0):
![]() |
Assignee | |
Comment 13•2 years ago
|
||
As the stack-trace is very generic, it's difficult to know for sure the source, I think adding some extra information to the crash could help, I'll add some Sentry breadcrumbs on each part where we create a dialog, that will give us some hints about which is the dialog the produce crash.
Comment 14•2 years ago
|
||
Reporter | ||
Comment 15•2 years ago
|
||
In the meantime, should we temporarily back out Jonathan's tabs tray fix from bug 1822448 to see if that fixes the issue?
![]() |
Assignee | |
Comment 16•2 years ago
•
|
||
We could but I'm not 100% sure that it is the root cause. We could back it out and see if the crashes reduce and it doesn't we can put it back, what do you think?
Comment 17•2 years ago
|
||
Authored by https://github.com/Amejia481
https://github.com/mozilla-mobile/firefox-android/commit/19a1105e8b1a6699aa83467dbaeb5e84cd938c79
[main] Bug 1839239 - Add crash bread crumbs for dialogs.
![]() |
Assignee | |
Updated•2 years ago
|
![]() |
Assignee | |
Updated•2 years ago
|
Comment 18•2 years ago
|
||
![]() |
Assignee | |
Comment 19•2 years ago
|
||
Comment on attachment 9343489 [details] [review]
[mozilla-mobile/firefox-android] Bug 1839239 - Add crash bread crumbs for dialogs. (backport #2804) (#2811)
Beta/Release Uplift Approval Request
- User impact if declined: The rate on this bug will continue increasing without a solution.
- Is this code covered by automated tests?: No
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): We are only collecting more information about the crash, nothing visible to the user.
- String changes made/needed:
- Is Android affected?: Yes
Comment 20•2 years ago
|
||
:amejia could you add a beta uplift request also on a backport for 116?
We should get this into beta first and then we can pick it for next week's 115 dot release.
![]() |
Assignee | |
Comment 22•2 years ago
|
||
The crash rate in beta is similar is similar to nightly, both are really low, it looks like we don't have enough of those devices there, it's very likely that we will need to wait until the next week's 115 dot release to start getting data.
Comment 23•2 years ago
|
||
![]() |
Assignee | |
Comment 24•2 years ago
|
||
Comment on attachment 9343508 [details] [review]
[mozilla-mobile/firefox-android] Bug 1839239 - Add crash bread crumbs for dialogs. (backport #2804) (#2813)
Beta/Release Uplift Approval Request
- User impact if declined: The rate on this bug could continue increasing without a solution.
- Is this code covered by automated tests?: No
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): We are only collecting more information about the crash, nothing visible to the user.
- String changes made/needed:
- Is Android affected?: Yes
Updated•2 years ago
|
Comment 25•2 years ago
|
||
Comment 26•2 years ago
|
||
![]() |
Assignee | |
Comment 27•2 years ago
|
||
Thanks Ryan!
The patch is now updated!
Comment 28•2 years ago
|
||
Comment 29•2 years ago
|
||
Authored by https://github.com/Amejia481
https://github.com/mozilla-mobile/firefox-android/commit/2b4e399890984b57ce71124f9961e023b02fda57
[releases_v116] Bug 1839239 - Add crash bread crumbs for dialogs.
Reporter | ||
Comment 30•2 years ago
|
||
(In reply to Arturo Mejia [:amejia] from comment #16)
We could but I'm not 100% sure that it is the root cause. We could back it out and see if the crashes reduce and it doesn't we can put it back, what do you think?
Since this bug's crash rate continues to climb in 115, I think backing out Jonathan's change is worth testing. His fix was pretty small and should be easy to back out. Plus, the bug we would be temporarily reintroducing (an animation issue on older Android versions) isn't as bad as this crash.
Since the crash rate is pretty low in Nightly and Beta, we will probably need to uplift to next week's 115 dot release to see if there is any change.
The uplift deadline for next week's 115 dot release is this Friday (July 14).
![]() |
Assignee | |
Comment 31•2 years ago
•
|
||
Luckily we started to get some data in nightly:
We got 4 reports
- 3 pointing TimePickerDialogFragment (1, 2, and 3) Probably the same user.
- 1 pointing SyncManager sync ended.
As this stack is pretty generic is very likely that is no one issue, but multiple issues aggregated in a generic stack.
I started taking a look the new data to see if something that we can address.
![]() |
Assignee | |
Comment 32•2 years ago
|
||
The last changes to TimePickerDialogFragment was this commit Bug 1815637 - Add rtl support which applies withCenterAlignedButtons to practically every dialog.
![]() |
Assignee | |
Comment 33•2 years ago
•
|
||
I was able to reproduce the crash locally, with an emulator Pixel 6 API 23 (Android 6 Google APIs | arm64) .
STR:
- Go to https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/time
- Tap on the time input with the label "Choose a time for your meeting"
After removing the calls to withCenterAlignedButtons I don't get the crash anymore.
As the crash doesn't happen on newer version of Android, we could disable withCenterAlignedButtons on API levels lower or equal to 23, so we don't lose the improvements for newer Android versions.
![]() |
Assignee | |
Comment 34•2 years ago
|
||
Unfortunately, checking closer at the reports we also have small number of Android versions like 13, and 12. I'll back out Bug 1815637 - Add rtl support.
Adding Mike for future research about bug #1815637
![]() |
Assignee | |
Updated•2 years ago
|
![]() |
Assignee | |
Comment 35•2 years ago
|
||
This is the patch for back out Bug 1815637 - Add rtl support.
![]() |
Assignee | |
Comment 36•2 years ago
|
||
![]() |
Assignee | |
Comment 37•2 years ago
|
||
Reporter | ||
Comment 38•2 years ago
|
||
Mike, since Arturo is backing out your fix for RTL bug 1815637, should we reopen that bug, file a new bug, or accept that the RTL issue won't be fixed?
![]() |
Assignee | |
Comment 39•2 years ago
|
||
Sorry, I just noticed the message, and I already opened the bug.
![]() |
Assignee | |
Updated•2 years ago
|
![]() |
Assignee | |
Comment 40•2 years ago
•
|
||
Hi QA team,
Could you help us to verify that the crash doesn't happen on nightly steps can be found on comment #33.
Thanks in advance!
Comment 41•2 years ago
|
||
(In reply to Chris Peterson [:cpeterson] from comment #38)
Mike, since Arturo is backing out your fix for RTL bug 1815637, should we reopen that bug, file a new bug, or accept that the RTL issue won't be fixed?
PSA: Mike's out on PTO this week - with bug 1815637 reopened, he can make a call on next steps for it when he's back online next week.
Comment 42•2 years ago
|
||
(In reply to Arturo Mejia [:amejia] from comment #40)
Hi QA team,
Could you help us to verify that the crash doesn't happen on nightly steps can be found on [comment #33]
Hi, we followed the STR using the latest Nightly 117.0a1 from 07/14 and the application remained stable.
Devices used for testing:
- Huawei MediaPad M2 (Android 5.1.1)
- Sony Xperia (Android 6.0.1)
- OPPO A15s (Android 10)
- Xiaomi 12 Pro (Android 13)
![]() |
Assignee | |
Comment 43•2 years ago
•
|
||
Thanks Delia and Joe!
![]() |
Assignee | |
Comment 44•2 years ago
|
||
![]() |
Assignee | |
Comment 45•2 years ago
|
||
Comment on attachment 9343891 [details] [review]
Reverts "Bug 1815637 - Add rtl support." (backport #2835) in Beta
Beta/Release Uplift Approval Request
- User impact if declined: The rate on this bug could continue increasing.
- Is this code covered by automated tests?: No
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: Yes
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): We are just reverting a patch.
- String changes made/needed:
- Is Android affected?: Yes
![]() |
Assignee | |
Comment 46•2 years ago
|
||
![]() |
Assignee | |
Comment 47•2 years ago
|
||
Comment on attachment 9343908 [details] [review]
Reverts "Bug 1815637 - Add rtl support." (backport #2835) in Release
Beta/Release Uplift Approval Request
- User impact if declined: The rate on this bug could continue increasing.
- Is this code covered by automated tests?: No
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): We are just reverting a patch, and verify the crash was fixed with the revert
- String changes made/needed:
- Is Android affected?: Yes
Comment 48•2 years ago
|
||
Comment 49•2 years ago
|
||
There is no crash on the latest Beta 116.0b6 build with steps from https://bugzilla.mozilla.org/show_bug.cgi?id=1839239#c33.
Devices used:
- Lenovo Tab P11 Plus (Android 12)
- Oppo Find X5 (Android 13)
- Google Pixel 7 Pro (Android 14)
- Samsung S22 Ultra (Android 13)
Also checked on the latest Nightly 117.0a1 from 2023-07-17 with the same result.
Marking the ticket as verified for 116 and 117.
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 50•2 years ago
|
||
Updated•2 years ago
|
Comment 51•2 years ago
|
||
Authored by https://github.com/mergify[bot]
https://github.com/mozilla-mobile/firefox-android/commit/046c284cb99ec97ef18f187ca91f56bcd8ddfd4b
[releases_v115] Bug 1839239 - Add crash bread crumbs for dialogs. (#2811)
![]() |
||
Comment 52•2 years ago
•
|
||
Verified as fixed on Fenix RC 115.2.1, using the STR from Comment 33.
Devices used for testing:
- Samsung Galaxy Tab S3 (Android 9)
- Oppo Find X5 (Android 12)
- Google Pixel 7 (Android 14)
- Samsung Galaxy Tab A6 (Android 5.1.1)
- Google Pixel 7 Pro (Android 14)
- Lenovo Tab P11 Plus (Android 12)
- LG Nexus 5 (Android 6.0.1)
![]() |
||
Updated•2 years ago
|
Updated•2 years ago
|
Description
•