Xorg server crash on OpenGL application exit (RHEL7, Quadro K600)

Specs

Intel I7 desktop machine with 16GB RAM
Nvidia Quadro K600 - 1GB RAM with 2 monitors attached
Red Hat Enterprise Linux Workstation release 7.6 (Maipo)
X.Org X Server 1.20.1

±----------------------------------------------------------------------------+
| NVIDIA-SMI 430.26 Driver Version: 430.26 CUDA Version: 10.2 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Quadro K600 Off | 00000000:01:00.0 On | N/A |
| 29% 59C P8 N/A / N/A | 746MiB / 981MiB | 1% Default |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 6262 G /usr/bin/X 654MiB |
| 0 8312 G kwin 84MiB |
| 0 22618 G /home/path/to/internalappname 3MiB |
±----------------------------------------------------------------------------+

Problem
On doing a File->Exit on an internally developed openGL application, the X server crashes with a SEGV and generates a backtrace (via abrtd) thus:

0: /usr/bin/X (xorg_backtrace+0x55) [0x5650170200f5]
1: /usr/bin/X (0x565016e6f000+0x1b4d79) [0x565017023d79]
2: /lib64/libpthread.so.0 (0x7f32008cf000+0xf5d0) [0x7f32008de5d0]
3: /usr/lib64/xorg/modules/drivers/nvidia_drv.so (0x7f31fc3d5000+0xf0049) [0x7f31fc4c5049]
4: /usr/lib64/xorg/modules/drivers/nvidia_drv.so (0x7f31fc3d5000+0xd8292) [0x7f31fc4ad292]
5: /usr/lib64/xorg/modules/drivers/nvidia_drv.so (0x7f31fc3d5000+0x4cfaba) [0x7f31fc8a4aba]

(nvidia-bug-report.log.gz file attached). Note that for the purposes to catching the debug, I ran “startx – -logverbose 6” which resulted in it being on :1, and hence Xorg.1.log is the file to look at in the attached file, not Xorg.0.log.

I also tried running the Xserver with beg symbols, but all it gave me was this:

Program received signal SIGSEGV, Segmentation fault.
0x00007f70b1c67049 in ?? () from /usr/lib64/xorg/modules/drivers/nvidia_drv.so
(gdb) backtrace
#0 0x00007f70b1c67049 in ?? () from /usr/lib64/xorg/modules/drivers/nvidia_drv.so
#1 0x00007f70b1c4f292 in ?? () from /usr/lib64/xorg/modules/drivers/nvidia_drv.so
#2 0x00007f70b2046aba in ?? () from /usr/lib64/xorg/modules/drivers/nvidia_drv.so
#3 0x0000000010000040 in ?? ()
#4 0x000055c15e0a17b0 in ?? ()
#5 0x0000000000000008 in ?? ()
#6 0x0000000000000001 in ?? ()
#7 0x000055c15e0e3a80 in ?? ()
#8 0x0000000000000001 in ?? ()
#9 0x00007f70b173a040 in ?? () from /usr/lib64/xorg/modules/extensions/libglxserver_nvidia.so
#10 0x00007f70b11f9139 in ?? () from /usr/lib64/xorg/modules/extensions/libglxserver_nvidia.so
#11 0x000055c15d126a30 in ?? ()
#12 0x000055c15e0a0890 in ?? ()
#13 0x0000000000000000 in ?? ()

This is reproducable on exiting at the least frequently 1 in 10 times. At most frequently 1 in 3 times.

I have tried nvidia drivers 390, 415, and as above 430. I have also tried in on a machine with a
Quadro M2000 (4GB card) with the same result.

nvidia-bug-report.log.gz (1.15 MB)

I am seeing the same crash (same Xorg log and same gdb trace) with Xorg 1.19.5 and a Quadro P2000. For what it’s worth this same issue seems to have been documented before:

and maybe

Any advice for how to track down the cause of this crash?

I cannot reproduce this crash while using the open source nouveau driver but I would like to use the nvidia driver due to a perceptible performance difference. I have also traced calls through libglvnd to try and determine whether there are any significant differences between executions that crash and executions that don’t. I don’t see anything obvious.

The bug does seem correlated with having multiple GLX contexts across different display devices. I have a single X screen but 3 display devices driven by the GPU.

I was able to reproduce this error on another machine and I actually got a more useful stack trace.

[1299288.731] (EE) Backtrace:
[1299288.738] (EE) 0: /usr/lib/xorg/Xorg (OsLookupColor+0x13c) [0x55a27e6e911c]                                                                                                                                                                                                                                                                                                                                                  
[1299288.738] (EE) 1: /lib/x86_64-linux-gnu/libpthread.so.0 (funlockfile+0x60) [0x7ff07db2241f]
[1299288.738] (EE) 2: /lib/x86_64-linux-gnu/nvidia/xorg/nvidia_drv.so (nvidiaAddDrawableHandler+0x7dc59) [0x7ff07cb21199]
[1299288.739] (EE) 3: /lib/x86_64-linux-gnu/nvidia/xorg/nvidia_drv.so (nvidiaAddDrawableHandler+0x65db2) [0x7ff07caf15c2]
[1299288.739] (EE) 4: /lib/x86_64-linux-gnu/nvidia/xorg/nvidia_drv.so (nvidiaAddDrawableHandler+0x45c2e7) [0x7ff07d2de06e]
[1299288.739] (EE) 
[1299288.739] (EE) Segmentation fault at address 0x1628c57