Skip to content

Xorg segfaulting on login (after greeter) with nvidia drivers #206663

@tejing1

Description

@tejing1

Describe the bug

Upon updating to 22.11, I found I could not login to my system. X promptly crashed as soon as my session started and the greeter then came up again. /var/log/Xorg.0.log.old showed X was segfaulting. I don't have the actual log from there at the moment, but I could reproduce it if desired.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Have an nvidia card, probably a very specific family given the rarity of this bug (I have a Geforce GTX 970, and the other user who's had the same issue has a Geforce GTX 1050 Ti)
  2. Enable the proprietary nvidia drivers on nixos 22.11
  3. Set up picom to run automatically with your session (still speculative)
  4. Try to log in

Expected behavior

The X server should not crash :-)

Additional context

gdb session requested on matrix after loading the X coredump:

Reading symbols from /nix/store/s9ay0whi4jrnn5wcxvvhi1rbbsrpp08l-xorg-server-1.20.14/bin/Xorg...
(No debugging symbols found in /nix/store/s9ay0whi4jrnn5wcxvvhi1rbbsrpp08l-xorg-server-1.20.14/bin/Xorg)

warning: Can't open file /memfd:/.nvidia_drv.XXXXXX (deleted) during file-backed mapping note processing

warning: core file may not match specified executable file.
[New LWP 1754]
[New LWP 1775]

warning: File "/nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libthread_db.so.1" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load:/nix/store/g9x3cm8wdmpm86pyiff6arx8skmdwkn7-gcc-11.3.0-lib".
To enable execution of this file add
	add-auto-load-safe-path /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libthread_db.so.1
line to your configuration file "/home/tejing/.config/gdb/gdbinit".
To completely disable this security protection add
	set auto-load safe-path /
line to your configuration file "/home/tejing/.config/gdb/gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
	info "(gdb)Auto-loading safe path"

warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
Core was generated by `/nix/store/s9ay0whi4jrnn5wcxvvhi1rbbsrpp08l-xorg-server-1.20.14/bin/X -config /'.
Program terminated with signal SIGABRT, Aborted.
#0  0x00007efe1fb82bc7 in __pthread_kill_implementation () from /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libc.so.6
[Current thread is 1 (LWP 1754)]
(gdb) bt
#0  0x00007efe1fb82bc7 in __pthread_kill_implementation () from /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libc.so.6
#1  0x00007efe1fb35b46 in raise () from /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libc.so.6
#2  0x00007efe1fb204b5 in abort () from /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libc.so.6
#3  0x00000000005a5cfa in OsAbort ()
#4  0x00000000005ab413 in AbortServer ()
#5  0x00000000005ac3a6 in FatalError ()
#6  0x00000000005a3089 in OsSigHandler ()
#7  <signal handler called>
#8  0x0000000000000000 in ?? ()
#9  0x000000000051c370 in present_get_crtc ()
#10 0x000000000051f514 in present_scmd_pixmap ()
#11 0x000000000051dfe2 in proc_present_pixmap ()
#12 0x0000000000442044 in Dispatch ()
#13 0x0000000000446045 in dix_main ()
#14 0x00007efe1fb2124e in __libc_start_call_main () from /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libc.so.6
#15 0x00007efe1fb21309 in __libc_start_main_impl () from /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libc.so.6
#16 0x000000000042f805 in _start ()
(gdb) info threads
  Id   Target Id         Frame 
* 1    LWP 1754          0x00007efe1fb82bc7 in __pthread_kill_implementation () from /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libc.so.6
  2    LWP 1775          0x00007efe1fc07237 in epoll_wait () from /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libc.so.6

This issue was found in the discussion on matrix as a possible root cause:
https://gitlab.freedesktop.org/xorg/xserver/-/issues/1275

Notify maintainers

@Artturin ? Not sure who really goes here

Metadata

Not actually running on the malfunctioning generation right now, will get correct data for when the bug happens if desired, but I can tell you it was built from nixpkgs commit 04a75b2eecc0acf6239acf9dd04485ff8d14f425

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions