iMac crashing during sleep - CATErr MCA data not found, working fine otherwise - possible solution!
This isn't really a question, though I would like to know more about how Macs handle USB drivers and how a driver/device could persist through two OS updates and all devices being connected!
Here's the Kernel Panic:
CPU Machine Check Architecture Error Dump (CPU: Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
CPUID: 0x906E9)
(this is your machine's CPU in hex, nothing private - in this case 591593, which is correct for the CPU identified above)
CATERR detected! No MCA data found.
You'll then get a list of devices connected to the computer - none of which have reported an error, hence the "No MCA data found".
So what's happened? As I understand it, the computer crashed at a hardware level, rather than software, but the device responsible for the crash doesn't exist or isn't part of the structure.
So here's what I've been through on mine.
It may provide some clues for people who have a computer that works fine while they are using it, but either will not sleep correctly, or appears to sleep, but at some point during the night will reboot (if power on after failure is enabled) or when started up says it "Shut down because of a problem".
Usually the login comes with a kernel panic report that doesn't include a spindump/thread tree, just CATErr, a description of the hardware device tree, and MCA data not found.
Now I hate googling for answers and getting reams of useless nonsense, so:
Here's what to try if your Mac is rebooting during sleep and crashing with a kernel panic, but works fine when you are using it
- Disconnect every USB Device and hub from your Mac. Switch on the Mac. Login.
- One by one, and one at a time plug in every single USB or Thunderbolt device you have, then remove it.
- Make sure it registers correctly (look in System Report, or use the free app IOJones to see what's going on with your hardware/IO devices), then remove it correctly - eject it if it's a disk or dock, unplug it if it's a controller or network adaptor, but make sure your Mac has recognised it, installed it properly, can use it, then remove it properly.
- THEN try leaving the Mac sleeping (or initiate sleep and see if it wakes up - you could leave a USB Device you know lights up for wake, goes off for sleep as an easy indication).
Do this before safe mode, reinstalls or other things. If there's STILL a problem, then you should chase all the other diagnostics.
Background (I'm a computer nerd, btw, still use an Apple II even, but I'm not low-level programming savvy or familiar with drivers or OS/kernel structures at this level, I can handle machine code monitors and 8-bit!).
I replaced my 2013 iMac 14,2 with a 2017 iMac 18,3 i7/8GB/2TB SSD bought secondhand from a friend. They reported no issues with it, but the first day it was rebooting when in sleep. I've spent ten days trying to pin this down.
Before writing off your logic board/Mac, use the terminal and type:
log show --style syslog | fgrep "Wake reason"
If you see LOADS of events in the space of minutes on the timestamp, your Mac is never getting to sleep properly, and all the advice about 'disabling Power Nap', etc. is not going to help you.
Here's an example:
2022-10-15 04:14:39.873609+0100 localhost kernel[0]: (AppleACPIPlatform) AppleACPIPlatformPower Wake reason: XHC2 XHC1
(repeated at 15-45 second intervals about 15-20 times I didn't count)
2022-10-15 04:24:02.314792+0100 localhost kernel[0]: (AppleACPIPlatform) AppleACPIPlatformPower Wake reason: XHC2 XHC1
That's what, five minutes? And my Mac's set to screensaver for 20 minutes.
In my case it's XHC2 XHC1. You'll see that a lot when you search for this problem. More in the comments.
iMac Line (2012 and Later)