Closed agi closed 1 year ago
To be explicit, the performance team is not planning to address this issue but I'm adding it to our board to track it (because StrictMode failures are indicative of performance issues). Please prioritize this issue!
The stack trace isn't clear what's actually causing this issue.
Some reasons StrictMode violations may sneak into master builds:
We could consider enabling StrictMode in Nightly builds to get better tester coverage on these issues and identify the most prominent StrictMode errors in crash reporting.
agi can only reproduce on the S10e, not the S7. I know Samsung has some special enterprise functionality and the trace implies this may be related:
02-08 10:56:02.185 21990 21990 E AndroidRuntime: at com.android.server.enterprise.storage.EdmStorageProviderBase.getValues(EdmStorageProviderBase.java:388)
Since it doesn't seem to be occurring asynchronously (i.e. not due to a method we called), we may need to do some blanket fix (e.g. create a allowlist of StrictMode violations like in this article).
I had the same problem when debugging a different issue on my Galaxy S10e: https://github.com/mozilla-mobile/fenix/issues/17612#issuecomment-766785195
If you need to run the Debug build you can disable StrictMode by changing a line in the source code.
I see the same StackTrace in this issue: https://github.com/mozilla-mobile/fenix/issues/15430#issuecomment-699192045 We fixed it for a very particular case but it doesn't seem to apply to what agi's experiencing – maybe there was an OS upgrade. It looks like it applies to Galaxy A50, Galaxy Note 10, and LG G7 FIT.
When we address this, we may be able to back out the fixes for those issues.
I ended up trying to write a patch using penaltyListener
for P+ but it doesn't seem to work properly. I think penaltyListener
stops working after we call resetAfter
but I'm not quite sure why. I think this because I can cause a StrictMode violation to fail if I create one inside of StrictModeManager.enableStrictMode
but I can't in HomeActivity.onCreate
.
I ended up trying to write a patch using penaltyListener for P+ but it doesn't seem to work properly. I think penaltyListener stops working after we call resetAfter but I'm not quite sure why.
It seems to be caused by attachListenerToDisablePenaltyDeath
but unclear why the listener is affected but penaltyDeath
is not.
Got something working locally – let's check with agi if it's working.
It works for agi. I refactored a bit since we tested but I don't think I broke anything so I'm just going to push.
This should be addressed with https://github.com/mozilla-mobile/fenix/commit/b41041c7397bd0a483e095d5902d943c47d8c648
QA: can you validate that, in a debug build, the app doesn't crash on start up on the Galaxy S10e?
Furthermore, my fix for this bug may have addressed https://github.com/mozilla-mobile/fenix/issues/16347 – can you test if the same crash occurs on these devices? Specifically, Samsung Galaxy Note10 (Android10) and LG G7 FIT (Android 8), and maybe the Galaxy A50. If it's fixed for these devices, can you close that bug too as a duplicate? Note: I only expect my fix to work on Android 9+ (so maybe not the LG G7 FIT).
Note that I was able to reproduce this issue on the Samsung Galaxy S10+ (Android 10).
Also, note that I was not able to install the debug builds from here as mentioned in the description and I've built from master.
It was a little bit hard to identify the crash-report as I couldn't access the app, getting a crash at startup all the time but I found it in the end and you can check it here .
Based on my comment I will remove eng:qa:needed
until further notice.
Triage: I already spent time on this and landed a solution but it didn't work in some cases. Neither Marc nor myself has a device to reproduce so it'd be time consuming to try to fix. It doesn't seem super high priority as the only case I've heard of that hits this is agi sharing debug builds to get info from users and no one else has hit this during development. As such, because this seems medium effort, low impact, we're going to set it as low impact/priority for the perf team. It should be fixable by any android dev who can reproduce though so it doesn't need our expertise
A workaround for local development is to disable strict mode.
I was able to reproduce the crash on Xiaomi Mi 8 Lite (Android 9), following these steps:
Fenix crashes.
2021-04-06 14:59:25.150 26001-26115/org.mozilla.fenix.debug E/GeckoLibLoad: Load sqlite start
2021-04-06 14:59:25.156 26001-26115/org.mozilla.fenix.debug E/GeckoLibLoad: Load sqlite done
2021-04-06 14:59:25.156 26001-26115/org.mozilla.fenix.debug E/GeckoLibLoad: Load nss start
2021-04-06 14:59:25.156 26001-26115/org.mozilla.fenix.debug E/GeckoLibLoad: Load nss done
2021-04-06 14:59:25.369 26001-26115/org.mozilla.fenix.debug E/GeckoLibLoad: Loaded libs in 211.891927ms total, 10ms(520ms) user, 30ms(90ms) system, 57(72) faults
2021-04-06 14:59:26.064 26001-26115/org.mozilla.fenix.debug E/GeckoConsole: [JavaScript Error: "NotFoundError: Could not open the file at /data/user/0/org.mozilla.fenix.debug/files/mozilla/s47n4k79.default/startupCache/webext.sc.lz4" {file: "resource://gre/modules/ExtensionParent.jsm" line: 1742}]
_readData@resource://gre/modules/ExtensionParent.jsm:1742:12
2021-04-06 14:59:26.148 26001-26115/org.mozilla.fenix.debug E/GeckoConsole: [JavaScript Error: "Error: File resource://default-theme/ does not contain a valid manifest" {file: "resource://gre/modules/addons/XPIInstall.jsm" line: 669}]
2021-04-06 14:59:26.148 26001-26115/org.mozilla.fenix.debug E/GeckoConsole: [JavaScript Error: "Error: File resource://default-theme/ does not contain a valid manifest" {file: "resource://gre/modules/addons/XPIInstall.jsm" line: 669}]
2021-04-06 14:59:26.253 26001-26209/org.mozilla.fenix.debug E/AndroidRuntime: FATAL EXCEPTION: pool-1-thread-1
Process: org.mozilla.fenix.debug, PID: 26001
java.lang.RuntimeException: StrictMode ThreadPolicy violation
at org.mozilla.fenix.perf.ThreadPenaltyDeathWithIgnoresListener.penaltyDeath(ThreadPenaltyDeathWithIgnoresListener.kt:44)
at org.mozilla.fenix.perf.ThreadPenaltyDeathWithIgnoresListener.onThreadViolation(ThreadPenaltyDeathWithIgnoresListener.kt:38)
at android.os.StrictMode$AndroidBlockGuardPolicy.lambda$onThreadPolicyViolation$1(StrictMode.java:1719)
at android.os.-$$Lambda$StrictMode$AndroidBlockGuardPolicy$FxZGA9KtfTewqdcxlUwvIe5Nx9I.run(Unknown Source:4)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Caused by: android.os.strictmode.DiskReadViolation
at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1504)
at java.io.UnixFileSystem.checkAccess(UnixFileSystem.java:251)
at java.io.File.exists(File.java:815)
at miui.util.TypefaceUtils.<clinit>(TypefaceUtils.java:327)
at miui.util.TypefaceUtils.replaceTypeface(TypefaceUtils.java:557)
at android.widget.TextView.replaceTypeface(TextView.java:3937)
at android.widget.TextView.setTypeface(TextView.java:3926)
at android.widget.TextView.setTypeface(TextView.java:2147)
at androidx.appcompat.widget.AppCompatTextView.setTypeface(AppCompatTextView.java:711)
at android.widget.TextView.resolveStyleAndSetTypeface(TextView.java:2037)
at android.widget.TextView.setTypefaceFromAttrs(TextView.java:2008)
at android.widget.TextView.applyTextAppearance(TextView.java:3647)
at android.widget.TextView.<init>(TextView.java:1498)
at android.widget.TextView.<init>(TextView.java:869)
at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:100)
at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:95)
at androidx.appcompat.app.AppCompatViewInflater.createTextView(AppCompatViewInflater.java:194)
at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:115)
at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1551)
at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1602)
at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:189)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:776)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:734)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:867)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:870)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:870)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828)
at android.view.LayoutInflater.inflate(LayoutInflater.java:519)
at android.view.LayoutInflater.inflate(LayoutInflater.java:427)
at org.mozilla.fenix.perf.PerformanceInflater.inflate(PerformanceInflater.kt:42)
at org.mozilla.fenix.home.HomeFragment$onCreateView$1.invoke(HomeFragment.kt:199)
at org.mozilla.fenix.home.HomeFragment$onCreateView$1.invoke(HomeFragment.kt:130)
at org.mozilla.fenix.ext.GleanKt.measureNoInline(Glean.kt:23)
at org.mozilla.fenix.home.HomeFragment.onCreateView(HomeFragment.kt:198)
at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2699)
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:320)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1199)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1368)
at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1446)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1509)
2021-04-06 14:59:26.255 26001-26209/org.mozilla.fenix.debug E/AndroidRuntime: at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2637)
at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:2589)
at androidx.fragment.app.Fragment.performActivityCreated(Fragment.java:2723)
at androidx.fragment.app.FragmentStateManager.activityCreated(FragmentStateManager.java:346)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1200)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1368)
at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1446)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1509)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2637)
at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:2589)
at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:247)
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:541)
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:210)
at org.mozilla.fenix.HomeActivity.access$onStart$s-594849490(HomeActivity.kt:127)
at org.mozilla.fenix.HomeActivity$onStart$1.invoke(HomeActivity.kt:339)
at org.mozilla.fenix.HomeActivity$onStart$1.invoke(HomeActivity.kt:127)
at org.mozilla.fenix.ext.GleanKt.measureNoInline(Glean.kt:23)
at org.mozilla.fenix.HomeActivity.onStart(HomeActivity.kt:338)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1392)
at android.app.Activity.performStart(Activity.java:7252)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:2970)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:180)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:165)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:142)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6806)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
2021-04-06 14:59:26.263 26001-26001/org.mozilla.fenix.debug E/libc: Access denied finding property "ro.serialno"
2021-04-06 14:59:26.280 26001-26209/org.mozilla.fenix.debug E/ExceptionHandler: Uncaught exception handled:
java.lang.RuntimeException: StrictMode ThreadPolicy violation
at org.mozilla.fenix.perf.ThreadPenaltyDeathWithIgnoresListener.penaltyDeath(ThreadPenaltyDeathWithIgnoresListener.kt:44)
at org.mozilla.fenix.perf.ThreadPenaltyDeathWithIgnoresListener.onThreadViolation(ThreadPenaltyDeathWithIgnoresListener.kt:38)
at android.os.StrictMode$AndroidBlockGuardPolicy.lambda$onThreadPolicyViolation$1(StrictMode.java:1719)
at android.os.-$$Lambda$StrictMode$AndroidBlockGuardPolicy$FxZGA9KtfTewqdcxlUwvIe5Nx9I.run(Unknown Source:4)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Caused by: android.os.strictmode.DiskReadViolation
at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1504)
at java.io.UnixFileSystem.checkAccess(UnixFileSystem.java:251)
at java.io.File.exists(File.java:815)
at miui.util.TypefaceUtils.<clinit>(TypefaceUtils.java:327)
at miui.util.TypefaceUtils.replaceTypeface(TypefaceUtils.java:557)
at android.widget.TextView.replaceTypeface(TextView.java:3937)
at android.widget.TextView.setTypeface(TextView.java:3926)
at android.widget.TextView.setTypeface(TextView.java:2147)
at androidx.appcompat.widget.AppCompatTextView.setTypeface(AppCompatTextView.java:711)
at android.widget.TextView.resolveStyleAndSetTypeface(TextView.java:2037)
at android.widget.TextView.setTypefaceFromAttrs(TextView.java:2008)
at android.widget.TextView.applyTextAppearance(TextView.java:3647)
at android.widget.TextView.<init>(TextView.java:1498)
at android.widget.TextView.<init>(TextView.java:869)
at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:100)
at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:95)
at androidx.appcompat.app.AppCompatViewInflater.createTextView(AppCompatViewInflater.java:194)
at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:115)
at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1551)
at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1602)
at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:189)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:776)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:734)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:867)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:870)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:870)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828)
at android.view.LayoutInflater.inflate(LayoutInflater.java:519)
at android.view.LayoutInflater.inflate(LayoutInflater.java:427)
at org.mozilla.fenix.perf.PerformanceInflater.inflate(PerformanceInflater.kt:42)
at org.mozilla.fenix.home.HomeFragment$onCreateView$1.invoke(HomeFragment.kt:199)
at org.mozilla.fenix.home.HomeFragment$onCreateView$1.invoke(HomeFragment.kt:130)
at org.mozilla.fenix.ext.GleanKt.measureNoInline(Glean.kt:23)
at org.mozilla.fenix.home.HomeFragment.onCreateView(HomeFragment.kt:198)
at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2699)
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:320)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1199)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1368)
at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1446)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1509)
2021-04-06 14:59:26.280 26001-26209/org.mozilla.fenix.debug E/ExceptionHandler: at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2637)
at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:2589)
at androidx.fragment.app.Fragment.performActivityCreated(Fragment.java:2723)
at androidx.fragment.app.FragmentStateManager.activityCreated(FragmentStateManager.java:346)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1200)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1368)
at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1446)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1509)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2637)
at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:2589)
at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:247)
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:541)
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:210)
at org.mozilla.fenix.HomeActivity.access$onStart$s-594849490(HomeActivity.kt:127)
at org.mozilla.fenix.HomeActivity$onStart$1.invoke(HomeActivity.kt:339)
at org.mozilla.fenix.HomeActivity$onStart$1.invoke(HomeActivity.kt:127)
at org.mozilla.fenix.ext.GleanKt.measureNoInline(Glean.kt:23)
at org.mozilla.fenix.HomeActivity.onStart(HomeActivity.kt:338)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1392)
at android.app.Activity.performStart(Activity.java:7252)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:2970)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:180)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:165)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:142)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6806)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
See: https://github.com/mozilla-mobile/fenix/issues/17373 This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Still an issue, and same problem (strict mode) on a starqlteue (S9, API 26) [at least confirmed from attempting an instrumented run on Firebase Test Lab) (01/10 debug ARM builds)
android.os.StrictMode$StrictModeViolation: policy=327743 violation=2
FATAL EXCEPTION: main
Process: org.mozilla.fenix.debug, PID: 30201
android.os.StrictMode$StrictModeViolation: policy=327743 violation=2
at android.os.StrictMode.executeDeathPenalty(StrictMode.java:1684)
at android.os.StrictMode.-wrap3(Unknown Source:0)
at android.os.StrictMode$AndroidBlockGuardPolicy.handleViolation(StrictMode.java:1677)
at android.os.StrictMode$AndroidBlockGuardPolicy$1.run(StrictMode.java:1555)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6938)
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)
Moved to bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1814129
Change performed by the Move to Bugzilla add-on.
Steps to reproduce
Install latest debug build from https://firefox-ci-tc.services.mozilla.com/tasks/index/mobile.v2.fenix.debug.latest/arm64-v8a
Crash:
Device information
┆Issue is synchronized with this Jira Task