GL Programs SEGV on exit()

Peter Jeremy peterjeremy at
Mon May 7 11:49:37 UTC 2012

Since rebuilding WITH_NEW_XORG, I've been seeing segmentation
violations in GL programs under some conditions.  As a case that is
quick and easy to reproduce, "glxinfo -b" with software GL (which is
easily forced by running glxinfo in a X11-over-SSH session) will
core dump on exit.

I've tracked this particular issue down to the following sequence:
- dri does dlopen(/usr/local/lib/dri/
- Mesa-7.11.2/src/glsl/ralloc.c:ralloc_autofree_context() within calls atexit(autofree) - whics is also in
- dri does dlclose( which unmaps the code
- main thread calls exit()
- atexit processing jumps to the address where autofree() used to be loaded.
covers as similar issue and notes that this approach is doomed to failure.

I'm not sure how this code could be expected to work.  My guess is that
dlclose() doesn't unmap the object on some other operating systems.

More to the point, I'm not sure how to fix this.

Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url :

More information about the freebsd-x11 mailing list