X server 1.20.7 crashes after waking when OpenGL apps were active

I’ve stumbled across an issue where after leaving my computer and it turning the screen off, Xorg crashing when I come back to it.

Steps to reproduce:
0) Stop any Display manager and start Xorg from the tty, unless you want no way of recovering partially.

  1. Open Firefox and/or Alacritty (terminal emulator with HW acceleration, via OpenGL)
  2. Wait for DPMS to turn off screen, or use the following command to do it (almost) instantly:
xset dpms 1 1
  1. Leave the computer in this state for a few seconds
  2. On pressing a key to turn the screen back on:
  • Xorg crashes
  • the display manager tries to start, but fails to do so multiple times, as Xorg repeatedly crashes

Additional information:

  • Laptop with Optimus hybrid graphics, Xorg running on the NVidia GPU.
  • The crash also happens when running on integrated graphics, and does not happen at all when the NVidia kernel module is blacklisted
  • nvidia.modesetting=1 kernel parameter is set
  • External monitor attached via Display Port when running on discrete GPU
  • xss-lock (screenlocker) seems to make the issue more frequent, however crashes still occur when no screen locker is active
  • Window Manager: awesome, Display Manager: SDDM
  • Crash does not occur when no apps are running on turning screen off
  • Kernel module built locally with DKMS
  • Xorg version 1.20.7, driver version 440.59, kernel version 5.5.2

I’ve attached the complete journalctl log, Xorg running with verbose logging level 6, started from the tty.

Should any more information be needed, I’d be happy to help.
bugreport_journalctl2.txt (254 KB)
nvidia-bug-report.log.gz (889 KB)

Thanks for the detailed report. This one is a bit of a head-scratcher, so I filed internal bug 2844542 for investigation. The bug tracker is not public, but you can use that number to refer to this issue in any future communication with us.

By any chance, would it be possible to try other driver versions to see if the problem still occurs? Knowing whether or not this is a regression would help pin down the problem.

Today the distribution maintainers issued a rebuilt package of the kernel and the DKMS package. This seems to have fixed it. My guess is that there could have been a mismatch in compiler versions or similar. I’m sorry for troubling you.

For future reference, the problem arose with the following combination of package versions (Arch Linux):

  • linux-5.5.2.arch1-1
  • nvidia-dkms-440.59-3
  • nvidia-utils-440.59-1