For the last month or so, my mac has been randomly logging out overnight. When I come back in the morning, it's at the login screen and all my applications need to restart. I know it's not a full reboot because my uptime
steadily increases and when I run last reboot
or last shutdown
they are days ago.
I've tried examining the logs, and it looks like perhaps com.apple.WindowServer is crashing. I'm not sure if that's a consistent symptom though (or why it would crash, and only overnight – never while I'm actively working).
Running on an iMac, using macOS Mojave (although also happened on High Sierra).
Logs: https://pastebin.com/1nnZPNcC
Of note, the point where the logout happens starts with:
Oct 18 05:26:02 Christophers-iMac com.apple.xpc.launchd[1] (com.apple.WindowServer[99537]): Service exited due to SIGABRT
Oct 18 05:26:02 Christophers-iMac com.apple.xpc.launchd[1] (com.apple.ViewBridgeAuxiliary[98359]): Service exited with abnormal code: 2
Oct 18 05:26:04 Christophers-iMac com.apple.xpc.launchd[1] (com.apple.ViewBridgeAuxiliary): Service only ran for 1 seconds. Pushing respawn out by 9 seconds.
Oct 18 05:26:04 Christophers-iMac sessionlogoutd[98360]: DEAD_PROCESS: 99533 console
Best Answer
TLDR: In my case, SwitchResX seems to be the culprit. Didn't look for a workaround yet.
I just experienced the same logout, with similar logs:
As suggested by @Ruskes, I ran the command
sudo log show --start "2020-06-02 15:24:00" --info --debug --signpost
and saw these interesting lines:I have two external displays, and use SwitchResX to adjust one screen's display to force a retina-like 1440p density over 1080p (connected by HDMI), and another screen (through VGA-MiniDisplay adapter) is simply at 1080p.
The first errors in the detailed logs seems related to SwitchResX's custom resolutions (note the 1920, 1024, 800…), as it registers potentially unsupported resolutions.
For now, I deduce that this triggers WindowServer failure, then logouts, but didn't find a workaround yet.
Any input appreciated!