Closed alvinhochun closed 4 years ago
Quick guess: missing TMPFS_MNT(product)
? https://github.com/topjohnwu/Magisk/blob/72edbfc4559161df2c3edad846c51b797401177d/native/jni/magiskhide/hide_policy.cpp#L70
This seems like a reasonable guess.
I just updated to the December security patch so I was able to test this and after checking top
I was experiencing 100% CPU usage from gms (however I didn't feel any lagging or anything) @paphonb asked me to disable magisk hide and check afterwards and sure enough cpu usage went back to normal.
So if anyone else can test, just disable magisk hide so we can be sure it's a hide issue with the /product partition.
I just updated to the December security patch so I was able to test this and after checking
top
I was experiencing 100% CPU usage from gms (however I didn't feel any lagging or anything) @paphonb asked me to disable magisk hide and check afterwards and sure enough cpu usage went back to normal.
I'll assume my fix has the same effect for now. If anyone suspect this fix doesn't really fix the CPU usage issue with QuickSwitch I guess we can discuss it back in skittles9823/QuickSwitch#7.
Not resolved in latest canary even though it's supposed to be Gservices still broken when quickswitch is enabled with exact same logs
Can confirm.
gms hidden still causes cpu usage to max out.
@alvinhochun should reopen then.
Not resolved in latest canary even though it's supposed to be Gservices still broken when quickswitch is enabled with exact same logs
Same logs as in Failed to open APK '/product/overlay/NavigationBarModeGestural/****************.apk' I/O error
? I do not see these log items on latest canary. Are you able to install/update apps from Play Store? If you can that means it's not the same issue.
gms hidden still causes cpu usage to max out.
I did mention in https://github.com/skittles9823/QuickSwitch/issues/7#issuecomment-559989110 that gms still occasionally comes out to eat CPU cycles even with the fix, and I haven't yet figured out why it happens.
Easiest way to check is to execute magiskhide exec echo
and if it says that it unmounted /product/overlay
properly instead of the subdirectories inside, then chances are that the bug referred to in this issue has been fixed and what you're seeing is due to other things somewhere else.
@alvinhochun should reopen then.
Only @topjohnwu can reopen this issue. But when I created this issue I was very specific on addressing one thing that is MagiskHide's unmounting behaviour regarding /product/overlay
. If @topjohnwu thinks this issue should be adapted to include the follow-up on gms's behaviour, then please do reopen this. Otherwise, I think we should continue the discussion in skittles9823/QuickSwitch#7.
@alvinhochun when I said exactly same issue I meant exactly the same. Not able to use Google sign-in, nor install nor update apps
And no it doesn't mention anything about unmounted /product/overlay, and magiskhide exec ls -l /product/overlay
still lists the relevant overlays that should be hidden
Temporary workaround is to not hide com.google.android.gms and com.google.android.gms:persistent but this is nonetheless undesired behavior, especially if one wants to use Google pay as I can't use it without hiding both those
@alexa-v2
Can you grab some logs (logcat and Magisk) and attach them here? Also include the output of you running the command magiskhide exec ls -R /product/overlay
in a root shell.
So if I'm reading this issue correctly it's actually a regression - not only is the issue still present but now it's not hiding the files correctly
@alexa-v2 Can you grab some logs (logcat and Magisk) and attach them here? Also include the output of you running the command
magiskhide exec ls -R /product/overlay
in a root shell.
I'd have to reset my quickswitch module - I've modded it to use /vendor/overlay instead but nonetheless I can
It would appear it is actually hiding the quickswitch overlay it just never says it unmounted /product/overlay
Otherwise exactly same issues as before
@alexa-v2 Seems to me yours is a different issue (different cause), but shows a similar symptom. The biggest difference at first glance is that your device does not have a separate /product
partition, i.e. /product
is a symlink to /system/product
, and thus MagiskHide unmounts /system/product/overlay
instead of /product/overlay
. This makes me think that this issue should not have affected you in the first place.
In fact your logcat log doesn't even mention /product/overlay
except one line from Magisk where MagiskHide unmounts /system/product/overlay
.
I see these logcat entries that resembles the ones I had:
12-06 08:19:02.796 W/ziparchive(3106): Unable to open '/system/app/_android.PitchBlack.A07PitchBlackLimeTranslucentSystemUIOFFAndroid10.Android10.apk': No such file or directory
12-06 08:19:02.796 E/.gms.persisten(3106): Failed to open APK '/system/app/_android.PitchBlack.A07PitchBlackLimeTranslucentSystemUIOFFAndroid10.Android10.apk' I/O error
12-06 08:19:02.796 W/ResourcesManager(3106): failed to add overlay path /system/app/_android.PitchBlack.A07PitchBlackLimeTranslucentSystemUIOFFAndroid10.Android10.apk
12-06 08:19:02.796 W/ziparchive(3106): Unable to open '/system/app/_android.SwiftBlack.Lime.PixelandAOSP.apk': No such file or directory
12-06 08:19:02.796 E/.gms.persisten(3106): Failed to open APK '/system/app/_android.SwiftBlack.Lime.PixelandAOSP.apk' I/O error
12-06 08:19:02.799 W/ResourcesManager(3106): failed to add overlay path /system/app/_android.SwiftBlack.Lime.PixelandAOSP.apk
12-06 08:19:02.800 W/ziparchive(3106): Unable to open '/system/app/_android.FlowdorV2.LimeA200HeaderStatusBarSizePanelExpandRoundnessOvalAGradientTypeRadial.apk': No such file or directory
12-06 08:19:02.800 E/.gms.persisten(3106): Failed to open APK '/system/app/_android.FlowdorV2.LimeA200HeaderStatusBarSizePanelExpandRoundnessOvalAGradientTypeRadial.apk' I/O error
12-06 08:19:02.800 W/ResourcesManager(3106): failed to add overlay path /system/app/_android.FlowdorV2.LimeA200HeaderStatusBarSizePanelExpandRoundnessOvalAGradientTypeRadial.apk
12-06 08:19:02.800 W/ziparchive(3106): Unable to open '/system/app/_android.LivDark.GradientLimeViolet33cc99BlackAmoledBackground.Android10.apk': No such file or directory
12-06 08:19:02.800 E/.gms.persisten(3106): Failed to open APK '/system/app/_android.LivDark.GradientLimeViolet33cc99BlackAmoledBackground.Android10.apk' I/O error
12-06 08:19:02.800 W/ResourcesManager(3106): failed to add overlay path /system/app/_android.LivDark.GradientLimeViolet33cc99BlackAmoledBackground.Android10.apk
12-06 08:19:02.800 W/ziparchive(3106): Unable to open '/system/app/_com.google.android.gms.LivDark.Android10.apk': No such file or directory
12-06 08:19:02.800 E/.gms.persisten(3106): Failed to open APK '/system/app/_com.google.android.gms.LivDark.Android10.apk' I/O error
12-06 08:19:02.800 W/ResourcesManager(3106): failed to add overlay path /system/app/_com.google.android.gms.LivDark.Android10.apk
Note that however these refers to files residing in /system/app
and not /product/overlay
. Considering the first file /system/app/_android.PitchBlack.A07PitchBlackLimeTranslucentSystemUIOFFAndroid10.Android10.apk
for example - I see this entry in the Magisk log which indicates that it is added by the "substratum" module:
12-06 13:16:30.210 761 762 I Magisk : bind_mount: /system/app/_android.PitchBlack.A07PitchBlackLimeTranslucentSystemUIOFFAndroid10.Android10.apk <- /sbin/.magisk/modules/substratum/system/app/_android.PitchBlack.A07PitchBlackLimeTranslucentSystemUIOFFAndroid10.Android10.apk
So it appears to me that MagiskHide is doing the right thing here by hiding these files from gms, but I don't know why gms or ResourcesManager in a "Magisk-hidden" process is looking for these files at all.
It seems to me you should open a separate issue for your case.
(I'm not well versed on either Magisk or the inner workings of modern Android, so @topjohnwu should have a better understanding of the issue than I do.)
@alvinhochun I have a pixel 2 XL which DOES actually have a product partition afaik
Looks like it's not only /product/overlay folder is affected I getting same drain by .gms.persistant if modules write something in any //overlay folder /system/overlay and /vendor/overlay is affected too
@thevirusua that's interesting. Some QuickSwitch users have found that moving the overlays to /vendor/overlay in the module directory solve the issue for them 🤔
Also having this problem with GMS but that's not the strange thing. When i "unhide" GMS it goes away for that but I also have a Samsung S3 watch with Samsung Pay, so I hide three Samsung apps and two of them also go wild. And my choosen wallpaper reverts to default
I'm on a pixel 3xl Dec patch, latest magisk Canary, & QS terminal b11.
Let me know if logs would be useful as I'd have to re-setup to reproduce.
It should be noted that this only happens when someone has added the com.google.android.gms activity to the MagiskHide list, either manually or by using the GPay fix module. The MagiskHide default of only having SafetyNet's com.google.android.gms.unstable on the hide list results in a normally working device.
@topjohnwu I don't believe that's the same issue. It's happens to me on my pixel 3a xl, although I don't get the lag su -c top
does show high cpu and ram usage and I don't have any images overlaying partitions.
Also if that was the issue, QuickSwitch and navigation bar overlay modules wouldn't be working on a majority of devices.
Related: #2403
I just spent a whole few hours trying to figure out what's wrong with it. Apparently the way QuickSwitch replaces file in
/product/overlay
is causing some issue with MagiskHide and causes Google Play Service (com.google.android.gms
) to get stuck trying to read some APKs in/product/overlay
(my guess is Play Protect) and ends up continuously utilizing 100% CPU and keep allocating memory.This is what the QuickSwitch module looks like when Lawnchair is selected:
This is an excerpt from
logcat
:From a root shell, I can see that the file exists:
However it is inaccessible in MagiskHide's namespace:
Device: Pixel 3a OS: Android 10 (sargo-qp1a.191105.003) Magisk: Latest Canary 20.2-72edbfc4 (20108) (also happened on stable)