Hello, it looks like we found a solution, but there are 46 pages of replies. Can someone summarize the fix and explain how to do it? Thank you.. I've been having this problem for like a year
This has been annoying me for months!
One workaround that I've found that works is to disable the screen saver. I've not had a kernel panic since.
Which is a shame cause I do like my screen saver:
My setup.
Cheers David
The work around is basically disabling the mediaanalysisd process (as well as photoanalysisd) and this will prevent the kernel panic. However the issue that I've got is that if I run certain games on my Mac (such as Runescape) and opt to use my GPU, or use the photos app or open a photo in iMessage and this will cause the same freeze. You can use either Launch Control or a terminal command app to do this.
I can't recall the exact post in this topic but I copy and pasted the instructions. There is also an alternate way and that is deleting the plist file in Launch Daemons, I'll include instructions for both.
------------------------------------------------------------------------------------------------------------------------------
This is NOT:
- 3rd party kext problem
- hardware problem
- sleep/wake/screensaver problem
- Catalina-only problem (happens on Mojave too)
It was tricky to find a cause:
Some "nonstandard" (or maybe partially corrupted) photo in your "Photos Library" causes Apple's media analysis daemon (/System/Library/PrivateFrameworks/VideoProcessing.framework/Versions/A/mediaanalysisd) to lock display driver, which deadlocks user's WindowServer for more than 120 seconds, so com.apple.driver.watchdog reboots entire operating system. Very annoying and hard to reproduce bug.
That's why all is running fine on clean macOS install.
Temporary solution:
- boot to Recovery partition (Cmd+R)
- open Terminal
- cd /Volumes/<macOS>/System/Library/LaunchAgents
- rm -rf com.apple.mediaanalysisd.plist
- reboot
No more crashes/kernel panic when your Mac is idle.
May be necessary to re-apply after macOS update.
How to actually do it
To do this, you'll need to open up Terminal and run a couple of commands. Any time you're asked to copy and paste commands into your terminal, it's a good idea to at least have at least a basic understanding of what the commands are actually doing to your system.
The following commands are really 4 command. The && basically means "run the first one (on the left) and if that's successful, run the second one (on the right). launchctl is the command that is used to control system services in macOS.
First, you'll disable and kill the GUI instance:
launchctl disable gui/$UID/com.apple.photoanalysisd && launchctl kill -TERM gui/$UID/com.apple.photoanalysisd
As well as the actual service:
launchctl disable user/$UID/com.apple.photoanalysisd && launchctl kill -TERM user/$UID/com.apple.photoanalysisd
GUU
launchctl disable gui/$UID/com.apple.mediaanalysisd && launchctl kill -TERM gui/$UID/com.apple.mediaanalysisd
Service
launchctl disable user/$UID/com.apple.mediaanalysisd && launchctl kill -TERM user/$UID/com.apple.mediaanalysisd
------------------------------------------------------------------------------------------------------------------------------
Terminal commands :
sudo mount -o nobrowse -t apfs /dev/disk1s5 ~/livemount [Will need to amend disk to your relevant drive]
sudo bless --folder ~/livemount/System/Library/CoreServices --bootefi --create-snapshot
Delete this file
com.apple.mediaanalysisd.plist