topjohnwu / Magisk

The Magic Mask for Android
GNU General Public License v3.0
47.57k stars 12.08k forks source link

Systemless hosts may result in system freezes (F2FS driver bug) #3171

Closed supachris closed 3 years ago

supachris commented 4 years ago

yujincheng08 EDIT:

This should have been fixed by #6805

topjohnwu EDIT:

This is caused by an F2FS driver issue that unfortunately Magisk is unable to fix. The only way around it is to use a custom kernel with the required fix. For more technical details, please check the reply by @freak07: https://github.com/topjohnwu/Magisk/issues/3171#issuecomment-729814931

Original message:

Using current canary (MM299, Magisk 20425) enabling the systemless hosts feature results in freezing all of the system. Can only hard rebooted. Without hosts it works good so far.

zgfg commented 4 years ago

Does it freeze just by enabling Systemless hosts (without running AdAway) or only with AdAway 4.3.6?

Have you tried with AdAway 5.0.8 (Pixels, Android 11, Systemless hosts, AdAway 5.0.8 in the root/hosts mode) -they say, no freezing: https://forum.xda-developers.com/showpost.php?p=83479113&postcount=15336 https://forum.xda-developers.com/showpost.php?p=83479349&postcount=15338 https://forum.xda-developers.com/showpost.php?p=83478761&postcount=41431

supachris commented 4 years ago

Tried it but does not work. Even with completely uninstalled any AdAway version the system freezes after enabling systemless hosts and reboot.

SgtSeppel commented 4 years ago

I might have the same problem here:

  1. Activate systemless hosts in Magisk Manager (canary)
  2. reboot system
  3. System freezes at PIN entry or shortly after
  4. force reboot of the system
  5. check Magisk Manager: Systemless hosts still activated
  6. reboot system
  7. system boots fine, no freeze
  8. Go to MM, uncheck systemless hosts, re-check systemless hosts
  9. Reboot system
  10. GOTO 3.

This is reproducable on my device (Pixel 3 XL) I'll try to capture some logs during boot if possible to see what freezes.

scottismyname commented 4 years ago

I was having freezing problems too but was able to resolve those by removing a large source in adaway (5.0.9). I'm thinking for me, it is some sort of space issue

WimVDK commented 4 years ago

i'm having freezes too. Even caused me to be an hour late at work this morning. Currently disabled the systemless module and rebooted. Module on my pixel 3XL stays deactivated though.

scottismyname commented 4 years ago

Ok disabling a host seems to have fixed it for a while, but now my system is back to freezing again. Had to disable the systemless hosts module in order for it to work again.

WimVDK commented 4 years ago

i didn't disable any hosts specifically. Straight up disabled the module. Haven't had a freeze since. So there's definitely a problem with the module. No idea what, or how to grab logs, or when or which ones.

scottismyname commented 4 years ago

Same for me. Disabling the module and running AdAway in "VPN" mode seems to be working fine.

I am free to get logs if I knew how to do it. It is very reproducible for me on my Pixel 3a XL. Does not seem to happen for my wife on her Pixel 3 though. Very very strange.

MichaelSMVogel commented 4 years ago

Joined GitHub to add to this. Pixel 3a, official update, Magisk canary works just fine UNTIL I enable systemless hosts. Then it bootloops until I adb remove modules. Then all is well again.

djuniah commented 4 years ago

Pixel 3 here, seeing the same issue. Sometimes I can get in and use it for a few minutes/hours but other times it just locks up at or before the login screen. Earlier on in the 11 betas this would happen as well but it would be much less frequent (once every few days)

scottismyname commented 4 years ago

I completely restored the stock boot.im, uninstalled adaway and reloaded root, then reloaded adaway (5.0.9). It's been solid for 2 days now, but I fully expect it to take a crap again. I have logcats turned on for the first 30 seconds after a reboot, so if it happens again, hopefully a logcat will help narrow down the problem. Can't get one unless it happens though.

WimVDK commented 4 years ago

I'm going adaway-less for the moment. I'm waiting on a new magisk build as the current one (even the latest canary) prevents my boldbeast call recorder from working (root options simply fail to enable) this commit should fix that.

dnsmo commented 4 years ago

I am too having this problem with latest canary build, without enabling systemless host, everything is fine, but once I enable it which will make adaway work then it will freeze on me, sometime right after the first unlock of screen and sometime wait til you try to open an app.

shawnngtq commented 4 years ago

I am using pixel 3, android 11, Magisk Manager v7.5.1

I tried setting up magisk using steps from https://android.gadgethacks.com/how-to/root-android-11-pixel-4a-every-step-covered-detail-0333038/

I was able to everything till step 16. (I downloaded factory image for pixel 3 at https://developers.google.com/android/images#blueline)

After I flash the patched boot image via ./fastboot flash boot magisk_patched.img and ./fastboot reboot. The phone is rebooted. And then it's stuck at the loading page with G logo and loading bar.

I tried rebooting after waiting for a long time, but it don't work, I have no choice but to factory reset my phone.

@supachris @zgfg any idea why? Thanks!

djechelon commented 4 years ago

@shawnngtq other than factory resetting (and losing your data) you may want first to reflash stock boot image. It works a large number of times and you lose Magisk as expected

WimVDK commented 4 years ago

I am using pixel 3, android 11, Magisk Manager v7.5.1

I tried setting up magisk using steps from https://android.gadgethacks.com/how-to/root-android-11-pixel-4a-every-step-covered-detail-0333038/

I was able to everything till step 16. (I downloaded factory image for pixel 3 at https://developers.google.com/android/images#blueline)

After I flash the patched boot image via ./fastboot flash boot magisk_patched.img and ./fastboot reboot. The phone is rebooted. And then it's stuck at the loading page with G logo and loading bar.

I tried rebooting after waiting for a long time, but it don't work, I have no choice but to factory reset my phone.

@supachris @zgfg any idea why? Thanks!

You need to use the latest canary, set the update channel to canary and then patch the bootloader or do an inplace upgrade or apply the standard OTA procedure. Non-canary magisk does NOT work with A11

mando41 commented 4 years ago

I'm having the same freeze issues when enabling the systemless host module. For now it's disabled and I am AdAwayless. Hope there is a fix soon.

shawnngtq commented 4 years ago

@djechelon I can't do that as my phone is stuck on loading, so have no choice but to factory reset

@WimVDK thanks.

I followed your advice. For further reference, to download Magisk Canary, download: https://github.com/topjohnwu/magisk_files/blob/canary/app-debug.apk

MichaelSMVogel commented 4 years ago

connect your phone to your computer (while bootlooping or stuck on loading) open a command window where you have the platform tools run the command: adb wait-for-device shell magisk --remove-modules hold your power button until the phone restarts, run the command again while the phone powers up it will restart itself and if you're lucky it will boot properly this time

DoganM95 commented 4 years ago

@djechelon I can't do that as my phone is stuck on loading, so have no choice but to factory reset

@WimVDK thanks.

I followed your advice. For further reference, to download Magisk Canary, download: https://github.com/topjohnwu/magisk_files/blob/canary/app-debug.apk

Yes, you have. DON'T FACTORY RESET. just get a factory image from here: https://developers.google.com/android/images#blueline

unpack the zip, edit the flash-all.bat file and remove the -w flag somewhere at the end where it says fastboot update to prevent a wipe. after that, your phone should be working fine with having no magisk installed.

WimVDK commented 4 years ago

You don't even need to flash the entire factory image. Just flashing the boot image would restore functionality. The point is magisk 20.4 is NOT compatible with A11. You need the latest canary and set the update channel to canary

gtdRR commented 4 years ago

I enabled AdAway hosts along with a bunch of other things and didn't experience a freeze till later in the day when there was a Google Assistant notification. I would hard reset but it would freeze after 30sec of use over and over and over.

That notification had me thinking their was an issue with Google. So before the 30 second freeze, I rushed to clear my Google App data/cache and the freezing stopped. Didn't touch AdAway or Systemless hosts, ads are still blocked and the freezing has stopped.

Not sure how any of this is related but thought I would share.

Pixel 3 XL Android 11 AdAway 4.3.6

Taewan-P commented 4 years ago

Currently Using Pixel 3 XL, Android 11, MM301, Magisk 20427 with enabled systemless hosts feature. There is no freezing at all. Try using this version. (Latest canary at this writing point)

MichaelSMVogel commented 4 years ago

tried that right now. system freezes just after login - completely unusable.

Taewan-P commented 4 years ago

Very strange... Do you have a logcat when the system freezes? It is easier to detect what is wrong with the device.

MichaelSMVogel commented 4 years ago

i will try. run adb > logcat... on the pc and boot connected?

Taewan-P commented 4 years ago

I just tested out, and I think you should at least log in once when you run logcat right after reboot.

MichaelSMVogel commented 4 years ago

with_magisk.log without_root.log

scottismyname commented 4 years ago

I enabled AdAway hosts along with a bunch of other things and didn't experience a freeze till later in the day when there was a Google Assistant notification. I would hard reset but it would freeze after 30sec of use over and over and over.

That notification had me thinking their was an issue with Google. So before the 30 second freeze, I rushed to clear my Google App data/cache and the freezing stopped. Didn't touch AdAway or Systemless hosts, ads are still blocked and the freezing has stopped.

Not sure how any of this is related but thought I would share.

Pixel 3 XL Android 11 AdAway 4.3.6

Very interesting, did you manage to get logs during any of these freezes? I haven't experienced a freeze during startup, but my phone has froze randomly in the middle of the night the last 2 nights. After a hard restart, it's been fine again.

I still think it's some sort of storage space issue, but I can't reproduce the problem. If we could reproduce the problem, getting a logcat of the bootup would be great.

MichaelSMVogel commented 4 years ago

modified clean boot.img with mm301 to magisk canary 20427, flashed and did a logcat on boot as well as another one after login. phone is completely unusable. flashing clean boot.img now

First_Magisk_boot.log First_Magisk_boot_continued.log

MichaelSMVogel commented 4 years ago

all is well without magisk :-(

clean_boot_again.log

MichaelSMVogel commented 4 years ago

flashed with magisk, adb remove module, flash ex kernel and I am back in business with root and gpay but without systemless hosts

Kameleau commented 4 years ago

I had the same problem with my Pixel 3 XL. Phone would work ok but after random time (from couples hours in the beginning to couples of minutes after 2 Days after installing Android 11) it would begin to freeze and I would need to hard reset it. Then it would work again for a random time. Sometime phone would not want to wake up from sleep (even missed a Alarm..)

I have done what was previously mentionned here to disable and delete systemless host and delete Adaway and I have no more problem. I didnt have to reflash boot.img

Android 11, Magisk 20427, Adaway 4.3.6

MichaelSMVogel commented 4 years ago

the plot thickens. not willing to live without adaway I blew away my old system and did a clean flash. Installed mm 301 & Magisk 20427. I could enable systemless hosts and install adaway and it worked. I had one random reboot which may or may not be related but I had no freezing and the phone behaved as it should. Then, assuming I had solved the problem, I installed Advanced Charging Controller and the camera px magisk modules. A reboot led to the system freezing symptoms as before. removing all the modules at restart fixed the phone, ONLY installing systemless hosts freezes it up again. So it isn't what caused it initially but is triggering it subsequently even without the cause present.

savagencollc commented 4 years ago

Why u hacking me

Get Outlook for Androidhttps://aka.ms/ghei36


From: MichaelSMVogel notifications@github.com Sent: Thursday, October 1, 2020 7:14:23 AM To: topjohnwu/Magisk Magisk@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: Re: [topjohnwu/Magisk] Freezes at Android 11 on Pixel 3 with systemless hosts (#3171)

the plot thickens. not willing to live without adaway I blew away my old system and did a clean flash. Installed mm 301 & Magisk 20427. I could enable systemless hosts and install adaway and it worked. I had one random reboot which may or may not be related but I had no freezing and the phone behaved as it should. Then, assuming I had solved the problem, I installed Advanced Charging Controller and the camera px magisk modules. A reboot led to the system freezing symptoms as before. removing all the modules at restart fixed the phone, ONLY installing systemless hosts freezes it up again. So it isn't what caused it initially but is triggering it subsequently even without the cause present.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftopjohnwu%2FMagisk%2Fissues%2F3171%23issuecomment-702125291&data=02%7C01%7C%7Cfeaca1f28505498a4ee708d8660bea8d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637371548641593880&sdata=KU0Si0gr3skmDA8dlWJZpp1x6imkbK0xEAGUgWWhp0U%3D&reserved=0, or unsubscribehttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAQIIXQZNSYOXWN2SXNZOUP3SIR6C7ANCNFSM4RIG75WQ&data=02%7C01%7C%7Cfeaca1f28505498a4ee708d8660bea8d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637371548641603873&sdata=8Ahs2Q9Qr6LNn2yKC0oquCgWt7iL4WWxuFbpuGzopkw%3D&reserved=0.

WimVDK commented 4 years ago

hacking? What on earth are you talking about?

scottismyname commented 4 years ago

the plot thickens. not willing to live without adaway I blew away my old system and did a clean flash. Installed mm 301 & Magisk 20427. I could enable systemless hosts and install adaway and it worked. I had one random reboot which may or may not be related but I had no freezing and the phone behaved as it should. Then, assuming I had solved the problem, I installed Advanced Charging Controller and the camera px magisk modules. A reboot led to the system freezing symptoms as before. removing all the modules at restart fixed the phone, ONLY installing systemless hosts freezes it up again. So it isn't what caused it initially but is triggering it subsequently even without the cause present.

This is the same exact thing that happens for me. Reflashing stock boot img and re-rooting it seems to fix it for some time. After some random amount of time (for me it's been 3-4 days), it will freeze. And then rebooting it won't work (freezes almost immediately at startup) until I manage to remove systemless hosts or reflash stock.

djuniah commented 4 years ago

Just to confirm, I have never installed any other modules in magisk, only enabled systemless hosts, and the issue was present for me. I don't believe that it was some other module causing it, and systemless hosts persisting it. Sometimes it takes a day or two to happen, sometimes it's right at boot. I usually have to reboot the phone 3-4 times after it happens before i can get it going again. I had the same experience as someone else where it happened overnight and caused my alarm not to trigger, so i have removed magisk for now and everything is working fine. Anecdotally, my battery life seems to be improved as well, but that could honestly be any number of factors.

Has anyone tried enabling systemless hosts without actually adding an ad-block into it? I wonder if it has to do with the block lists getting too large.

MichaelSMVogel commented 4 years ago

yes, my system freezes when systemless hosts gets enabled. with or without adblock installed.

RJMoise commented 4 years ago

I have the systemless host module enabled on my Pixel 3a XL and am having no issues at all. Clean installed 11, rooted with Magisk Canary (20427) and running adaway 5.0.9.

This doesn't really add anything to the conversation other than the problem does not seem to effect everyone.

supachris commented 4 years ago

Systemless hosts ist still broken with MM 303 and Magisk 21001. After reboot, even without installed any Adblocker, the system freezes up. Pixel 3 with OTA updated to 11.

ecralev commented 4 years ago

I have the same issue on my Pixel 3 XL. I think mine only manifests itself if systemless is enabled as well as "MagiskHide". I can enable systemless but if MagiskHide is off then I don't have any freezing but SafetyNet fails. Once both are enabled and I reboot it starts to consistently freeze within the first few seconds after each reboot. One time after rebooting and just before a freeze I got a message saying "Google Services Framework keeps stopping". I also noticed that if I open the app tray just before it freezes, most of the app icons don't load.

Don't think it's related to AdAway as it freezes without AdAway being installed.

So in summary:

MagiskHide on, systemless on - freezing MagiskHide off, systemless on - no freezing MagiskHide on systemless off - no freezing

undertow25 commented 4 years ago

This is the same exact thing that happens for me. Reflashing stock boot img and re-rooting it seems to fix it for some time. After some random amount of time (for me it's been 3-4 days), it will freeze. And then rebooting it won't work (freezes almost immediately at startup) until I manage to remove systemless hosts or reflash stock.

As someone who didn't figure out that systemless hosts is the issue, I can tell you that hard rebooting enough times will eventually work. Well, for a few hours at least xD

Also, losing AdAway is better than losing AdAway, Viper and the right side clock ;-)

djechelon commented 4 years ago

@undertow25 you don't lose AdAway. You can switch it to VPN mode, and it works. It doesn't rock, but it works at least

undertow25 commented 4 years ago

@undertow25 you don't lose AdAway. You can switch it to VPN mode, and it works. It doesn't rock, but it works at least

Not sure yet if that's worth it for me. Browser is the main source of ad issues anyway so I just switched to Bromite, the built-in adblock is ok so far. Good to have other options though 👍

Count23r0 commented 3 years ago

I probably found the reason and of course a solution (not sure since it’s only a couple of hours ago). In my case the platform-tools I was using where to old. I had serious problems updating to October release, so I took the latest platform-tools and also activated systemless hosts again without any issues so far. I'll give an update if the freezes occur again.

WimVDK commented 3 years ago

Platform tools shouldn't have any impact. That's only used to connect to the device and flash stuff. It has zero impact on stuff already on it (such as systemless hosts)

Count23r0 commented 3 years ago

It has an impact on the flashing process. I was unable to get latest update running. No errors while flashing but after the update my phone was soft bricked (no valid slot to boot). Using latest platform tools everything is fine and also no issues using systemless hosts. IF the solution is that easy, I would give it a try ;)

supachris commented 3 years ago

I was using the latest platform tools but systemless hosts does not work. Which hardware do you have? It seems only be related to some devices.

Count23r0 commented 3 years ago

Pixel 3 hardware version MP1.0 and I had the same issues getting worse over time (from 1-2 freezes a week to 1-3 freezes per day) Are you already on October update? In my case the freezes occures on September update for the first time.