Magisk: Manager crash trying to access Modules list with specific numbers of directories

Created on 31 Mar 2020  路  37Comments  路  Source: topjohnwu/Magisk

The title of this report should suffice, but if it doesn't I have screen capped what is happening and dumped it here.

The magisk-logs you can find here.

I am using a Samsung Galaxy S6 G920F with LineageOS 17.1 (android 10), both magisk and manager are on the latest canary builds.

If i have missed something or if you require more information/logs/corona lemme know 馃槉

regression

Most helpful comment

Thanks all. We're good for logs now. I can also reproduce it on both my Galaxy Nexus (Lineage Marshmallow) and OnePlus 5 (Pixel Experience Pie). :+1:

It's definitely that java.lang.ArrayIndexOutOfBoundsException error.

All 37 comments

A logcat of the crash using Canary Manager 282 would be helpful. Only a small number of devices seem to have this issue.

How many modules do you have?

magisk_log_20200331_120627.log
Here is a log and I have the same issue

We need a logcat not a magisk log as it doesn't contain all the necessary information for this particular crash. Make sure to note the exact time when the crash occurred and paste both it here. Thanks.

Screenshot_20200331-183219
Redmi note 6 pro
Havoc os 3.3
Android 10

I got the same problem. Pixel 4, March patch, latest canary.
logcat_03-31-2020_12-54-19.txt

here's mine. Oneplus6t Android Q 10.3.2
logcat_03-31-2020_21-49-24.txt

edit:
no crash happens when data or wifi is turned off.

logcat.txt
same here
latest canary manager 5537b083 (282) & magisk ef9d077c (20401), oneplus 7 pro, latest official havoc os 3.3 march 29 build

We need a logcat not a magisk log as it doesn't contain all the necessary information for this particular crash. Make sure to note the exact time when the crash occurred and paste both it here. Thanks.

https://drive.google.com/file/d/1AMCJurbjyvvmOLUPL10pDjIGtlM1P_yV/view?usp=drivesdk

I triggered the crash a total of three times at timestamps
01:00:22
01:00:47 and
01:01:13

I hope these logs will be useful (:

Doesn't crash when on safety mode.i managed to find out that some modules may be the cause of crashes for me. It does crash if i got app systemizer module and riru storage isolation module installed.it does still crash even if data or wifi is off for me

Thanks all. We're good for logs now. I can also reproduce it on both my Galaxy Nexus (Lineage Marshmallow) and OnePlus 5 (Pixel Experience Pie). :+1:

It's definitely that java.lang.ArrayIndexOutOfBoundsException error.

I do not know if 5537b083(282)(9) is supposed to address this or whether it's unrelated but the problem is still there, just saying 馃

If one hour ago I'm saying I reproduced the issue, then you know 282 is still effected. :roll_eyes::wink:

If one hour ago I'm saying I reproduced the issue, then you know 282 is still effected.

Touch茅 lol

Is it fixed yet or do you need a logcat from s10 plus too

Thanks all. We're good for logs now. I can also reproduce it on both my Galaxy Nexus (Lineage Marshmallow) and OnePlus 5 (Pixel Experience Pie).

It's definitely that java.lang.ArrayIndexOutOfBoundsException error.

@HTAEDFOLEGNA When it's fixed someone on the dev team will close this issue

馃槀

decided to do some more testing, removed all installed modules using mm while in TWRP, and suddenly the crashing doesn't occur anymore. I shall now one by one add the modules back and report back what I might find.

BINGO!! I have found the scoundrel that causes this issue (for me)!

It ended up being MagiskHidePropsConf which was making manager crash.
EDIT: seems I was wrong, after installing every module I was using before I am unable to replicate the crash. The crash that happened that made me BINGO seems to only have happened once.

i used mm in twrp and it just sort of fixed itself, didnt install or uninstall anything other than mm

i used mm in twrp and it just sort of fixed itself, didnt install or uninstall anything other than mm

mm does nothing (besides letting me do what it should) like that for me lol, I love mm (anything CLI in general), has been a livesaver for bootlooping modules so many times

I have one device (GN) with a bunch of modules crashing and one (OP5) with a few less also crashing, so I don't think it's directly related to that.

I noticed something that you can access the modules tab if you quickly press the button after opening Magisk manager

I noticed something that you can access the modules tab if you quickly press the button after opening Magisk manager

Weird, can confirm that on my OP5!

@diareuse, any chance that helps narrow down the cause of the java.lang.ArrayIndexOutOfBoundsException error?

Yeah it is weird but if one switches to other tab and then back it crashes 馃槄馃槄

That unfortunately doesn't help at all. I know where the issue is, what it causes, but I don't know how to fix it yet.

On my Samsung Galaxy On7 running API 23, I faced the same issue. It was working fine until I uninstalled the Energized module. After reboot, when I go to the Modules tab, the app instantly crashes.

Here is a logcat obtained using Android Studio. The crash was triggered at around 20:26:44 where you can see the ArrayIndexOutOfBoundsException.

manager_canary_logcat.txt

The following is the logcat that has been filtered using "com.topjohnwu.magisk". However, it is at a different time. Note that this one does not show the above exception, but shows that the app has died.

magisk_canary_manager_filtered_log.txt

I was able to stop the crash on my Galaxy Nexus by going from 8 modules down to 7. Reproducibly. Didn't matter which module. 馃

Edit: Also on my OP5. You can even directly delete the /data/adb/modules/* directories down to 7 modules without a reboot and reopen Manager and there won't be a crash anymore.

@topjohnwu @diareuse

The conditions to trigger the crash are having exactly 8 or 9 modules. Any device I've tried. Less than 8, or greater than 9 and it works fine. This shouldn't be too hard to fix, knowing this.

@topjohnwu @diareuse

The conditions to trigger the crash are having exactly 8 or 9 modules. Less than 8, or greater than 9 and it works fine. This shouldn't be too hard to fix, knowing this.

Really helpful, modules are working again隆馃榿

@topjohnwu @diareuse

The conditions to trigger the crash are having exactly 8 or 9 modules. Any device I've tried. Less than 8, or greater than 9 and it works fine. This shouldn't be too hard to fix, knowing this.

Well, not in my case. I have 16 modules active + 2 disabled but Manager v282 keeps crashing then trying to access module list.

Ah, there might be other "magic" numbers..

Edit: For me, I can make empty directories in /data/adb/modules/ and the crashes also exist for exactly 19 and 20 directories. So I have a hunch you miscounted and actually have 19 total.

Then I tested all the way up to 50 and it only triggers again at 41 and 42.

So, the "magic" broken numbers seem to be 7, 8, 19, 20, 41, 42 so far.

CC: @topjohnwu @diareuse

Turns out this is an old bug, originally introduced with the redesign in 270 (0dc9f5c3), reported in #2300, and fixed in 272 (1e2de1bb).

It remained fixed as recently as 279 (ef9d077c), but has been mysteriously broken again starting with 280 (be8479fd).

https://github.com/topjohnwu/magisk_files/commits/canary/app-debug.apk

So, since 280 is here on Mar 29 and 279 is at "Update build.py" on Mar 28, most likely the regression happened in one of those 3 Manager commits on Mar 29. :+1:

Edit: On further testing, there's still a "consistently inconsistent" crash in 279, also related to the modules directory count, but the "every-time" crashes were gone and started again on 280. Hopefully both can be fixed. 馃

For me the crashes don't have any pattern at all. Before I'd have to go into the module tab dozens of times before it wouldn't crash. Different amounts of time waiting on the main screen didn't change my chances of crashing.

@diareuse tracked down the underlying bug and will be pushing a fix branch/PR soon. Next Manager Canary after that should work! :+1:

@diareuse tracked down the underlying bug and will be pushing a fix branch/PR soon. Next Manager Canary after that should work! 馃憤

Just out of curiosity, where was the bug?

The thorough explanation will be posted in the commit message. Please be patient.

Canary with the fix is now out! 馃憦

Was this page helpful?
0 / 5 - 0 ratings