Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(ISSUE) Library Validation Fix #196

Open
tejasraman opened this issue Aug 18, 2022 · 50 comments
Open

(ISSUE) Library Validation Fix #196

tejasraman opened this issue Aug 18, 2022 · 50 comments

Comments

@tejasraman
Copy link

tejasraman commented Aug 18, 2022

Long story short:
Your Library Validation patch is badly BROKEN for some users.


Fix



UPDATE: This works flawlessly with every app even after sleep (the other was not reliable after sleep)

Context

On my Late 2011 MacBook Pro running your patcher with Catalina 10.15.7, the patcher had a ton of Library Validation problems (apps like Chrome and PowerPoint don't always open) on a fresh install. By downloading the patch from your server and replacing the boot.efi in the installer with the version above almost apps launch flawlessly.

MacBookPro8,1 - Catalina 10.15.7 Build 19H2
(Maybe I'll set up a patch server and try to update the available fixes to resolve these problems)

@tejasraman tejasraman changed the title Please fix this. (ISSUE) Library Validation FIx (FIX HERE) Aug 18, 2022
@tejasraman tejasraman changed the title (ISSUE) Library Validation FIx (FIX HERE) (ISSUE) Library Validation Fix Aug 19, 2022
@tejasraman
Copy link
Author

@dosdude1 please move to the kext method if you still maintain this!
I set up a mirror and am making a custom version of Patch Updater to fix this and other issues (Patching Corebrightess in UNACCEPTABLE in 2022) to make this patcher more up-to-date

@dosdude1
Copy link
Owner

dosdude1 commented Aug 19, 2022

I am fully aware of DisableLibraryValidation.kext, and in fact use it for some of the patcher functionality. From what I remember, though, the issue was due to AMFI, and not so much Library Validation. I can do some testing with DisableLibraryValidation.kext again, and if it does indeed resolve all issues (including allowing security permissions, such as request for microphone, webcam, etc.), then I'll utilize it.

The boot.efi you reference is already implemented in the patcher (check SIP Disabler Patch in post-install); it is for disabling SIP, though, and has absolutely NOTHING to do with Library Validation.

Also, what do you mean CoreBrightness shouldn't be patched? Of course it should, to allow Night Shift to work on unsupported models. Besides CoreBrightness, though, there are other frameworks that needed to be patched as well for non-Metal video cards to function. So simply ceasing modification of CoreBrightness will NOT get rid of the need to disable Library Validation.

@tejasraman
Copy link
Author

No... I am ok with patching CoreBrightness but there are better ways to do it. My patched Mac (on a 2nd partition) has NightShiftEnabler.kext with Lilu, WhateverGreen and a stock CoreBrightness and Night Shift works fine (Lilu and WhateverGreen also have the side effect of enabling the VDA decoder and allowing me to use AirPlay). I'm not the biggest fan at modifying a core macOS component but it works really well on my main partition (I have 2 installs of your patcher) so I shouldn't complain.

Also, your patcher is amazing. Thanks so much for making my 2011 MacBook a viable laptop for many tasks that I do (Python/HTML, Office365, browsing) without the glitchiness that OCLP has.

@tejasraman
Copy link
Author

Also, I have the URL for your patch server. SIP Disabler has a kext and Library Validation has an EFI file. My issue is that some apps crash without DisableLibraryValidation.kext (Chrome, Brave, Edge, O365, and some Electron apps (Marktext is an example)).

@dosdude1 The strangest thing is that if I upgrade from Mojave Patcher using the patcher app it doesn't have these issues but installing from a USB of Catalina Patcher causes these issues.

Do you know why?

@dosdude1
Copy link
Owner

Yeah, that's been a long standing issue. Not sure why upgrading would change anything. I'll test DisableLibraryValidation and see if it makes it any better. One thing you should verify is that an app is able to ask for permissions, like camera or microphone. When I last messed with it, that would stop working after I was able to get the applications to stop crashing on launch.

@tejasraman
Copy link
Author

tejasraman commented Aug 19, 2022

Uploading Screen Shot 2022-08-19 at 12.44.32 PM.png…
It seems to work for me (10.15.7 Build 19H2)
Also, amazing video on flashing boot chimes. I saw that the other day.
(Yes, I was out when I took this screenshot, so no AirPlay devices show up, but they show up at home)

@tejasraman
Copy link
Author

tejasraman commented Aug 20, 2022

With DisableLibraryValidation I can open all apps AND all permissions (camera, mic, screen recording, etc) work fine in my testing. It would be nice if you could put this patch (I've seen the myriad of issues about this on GH).

I've mirrored your patch server with my own patches to test some patches with custom builds of Patchupdater (a new patch for LibValidation and a WIP CoreBrightness patch (I need a stock copy first))

DisableLibraryValidation (even the 10.12 version) makes these machines usable, and I'm all for putting the patch on your server. Here is my mirror with some different patches (DON'T TRY THE COREBRIGHTNESS PATCH, YOUR OS WILL BREAK IF YOU USE IT!)

https://github.com/tejasraman/CatalinaPatchUpdateServer/blob/master/LibraryValidation.zip

or my real server (̶w̶h̶i̶c̶h̶ ̶I̶ ̶d̶e̶p̶l̶o̶y̶ ̶u̶s̶i̶n̶g̶ ̶G̶i̶t̶H̶u̶b̶'̶s̶ ̶m̶a̶c̶O̶S̶ ̶1̶2̶ ̶r̶u̶n̶n̶e̶r̶ ̶-̶ ̶a̶l̶t̶h̶o̶u̶g̶h̶ ̶I̶ ̶s̶h̶o̶u̶l̶d̶ ̶u̶s̶e̶ ̶t̶h̶e̶ ̶1̶0̶.̶1̶5̶ ̶r̶u̶n̶n̶e̶r̶ ̶:̶)̶ ̶)̶ I now use the 10.15 runner 😉
https://tejasraman.github.io/CatalinaPatchUpdateServer/LibraryValidation.zip

Another sidenote: Adding Lilu and WhateverGreen makes 2011 models with HD3000 work with Airplay (like mine) even on a Sony TV bought in 2022 due to enabling the VDA decoder by default.

Oh, and my machine is so fast on Catalina - the patching Airplay and LibValidation makes it as good as a supported 2012 Mac. Thanks so much for the patcher @dosdude1, it has made my Mac more usable than it was before!

@tejasraman
Copy link
Author

tejasraman commented Aug 20, 2022

Whoops, I closed it. Clicked the wrong button. Sorry! Reopening

@tejasraman
Copy link
Author

tejasraman commented Aug 21, 2022

Some anomalies I've noticed:

  1. It works fine if I upgrade from patched Mojave for whatever reason (but not upgrading from native HS or installing fresh)
  2. The boot.efi patch by @ASentientBot prevents apps from crashing - until the laptop sleeps. Using the latest boot.efi patch just causes more crashes again
  3. Either one of the boot.efi patches (or none at all!) + DisableLibraryValidation.kext works fine and apps (Powerpoint, Excel, Chrome, Edge, Brave, MarkText) work again with no issues, even through 12 hrs. sleep

@tejasraman
Copy link
Author

tejasraman commented Aug 28, 2022

Hi @dosdude1
Over a few days of testing, I have not seen a single app crash and permissions popups (full disk, microphone, screen recording, camera, etc) work fine. Could you take a look at using this instead of the current patch?

(Written from my patched 2011 MBP)

@tejasraman
Copy link
Author

tejasraman commented Sep 6, 2022

As it seems this will never be fixed I have forked your patcher and will to create custom patches that work properly for using normal apps and Airplay.

Tejas

@dosdude1
Copy link
Owner

dosdude1 commented Sep 6, 2022

It will be fixed, I will be adding the changes suggested and testing myself, then releasing a new build of the patcher. There are also other changes I want to make to some other aspects, which need to be implemented and tested as well. Just been busy with other things recently.

@tejasraman
Copy link
Author

tejasraman commented Sep 6, 2022

Thanks so much @dosdude1 !

@dosdude1
Copy link
Owner

dosdude1 commented Sep 7, 2022

Well, just after I released a new patcher version with these changes, I noticed that it appears to break the Music app. Test this and see if yours behaves similarly.

@fenneclabs
Copy link

I think I'm having an issue related to the new patcher version. I just had an OTA update notification (MBA 2011 Catalina), it proposed an update that I installed, but it failed. Then few minutes later it proposed the same update along with the Library fix. I tried the install again and it worked, it asked me to reboot, and I clicked reboot. Nothing happened, I killed the rest of the apps, and restarted, then it was stuck on my wallpaper with the mouse still able to move. Finally I forced the shutdown and restarted. Now it's stuck on the Apple boot logo and the completion bar does not move at all.

Any hints on what went wrong and how to fix it?

Thanks!

@tejasraman
Copy link
Author

Just installed the new update and removed my manual LVD patch. Thanks @dosdude1

@tejasraman
Copy link
Author

tejasraman commented Sep 7, 2022

Amazing. This also fixes the big with the screenshot preview at the bottom showing in a black square sometimes and the small glitch in display preferences. Thanks for keeping our Macs alive @dosdude1

@tejasraman
Copy link
Author

@dosdude1 the music app is broken.

@tejasraman
Copy link
Author

This is to do with disablelibraryvalidation.kext apparently.

@tejasraman
Copy link
Author

The update was fine on my 2011 13" MBP @fenneclabs

Reinstall your patcher.

@tejasraman
Copy link
Author

@dosdude1 I messed up my music app badly by issuing a bad cp command. Could you send me your copy of Music.app? It is located in /System/Applications

@chinarut
Copy link

I had an OTA update notification on my 2010 Mac Mini server to install the last 2 updates (I presume 1.4.5 and 1.4.6) and now I’m unable to remotely screenshare anymore (I use Screens on my iPadPro).

Thankfully, I can ssh into the machine. What is the easiest way to roll back to 1.4.4 from the command line given the state my machine is in?

@MindDrift100
Copy link

I think I'm having an issue related to the new patcher version. I just had an OTA update notification (MBA 2011 Catalina), it proposed an update that I installed, but it failed. Then few minutes later it proposed the same update along with the Library fix. I tried the install again and it worked, it asked me to reboot, and I clicked reboot. Nothing happened, I killed the rest of the apps, and restarted, then it was stuck on my wallpaper with the mouse still able to move. Finally I forced the shutdown and restarted. Now it's stuck on the Apple boot logo and the completion bar does not move at all.

Any hints on what went wrong and how to fix it?

Thanks!

Got same here. Login stuck on apple screen with progress bar full.

Anybody got a fix please?

Thanks! x

@MindDrift100
Copy link

MindDrift100 commented Sep 10, 2022

@dosdude1
@tejasraman

Machine won't boot now. Stuck on Apple screen with progress bar full.

Have you got a fix for this please?

Thanks! x

@dfunct
Copy link

dfunct commented Sep 10, 2022

@MindDrift100
Same here on mid 2010 MBP, stuck on apple logo with full bar. It happened after I installed the latest Library Validation Disabler patch (the one supposed to fix the Music app crash).
Booted in verbose mode and found it was generating core dumps for something around AMFI sip.
Looked it up online and found something that fixed it for me:

  • Boot in single user mode (hold CMD + S during boot)
  • type these 3 commands when you get the prompt (I had to press the Enter key to get it)
mount -uw /
nvram boot-args="-no_compat_check amfi_get_out_of_my_way=1"
reboot

@tejasraman
Copy link
Author

tejasraman commented Sep 10, 2022

Hi @MindDrift100 @dfunct @fenneclabs
I've updated 2 Catalina Patcher installs recently and have not been able to see the same issue

Could you please do a verbose boot (hold Cmd + V on startup) and let me see the boot logs?

Oh, and disabling literally all macOS' basic security (like AMFI) is NOT the way. Disable SIP instead. Disabling AMFI messes up permissions and makes your computer more vulnerable to malware.

@tejasraman
Copy link
Author

tejasraman commented Sep 10, 2022

Hi @chinarut
I am wondering if VNC was disabled on your Mac server. Did you check that already? I have never used screens as a VNC client (I always use RealVNC or install AnyDesk on my ipad air) but I've read that screens uses "remote access" to log in.

If not then enabling it should fix things. If that doesn't work please get back to me.

@dfunct
Copy link

dfunct commented Sep 10, 2022

@tejasraman
It keeps looping on this AMFI: SIP is off forever
image
Any suggestions on how to disable SIP only? Thanks!

@tejasraman
Copy link
Author

tejasraman commented Sep 10, 2022

This looks just like what happened on my attempts to hackintosh a real MacBook. Same errors too.

The answer? Reinstall.

@dfunct
Copy link

dfunct commented Sep 10, 2022

I'll reinstall as last resort. Disabling AMFI works fine for backing up all the data.
I'll try disabling SIP as you mentioned above later and see what happens.
Also I'll try uninstalling the latest library validation patch (and reinstall an older version), hopefully that would work

@fenneclabs
Copy link

@dfunct @tejasraman @dosdude1
Using verbose boot allowed me to see that the boot process was not stuck... Waiting long enough eventually got me to the desktop, even if was able few core dumps and logs about "too many corpses"! Once on the desktop, I got another OTA about video drivers that I installed and rebooted again. Now everything looks good and I didn't have to disable AMFI.

With this patch Chrome got much faster. Recently I had to switch to Firefox because it was too slow, I felt it was something related to GPU acceleration, which this patch confirms.

@tejasraman
Copy link
Author

That's amazing @fenneclabs !
Thanks!

@dfunct
Copy link

dfunct commented Sep 10, 2022

@fenneclabs in my case I'm pretty sure it was stuck in a loop. I let it go for ~2hrs before shutting it down.
Also I have no OTA updates, I'm running the latest versions for all.

@dfunct
Copy link

dfunct commented Sep 10, 2022

I've reset the nvram boot-args (as I disabled AMFI earlier) and reapplied the post-install patches from the USB installer created with the Catalina patcher.
The system's GUI booted up and I got the OTA for the latest version of the Library Validation. I applied it, rebooted and apparently all is good this time round :)

@MindDrift100
Copy link

@dfunct
@tejasraman

Hey!

Thanks for the guidance.

Had to get my machine back up & running so did a CCC reinstall.

Cheers! x

@tejasraman
Copy link
Author

Great!

@tejasraman
Copy link
Author

@dosdude1 I have made a custom OC config and a framebuffer patch for the laptop. It worked amazing and both music and other apps work well. I use your audio and GPU patches. Thanks for trying to help me though

@fenneclabs
Copy link

@fenneclabs in my case I'm pretty sure it was stuck in a loop. I let it go for ~2hrs before shutting it down. Also I have no OTA updates, I'm running the latest versions for all.

I was used for my MBA to start in about 30s, I was powering off after few minutes. It took less than 10 minutes to complete the boot after the first upgrade. Now it's back to 30s. So indeed, 2h means boot loop!

@chinarut
Copy link

chinarut commented Sep 13, 2022

hey thanks for chiming in @tejasraman - I wanted to spend some time reviewing the system logs and poking around more to see where it is hanging on boot.

I am wondering if VNC was disabled on your Mac server. Did you check that already? I have never used screens as a VNC client (I always use RealVNC or install AnyDesk on my ipad air) but I've read that screens uses "remote access" to log in.

I also tried to remote login using another Mac using the built-in “Screen Sharing” which hangs. The agent appears to be running:

root 1383 0.0 0.3 4524920 32804 ?? Ss 6:48PM 0:00.33 /System/Library/CoreServices/RemoteManagement/ScreensharingAgent.bundle/Contents/MacOS/ScreensharingAgent

in particular, it looks like the WindowServer (and a few other processes below) won’t run:

Sep 12 18:48:42 localhost com.apple.xpc.launchd[1] (com.apple.diskmanagementd): Service only ran for 0 seconds. Pushing respawn out by 1 seconds.
Sep 12 18:48:43 localhost com.apple.xpc.launchd[1] (com.apple.secd): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Sep 12 18:48:43 localhost com.apple.xpc.launchd[1] (com.apple.FontWorker): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Sep 12 18:48:43 localhost com.apple.xpc.launchd[1] (com.apple.diskmanagementd): Service only ran for 0 seconds. Pushing respawn out by 1 seconds.
Sep 12 18:48:44 localhost com.apple.xpc.launchd[1] (com.apple.WindowServer): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.

the reason i thought it was related to Library Validation is 3 days ago I was seeing lines like this:
Sep 9 21:25:52 localhost com.apple.xpc.launchd[1] (com.apple.security.agent.login.00000000-0000-0000-0000-0000000186A5[3791]): Binary is improperly signed

for some reason, after leaving the server off for 3 days, I don’t see any instances like above (but it still hangs on boot)

if there is an easy way to roll back to 1.4.4, I’m still happy to try this! [I see there is a 1.4.7 release which might fix this? how do I update from the CLI?]

@tejasraman
Copy link
Author

1.4.7 reverts the changes. You need gui to update though.

I'm working on my own patcher that doesn't have these issues so I can't test for you but you could try rustdesk or AnyDesk.....

@chinarut
Copy link

chinarut commented Sep 13, 2022

ok good to know the changes were reverted. I just tried to boot in Verbose mode and I get the similar messages to the above creating too many corpses and allowing core dumps for just about every pid.

you could try rustdesk or AnyDesk.....

even when WindowServer doesn’t run?

I can ssh into the machine no problem so if you do create a patcher than doesn’t require the GUI, let me know.

I’m seeing references to others using a bootable USB - so I’m wondering if I can create a USB stick w 1.4.7 and fix the issue?

@tejasraman
Copy link
Author

Oh. I didn't realize that your WindowServer is broken.

This update seems to be full of trouble. I should have never have suggested this patch to dosdude1.

@chinarut
Copy link

chinarut commented Sep 13, 2022

oh it’s all good - i knew challenges would come w the turf! 😅 still grateful to be able to put a 12 year old machine to good use! 🙏🏼

I’m creating a new 1.4.7 USB installer and wondering if I’ll be able to reinstall the patch safety without affecting any user data. I have Time Machine backups just in case and have my fingers crossed this will be straightforward 🤞🏼

@chinarut
Copy link

chinarut commented Sep 13, 2022

and we’re officially back from the dead running the post-install patches for 1.4.7 from USB!

WindowServer is back up & I can remotely able to get back in through Screens and all my server processes that went down are back up and running - we are gonna keep squeezing life out of this baby! 👍🏼

thank you @tejasraman for chiming in and helping keep things moving!

@tejasraman
Copy link
Author

You're welcome @chinarut
I am so sorry for the inconvenienceI wonder where this issue is coming from because I didn't have this issue so...

@MindDrift100
Copy link

@dfunct
@tejasraman

Hey!

Anybody got a fix to stop the patch updater coming up all the time please?

Thanks in advance!

x

@tejasraman
Copy link
Author

tejasraman commented Sep 16, 2022

@MindDrift100 Install the updates and remove it as a startup service in macOS's settings.

@MindDrift100
Copy link

MindDrift100 commented Sep 17, 2022

@MindDrift100 Install the updates and remove it as a startup service in macOS's settings.

@tejasraman I don't want the updates. See above, one of them caused my machine to hang at startup. I just wanna stop patch updater popping up all the time. It's not listed as a startup service. Is the another way please?

@tejasraman
Copy link
Author

tejasraman commented Sep 17, 2022 via email

@dosdude1
Copy link
Owner

The issue with the update has been fixed, so it is fine to install now. However if you want to disable Patch Updater, you can do so by simply deselecting the option in the Patch Updater pane in System Preferences.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants