I’ve been fighting this on and off for the last couple of years through various versions of X and different drivers (nv, nVidia, others) on various hardware, etc. The problem has been elusive and I haven’t been able to find the root cause.
My application suite has multiple programs using Motif GLX Widgets. Most programs have a single GLX Context; some have two. All are themselves single-threaded applications using X/Motif/GLX.
I’ve got infrequent but catastrophic X Server crashes (Segmentation Violations) when closing application windows. In my “close” callbacks, I’ve tried:
- Just exiting (crashes X sometimes)
- Using XRaiseWindow, then exiting (crashes less!)
- Carefully destroying GLXContext, then exiting (still crashes)
- Carefully setting the current context before destroying (still crashes)
- Carefully setting the current context to NULL before destroying (still crashes)
Crashes seem to typically be 1 out of 10 kinds of frequency. It nearly always involves closing a window that is not popped to the top (like with focus-follows-pointer + keyboard accelerators).
Under Redhat 7.2, the crashes were frequent when using the “nv” driver, but disappeared when using the nVidia-supplied driver. Under Redhat Enterprise Linux 3, I get the crashes using build
5328 from nVidia.
When trying to track this down in the past using an X Server built in debug, the crash then “seemed” to be related to not-fully-released GLX context information, but I can’t be more specific than that. Running X in verbose mode does not yield any helpful information.
“Simple” programs to demonstrate the problem have not been easy to come up with.
Is there a golden path to walk with regard to leaving an application to make sure the GLX part of the X Server is fully cleaned-up, flushed and varnished before calling exit()?
Anyone experienced something similar and found a root cause?