Open Bug 1910997 Opened 3 months ago Updated 2 months ago

StrictMode ThreadPolicy violation: org.mozilla.fenix.browser.BrowserFragment.updateLastBrowseActivity

Categories

(Fenix :: Homepage, defect)

All
Android
defect

Tracking

(Performance Impact:?)

Performance Impact ?

People

(Reporter: jonalmeida, Unassigned)

Details

Startup crash with Fenix Debug on SM-A515F with current tip at e2a8e98f367a (hg) with the last central commit from Fri Jul 26 15:08:57.

Uncaught exception handled: 
java.lang.RuntimeException: StrictMode ThreadPolicy violation
	at org.mozilla.fenix.perf.ThreadPenaltyDeathWithIgnoresListener.penaltyDeath(ThreadPenaltyDeathWithIgnoresListener.kt:46)
	at org.mozilla.fenix.perf.ThreadPenaltyDeathWithIgnoresListener.onThreadViolation(ThreadPenaltyDeathWithIgnoresListener.kt:40)
	at android.os.StrictMode$AndroidBlockGuardPolicy.lambda$onThreadPolicyViolation$1(StrictMode.java:1889)
	at android.os.StrictMode$AndroidBlockGuardPolicy$$ExternalSyntheticLambda0.run(Unknown Source:4)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
	at java.lang.Thread.run(Thread.java:1012)
Caused by: android.os.strictmode.DiskReadViolation
	at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1658)
	at libcore.io.BlockGuardOs.access(BlockGuardOs.java:74)
	at libcore.io.ForwardingOs.access(ForwardingOs.java:128)
	at android.app.ActivityThread$AndroidOs.access(ActivityThread.java:8615)
	at java.io.UnixFileSystem.checkAccess(UnixFileSystem.java:313)
	at java.io.File.exists(File.java:813)
	at android.app.SharedPreferencesImpl$EditorImpl.isSpeg(SharedPreferencesImpl.java:505)
	at android.app.SharedPreferencesImpl$EditorImpl.apply(SharedPreferencesImpl.java:517)
	at mozilla.components.support.ktx.android.content.LongPreference.setValue(SharedPreferences.kt:65)
	at mozilla.components.support.ktx.android.content.LongPreference.setValue(SharedPreferences.kt:56)
	at org.mozilla.fenix.utils.Settings.setLastBrowseActivity(Settings.kt:470)
	at org.mozilla.fenix.browser.BrowserFragment.updateLastBrowseActivity$app_fenixDebug(BrowserFragment.kt:866)
	at org.mozilla.fenix.browser.BrowserFragment.onStart(BrowserFragment.kt:711)
	at androidx.fragment.app.Fragment.performStart(Fragment.java:3187)
	at androidx.fragment.app.FragmentStateManager.start(FragmentStateManager.java:628)
	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:290)
	at androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:114)
	at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1455)
	at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3034)
	at androidx.fragment.app.FragmentManager.dispatchStart(FragmentManager.java:2959)
	at androidx.fragment.app.Fragment.performStart(Fragment.java:3196)
	at androidx.fragment.app.FragmentStateManager.start(FragmentStateManager.java:628)
	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:290)
	at androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:114)
	at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1455)
	at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3034)
	at androidx.fragment.app.FragmentManager.dispatchStart(FragmentManager.java:2959)
	at androidx.fragment.app.FragmentController.dispatchStart(FragmentController.java:274)
	at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:358)
	at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:251)
	at org.mozilla.fenix.HomeActivity.onStart(HomeActivity.kt:532)
	at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1510)
	at android.app.Activity.performStart(Activity.java:8616)
	at android.app.ActivityThread.handleStartActivity(ActivityThread.java:4204)
	at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
	at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
	at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2574)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:226)
	at android.os.Looper.loop(Looper.java:313)
	at android.app.ActivityThread.main(ActivityThread.java:8762)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)

The severity field is not set for this bug.
:rsainani, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(rsainani)

Maybe this has to do with what is mentioned in this comment

I'm setting the component as Homepage as it does occur on the first user experience even though It occurs in BrowserFragment. There are other usages of Shared prefs on main on Homepage and would be good to look at them one by one.

Severity: -- → S3
Performance Impact: --- → ?
Component: General → Homepage
Flags: needinfo?(rsainani)
You need to log in before you can comment on or make changes to this bug.