-
Notifications
You must be signed in to change notification settings - Fork 45
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
Catalina enable-hdmi20 CoreDisplay patch leads to Code Signing crash of WindowServer #1335
Comments
/*
* The MAP_RESILIENT_* flags can be used when the caller wants to map some
* possibly unreliable memory and be able to access it safely, possibly
* getting the wrong contents rather than raising any exception.
* For safety reasons, such mappings have to be read-only (PROT_READ access
* only).
*
* MAP_RESILIENT_CODESIGN:
* accessing this mapping will not generate code-signing violations,
* even if the contents are tainted.
* MAP_RESILIENT_MEDIA:
* accessing this mapping will not generate an exception if the contents
* are not available (unreachable removable or remote media, access beyond
* end-of-file, ...). Missing contents will be replaced with zeroes.
*/
#define MAP_RESILIENT_CODESIGN 0x2000 /* no code-signing failures */
#define MAP_RESILIENT_MEDIA 0x4000 /* no backing-store failures */ Seems that only works for read only mappings. |
That's very interesting, but I believe we cannot quite remap things here. Instead we should adjust the codesign flags as we already do, but perhaps in a slightly different manner. It may be possible that I missed some for the latest 10.15 version. Could you play with it and try setting/dropping different flags? |
Can easily reproduce on 10.14.6 here: run P95 large FFTs until some swapping occurs, and then try to open About This Mac. This should cause WindowServer to crash.
|
@al3xtjames: try to add a boot-arg -liluuseroff. |
@al3xtjames @lambdaupb could you check whether the offset found by |
I'm not a C programmer and have no real Idea how to do that. This machine is my daily driver at the moment so I'm reluctant to dive into it since my issue was solved by removing the enable-hdmi20 setting. |
The easiest test is to enable Lilu debug logging and create a debug log in /var/log/Lilu_x.x.x.txt via |
Lilu is using 308 as the offset for |
@al3xtjames thx a lot for the CoreDisplay fix on weg. Would you mind providing some more information about max-pixel-clock-frequency value? If you have time to update Manual in weg, then will be so nice. |
I tried to reproduce on my NUC but couldn't. System becomes laggy but not unresponsive and it doesn't crash or even overheat. CPU usage went up and down, I guess thats part of the Large FFT torture test? I left it running for about 10 minutes whilst browsing Github and opening/closing the about my Mac dialog every now and then. My config can be found here. As I mentioned here I believe these forced logouts on NUC 8th gens are due to missing ACPI patches and/or the OpenCore configuration used. But thats just my guess since I have no issues and run multiple NUCs. I have stress tested them with stress-ng quite heavily a few months ago. No problems whatsoever, these Kaby Lake NUCs are rock solid with OpenCore for me. I'm running the latest versions of OpenCore/Lilu/etc and compiling everything from source now but also had no problems when I didn't do that and just used the release versions. Are there any other ways for me to try and reproduce this? |
@zearp thank you for your attempt at reproducing this issue! I think you have SIP disabled with <key>csr-active-config</key>
<data>/wcAAA==</data> where disables all SIP on Mojave / Catalina. So code signing would be disabled and not kill WindowServer. |
@lambdaupb Good point! I have it disabled cuz I use VoltageShift. I just repeated the test with SIP enabled. It did run a little hotter but after ~10 minutes of running Prime95 and opening about this Mac and Launchpad/Notification Centre a bunch of times I didn't get any crash. The fading animation varies from smooth to choppy but nothing grinds to a halt. I'm thinking that the logouts people experienced on the NUC may have nothing to do with this, which is why I can't reproduce. Unless it also happens to you on a NUC but it seems you're using a different mini computer. I'm only here cuz you mentioned this in a NUC issue I was still subscribed to haha. But I can't seem to reproduce it on my NUCs. |
@zearp I have little experience with that setting, but could you check if SIP is really
|
@lambdaupb Yes it was really enabled. I checked with |
My deskmini has a Coffee Lake R (I think) i5-8500 CPU. There might be something else going on as well.
So the issue exists and is fixed by removing enable-hdmi20 for me on 10.15 and @al3xtjames on 10.14. It might very well be a combination with another setting or ACPI patch that triggers it though. |
@lambdaupb Yeah thats my guess too. What I will do is try the EFI from the repo you linked and report back in a bit. When I wrote Kaby Lake I meant Coffee Lake of course. I'm a pro at messing up those Intel codenames, sorry for any confusion it may have caused. |
Thanks for the help. I will try to reproduce this issue with opencore updated to 0.6.4 and all other modules updated as well. |
Let me be clear:
|
@lambdaupb Just ran the same tests using the EFI from the repo you linked and again no crashes, SIP is enabled and the hdmi setting too. I'm thinking these random logouts people experienced on the NUC have nothing to do with this issue, which would explain my failure to reproduce it. But it doesn't mean there is no issue of course. I don't have a DeskMini 310 to play with but it looks like a fun little machine so I hope you can get this sorted. The issue with the WindowServer crash you linked seems to be solved by a comment on a blog thats linked but I can't read the comment because the comments are not loading for me for some reason. I've not done any upgrading from 10.14.x to 10.15.x and only ever used Catalina and Big Sur on my NUCs. Maybe those crashes were related to the upgrade or something else in their setup? I think this specific issue isn't present on the NUC Coffee Lake models but do let me know if there's anything else I can try. |
@zearp Hi, |
@likaci You can’t follow the link I referred to and find the blog post yourself? Please Try if you can also reproduce it on a system that wasn’t upgraded from 10.14.x because no matter how long I let it run I get no crashes and I directly installed Catalina on mine. I don’t have a 10.14.x installer laying around to do a clean install with and then upgrade to Catalina but I might try for the fun of it and see if I get crashes that way. |
@zearp Sorry for my disturbing and bad english. I have only one NUC running some services , so I can't reinstall it. Thank you for your help, Happy new year. |
|
Does this mean that Because at the moment removing It seems its not doing the same as the hdmi20 option did. But I may have misunderstood and/or not implemented it properly. |
You may need higher max-pixel-clock-frequency (in Hz, defaults to 675000000). https://github.com/acidanthera/WhateverGreen/blob/master/Manual/FAQ.IntelHD.en.md#hdmi-in-uhd-resolution-with-60fps |
see appleserial/DeskMini#10
DeskMini 310, i5-8500 UHD630, Catalina 10.15.7, Opencore 0.6.3
related code (probably): https://github.com/acidanthera/WhateverGreen/blob/7d30dd8a624d0d3b2d4882fcc689b9db4964efd5/WhateverGreen/kern_cdf.cpp#L182
enable-hdmi20
patches CoreDisplay at runtime.When in a High Memory Pressure situation it apparently happens that the
CoreDisplay
library memory is moved to swap.When reloading the library memory to RAM, a code signing check is done and fails, causing a WindowServer crash.
I am able to reproduce this by using
Prime95 > Torture Test > Large FFTs
which allocates almost all of system memory and then doing some UI stuff involving animations etc (~1min).Possible fixes
EXC_BAD_ACCESS (Code Signature Invalid)
) VirusTotal/yara#1309) - I have 0 clue if that works for executable regionslogs
The text was updated successfully, but these errors were encountered: