I have a 2017 27" iMac running macOS 10.14.6. Throughout the day the entire screen will freeze for a period of 5-10 seconds. This happens sporadically and there's no consistent way to trigger it, but toggling Exposé and opening tabs in Safari seem to be the two biggest triggers.
While the screen is frozen, I can still move the cursor around, but I can't interact with anything on screen. All clicks and keystrokes will be delayed until the screen unfreezes, and then they'll all haphazardly fire at once. I'll still be able to hear audio from any application that's running, including music, videos, voice calls, or video calls.
I tried reinstalling macOS 10.14.6 to fix the issue, but sadly that didn't help. I read somewhere that one of the security updates released by Apple for 10.14.6 could introduce this issue, but I don't have any security updates installed currently and the issue is still there, so that's not it. I also have a 2019 MacBook Pro with 10.14.6 and much of the same software loaded on to it as my iMac, and it's not experiencing this issue.
Is there anything I can do to debug this, or some other solution I can try?
Best Answer
I have discovered how to determine the cause of the freezes. The trick is to take a sample of the system WindowServer process while it is frozen.
Of course, since I can't interact with the system while it's frozen, I used a separate computer to ssh into my mac, switch that session to the root account with
sudo -s
, and then execute the following command the moment the system freezes:sample WindowServer 5
That creates a sample that shows what the window server was stuck doing while it was frozen, and it consistently showed it locked in the following functions:
This is taken from a sample that caught two seconds of a freeze.
This pretty clearly shows that TCC is the culprit. Now that I know that, the next question is figuring out how to fix the freezes.