Suicide-Squirrel / issues_oreo

Issue tracker for Oreo (aoscp, LOS, RR...)
5 stars 0 forks source link

Cannot install Magisk when phone encrypted #13

Closed guillaumedc closed 5 years ago

guillaumedc commented 6 years ago

After flashing Magisk zip through TWRP, I reboot my phone but the Magisk manager still says that Magisk is not installed.

Problem is present both in AOSP 6 and LOS 15.1.

guillaumedc commented 6 years ago

In XDA thread, someone told that it could be related to https://github.com/Suicide-Squirrel/issues_oreo/issues/4

steadfasterX commented 6 years ago

no its not related to issue 4. after installing magisk: get & share the TWRP logfile (FAQ#4 A)

guillaumedc commented 6 years ago

Recovery log Dmesg log

ThePiGuy0 commented 6 years ago

Well...it looks like Magisk installs correctly (from the recovery log). So I guess it's an issue with connecting the magisk install with the app. @steadfasterX knows more about this than me though

steadfasterX commented 6 years ago

Thx for the logs. Looks good so far..

As I don't use magisk: is 16.4 required? I saw the latest stable version is 16.0. Have you tried 16.0.too?

guillaumedc commented 6 years ago

XDA thread redirect to Github to download Magisk and Magisk manager. Magisk latest release is 16.4: releases Magisk latest release is 5.7.0: releases

steadfasterX commented 6 years ago

Nope.. Latest stable is 16.0 https://forum.xda-developers.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445 Click on latest magisk in the OP and you will get 16.0 like stated in the thread title too. The latest releases you are referring to (github) are just the latest ones not the latest stable.

Please try with 16.0 and get the recovery log again

steadfasterX commented 6 years ago

Any update on this @guillaumedc ? Do you have tried 16.0?

steadfasterX commented 6 years ago

https://github.com/topjohnwu/Magisk/blob/master/docs/details.md#magisk-booting-process

guillaumedc commented 6 years ago

What does it mean? Is a fix possible? @steadfasterX

steadfasterX commented 5 years ago

anyone tried the latest STABLE (!) magisk version?

guillaumedc commented 5 years ago

I did (version 18.0). Encrypting went well but it removed Magisk

EDIT: even if I flash Magisk zip again, Magisk manager tells me it is not installed.

steadfasterX commented 5 years ago

ok finally had the time to test this, too.

Run 1:

Run 2:

Run 3:

So I thought it might be an issue with Magisk patching the ramdisk which requires to boot again to TWRP . I went on with:

Run 4:

ok well it was a dirty flash so I went on:

Ok simply trial & error doesn't help here it seems. I will switch to debug the logs instead.

I noticed that it's possible in the Manager to refresh by swiping down.. when Magisk is installed successfully (according to the Manager) the refresh is fine. when Magisk is not installed successfully the refresh hang. ok a quick adb logcat flooded me with magisk errors, crashes and tombstones. Well here is something really wrong. yea the latest LOS has selinux enabled (I saw related avc denies as well) so.. without looking further it could be related.. maybe..

Run 5:

while still encrypted:

Run 6:

ok it might be related to the flashing process itself. I found a random answer who stated that patching the boot image from within the magisk manager could fix this.

So i have to debug deeper instead of just trial and error.

for reference:

recovery.log

steadfasterX commented 5 years ago

debugging magisk

Run 7:

01-03 04:16:02.663 25906 25906 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdTombstone 01-03 04:16:02.663 10045 10045 I /system/bin/tombstoned: received crash request for pid 25903 01-03 04:16:02.664 25906 25906 I crash_dump32: performing dump of process 25903 (target tid = 25903) 01-03 04:16:02.664 25906 25906 F DEBUG : 01-03 04:16:02.665 25906 25906 F DEBUG : LineageOS Version: '15.1-20181213-UNOFFICIAL-h815' 01-03 04:16:02.665 25906 25906 F DEBUG : Build fingerprint: 'lge/p1_global_com/p1:6.0/MRA58K/152940055675e:user/release-keys' 01-03 04:16:02.665 25906 25906 F DEBUG : Revision: '11' 01-03 04:16:02.665 25906 25906 F DEBUG : ABI: 'arm' 01-03 04:16:02.665 25906 25906 F DEBUG : pid: 25903, tid: 25903, name: magisk >>> magisklogd <<< 01-03 04:16:02.665 25906 25906 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x30 01-03 04:16:02.665 25906 25906 F DEBUG : Cause: null pointer dereference 01-03 04:16:02.665 25906 25906 F DEBUG : r0 eea0192c r1 00001000 r2 00000000 r3 00000000 01-03 04:16:02.665 25906 25906 F DEBUG : r4 0000652a r5 ab23f000 r6 00001000 r7 eea02950 01-03 04:16:02.665 25906 25906 F DEBUG : r8 eea0192c r9 00000000 sl ab23f000 fp ab23f000 01-03 04:16:02.665 25906 25906 F DEBUG : ip ab23ee6c sp eea01908 lr ab22b241 pc ef149116 cpsr 200e0030 01-03 04:16:02.668 25906 25906 F DEBUG : 01-03 04:16:02.668 25906 25906 F DEBUG : backtrace: 01-03 04:16:02.668 25906 25906 F DEBUG : #00 pc 00044116 /system/lib/libc.so (fgets+15) 01-03 04:16:02.668 25906 25906 F DEBUG : #01 pc 0000423d /sbin/magisk (deleted) 01-03 04:16:02.668 25906 25906 F DEBUG : #02 pc 00047f0f /system/lib/libc.so (__pthread_start(void*)+22) 01-03 04:16:02.668 25906 25906 F DEBUG : #03 pc 0001af99 /system/lib/libc.so (__start_thread+32) 01-03 04:16:02.689 10756 14213 W NativeCrashListener: Couldn't find ProcessRecord for pid 25903 01-03 04:16:02.690 10045 10045 W /system/bin/tombstoned: crash socket received short read of length 0 (expected 12)

so it seems that magisk died due to an issue with magisklogd.. a quick google search pointed me to: a magisk mgr commit introduced in the manager 6.0.1. so.. lets try 6.0.0 instead:

the log has not changed though:

01-03 04:28:03.850 22039 22039 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdTombstone 01-03 04:28:03.850 9891 9891 I /system/bin/tombstoned: received crash request for pid 22017 01-03 04:28:03.851 22039 22039 I crash_dump32: performing dump of process 22017 (target tid = 22017) 01-03 04:28:03.852 22039 22039 F DEBUG : 01-03 04:28:03.852 22039 22039 F DEBUG : LineageOS Version: '15.1-20181213-UNOFFICIAL-h815' 01-03 04:28:03.852 22039 22039 F DEBUG : Build fingerprint: 'lge/p1_global_com/p1:6.0/MRA58K/152940055675e:user/release-keys' 01-03 04:28:03.852 22039 22039 F DEBUG : Revision: '11' 01-03 04:28:03.852 22039 22039 F DEBUG : ABI: 'arm' 01-03 04:28:03.852 22039 22039 F DEBUG : pid: 22017, tid: 22017, name: magisk >>> magisklogd <<< 01-03 04:28:03.852 22039 22039 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x30 01-03 04:28:03.852 22039 22039 F DEBUG : Cause: null pointer dereference 01-03 04:28:03.852 22039 22039 F DEBUG : r0 f070192c r1 00001000 r2 00000000 r3 00000000 01-03 04:28:03.852 22039 22039 F DEBUG : r4 000055fc r5 aacff000 r6 00001000 r7 f0702950 01-03 04:28:03.852 22039 22039 F DEBUG : r8 f070192c r9 00000000 sl aacff000 fp aacff000 01-03 04:28:03.852 22039 22039 F DEBUG : ip aacfee6c sp f0701908 lr aaceb241 pc f13cd116 cpsr 200e0030 01-03 04:28:03.855 22039 22039 F DEBUG : 01-03 04:28:03.855 22039 22039 F DEBUG : backtrace: 01-03 04:28:03.855 22039 22039 F DEBUG : #00 pc 00044116 /system/lib/libc.so (fgets+15) 01-03 04:28:03.855 22039 22039 F DEBUG : #01 pc 0000423d /sbin/magisk (deleted) 01-03 04:28:03.855 22039 22039 F DEBUG : #02 pc 00047f0f /system/lib/libc.so (__pthread_start(void*)+22) 01-03 04:28:03.855 22039 22039 F DEBUG : #03 pc 0001af99 /system/lib/libc.so (__start_thread+32) 01-03 04:28:03.872 10695 13932 W NativeCrashListener: Couldn't find ProcessRecord for pid 22017

Run 8:

(more or less identical to Run 2 (see above post) but without encrypting)

Interesting part here is that it needed another reboot to let the Manager actually detect the install.. !?!

Run 9:

No idea why but all this points to an issue with Magisk and not with the ROM(s).

Conclusion

File a bug report at the Magisk thread as I am not a magisk dev and that's needed to debug deeper and finding the root cause for this.

Feel free to point to this issue here but I cannot do anything else and it seems to be not related to Oreo or one of your custom ROMs itself. If it ever points out to be a ROM issue we can re-open this at any time, of course.