Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 May 2012 21:49:24 +1000
From:      Peter Jeremy <peterjeremy@acm.org>
To:        freebsd-x11@freebsd.org
Subject:   GL Programs SEGV on exit()
Message-ID:  <20120507114924.GA19126@server.vk2pj.dyndns.org>

next in thread | raw e-mail | index | archive | help

--3MwIy2ne0vdjdPXF
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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/swrast_dri.so)
- Mesa-7.11.2/src/glsl/ralloc.c:ralloc_autofree_context() within
  swrast_dri.so calls atexit(autofree) - whics is also in swrast_dri.so
- dri does dlclose(swrast_dri.so) which unmaps the code
- main thread calls exit()
- atexit processing jumps to the address where autofree() used to be loaded.

http://lists.freebsd.org/pipermail/freebsd-hackers/2007-December/022764.html
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.

--=20
Peter Jeremy

--3MwIy2ne0vdjdPXF
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iEYEARECAAYFAk+ntsQACgkQ/opHv/APuIdZFwCgpBIy8FtZg3cpdZY/ikAQlmqw
9EIAoLJ+9456Au/IcZQIYjpfaeAaTHkI
=9OQw
-----END PGP SIGNATURE-----

--3MwIy2ne0vdjdPXF--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120507114924.GA19126>