[Magisk] jdavis45:
Magisk 15.3 can't remember/edit SU for apps on OmniRom 8.1 for OnePlus 3T

This has been reported a while ago and there's been no update to my knowledge but Magisk Manager loves to crash on OmniRom 8.1.0 (any version up to current 20180122-oneplus3-weekly). Every time you open an app that needs SU access, you get multiple prompts and sometimes crashes or failures to get root. Furthermore, you can't edit anything in Manager in the Superuser tab without a crash.

Here was the first report TMK: https://xdaforums.com/apps/magisk/mod-magisk-v1-universal-systemless-t3432382/post75035807#post75035807

And another: https://xdaforums.com/apps/magisk/mod-magisk-v1-universal-systemless-t3432382/post75091530#post75091530

The issue seems to be that Magisk can't write to the SQLite Database to store this request as approved forever and some have suggested that it's F2FS related. It also only effects Magisk 15.x as users report success on 14.x. Here's a short example of it crashing trying to use the Manager app.

--------- beginning of crash

01-23 19:25:09.658 E/AndroidRuntime(5508): FATAL EXCEPTION: main

01-23 19:25:09.658 E/AndroidRuntime(5508): Process: com.topjohnwu.magisk, PID: 5508

01-23 19:25:09.658 E/AndroidRuntime(5508): android.database.sqlite.SQLiteDiskIOException: disk I/O error (code 7434)

01-23 19:25:09.658 E/AndroidRuntime(5508):	at android.database.sqlite.SQLiteConnection.nativeExecuteForChangedRowCount(Native Method)

01-23 19:25:09.658 E/AndroidRuntime(5508):	at android.database.sqlite.SQLiteConnection.executeForChangedRowCount(SQLiteConnection.java:735)

01-23 19:25:09.658 E/AndroidRuntime(5508):	at android.database.sqlite.SQLiteSession.executeForChangedRowCount(SQLiteSession.java:754)

01-23 19:25:09.658 E/AndroidRuntime(5508):	at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:64)

01-23 19:25:09.658 E/AndroidRuntime(5508):	at android.database.sqlite.SQLiteDatabase.delete(SQLiteDatabase.java:1576)

01-23 19:25:09.658 E/AndroidRuntime(5508):	at com.topjohnwu.magisk.database.SuDatabaseHelper.deletePolicy(Unknown Source:21)

01-23 19:25:09.658 E/AndroidRuntime(5508):	at com.topjohnwu.magisk.database.SuDatabaseHelper.deletePolicy(Unknown Source:2)

01-23 19:25:09.658 E/AndroidRuntime(5508):	at com.topjohnwu.magisk.adapters.PolicyAdapter.lambda$null$4$PolicyAdapter(Unknown Source:48)

01-23 19:25:09.658 E/AndroidRuntime(5508):	at com.topjohnwu.magisk.adapters.PolicyAdapter$$Lambda$5.onClick(Unknown Source:12)

01-23 19:25:09.658 E/AndroidRuntime(5508):	at com.topjohnwu.magisk.components.AlertDialogBuilder.lambda$setPositiveButton$0$AlertDialogBuilder(Unknown Source:9)

01-23 19:25:09.658 E/AndroidRuntime(5508):	at com.topjohnwu.magisk.components.AlertDialogBuilder$$Lambda$0.onClick(Unknown Source:2)

01-23 19:25:09.658 E/AndroidRuntime(5508):	at android.view.View.performClick(View.java:6294)

01-23 19:25:09.658 E/AndroidRuntime(5508):	at android.view.View$PerformClick.run(View.java:24774)

01-23 19:25:09.658 E/AndroidRuntime(5508):	at android.os.Handler.handleCallback(Handler.java:790)

01-23 19:25:09.658 E/AndroidRuntime(5508):	at android.os.Handler.dispatchMessage(Handler.java:99)

01-23 19:25:09.658 E/AndroidRuntime(5508):	at android.os.Looper.loop(Looper.java:164)

01-23 19:25:09.658 E/AndroidRuntime(5508):	at android.app.ActivityThread.main(ActivityThread.java:6494)

01-23 19:25:09.658 E/AndroidRuntime(5508):	at java.lang.reflect.Method.invoke(Native Method)

01-23 19:25:09.658 E/AndroidRuntime(5508):	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)

01-23 19:25:09.658 E/AndroidRuntime(5508):	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

01-23 19:25:09.664 W/ActivityManager(975): Force finishing activity com.topjohnwu.magisk/.MainActivity

01-23 19:25:09.695 I/ActivityManager(975): Showing crash dialog for package com.topjohnwu.magisk u0

01-23 19:25:09.976 W/Looper (975): Dispatch took 171ms on android.ui, h=Handler (android.view.Choreographer$FrameHandler) {218d578} cb=android.view.Choreographer$FrameDisplayEventReceiver@86da451 msg=0

01-23 19:25:10.166 W/ActivityManager(975): Activity pause timeout for ActivityRecord{5398a1c u0 com.topjohnwu.magisk/.MainActivity t1183 f}

01-23 19:25:10.593 I/ActivityManager(975): Killing 4746:com.google.android.youtube/u0a93 (adj 906): empty #17

01-23 19:25:10.963 I/ActivityManager(975): Killing 5508:com.topjohnwu.magisk/u0a211 (adj 900): crash

01-23 19:25:11.022 I/ActivityManager(975): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10300000 cmp=com.topjohnwu.magisk/.SplashActivity (has extras)} from uid 10211

01-23 19:25:11.035 E/ActivityManager(975): applyOptionsLocked: Unknown animationType=0

01-23 19:25:11.049 D/ConnectivityService(975): ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ LISTEN id=15, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&FOREGROUND] ], android.os.BinderProxy@dba4da2)

01-23 19:25:11.063 I/ActivityManager(975): Start proc 6078:com.topjohnwu.magisk/u0a211 for activity com.topjohnwu.magisk/.SplashActivity

01-23 19:25:11.066 W/ActivityManager(975): setHasOverlayUi called on unknown pid: 5508

01-23 19:25:11.165 W/AppOps (975): Finishing op nesting under-run: uid 1000 pkg android code 24 time=0 duration=0 nesting=0

01-23 19:25:11.191 W/FileUtils(6078): Failed to chmod(/data/user_de/0/com.topjohnwu.magisk/databases/su.db): android.system.ErrnoException: chmod failed: EPERM (Operation not permitted)

01-23 19:25:11.240 E/ActivityThread(5836): Failed to find provider info for com.facebook.katana.provider.AttributionIdProvider

01-23 19:25:11.795 W/FileUtils(6078): Failed to chmod(/data/user_de/0/com.topjohnwu.magisk/databases/su.db): android.system.ErrnoException: chmod failed: EPERM (Operation not permitted)

01-23 19:25:11.884 I/ActivityManager(975): START u0 {cmp=com.topjohnwu.magisk/.MainActivity (has extras)} from uid 10211

More logs are attached. Given this only happens on 15.x, something has changed that it causes a DiskIO error when F2FS is used.

EDIT: Yes, I'm aware of the F2FS bug but even patched kernels are having issues in some cases on Oreo. This is a Magisk side issue. Also, the loopback mod doesn't resolve this either.