From owner-freebsd-x11@FreeBSD.ORG Mon May 7 11:49:37 2012 Return-Path: Delivered-To: freebsd-x11@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95A89106566C for ; Mon, 7 May 2012 11:49:37 +0000 (UTC) (envelope-from peterjeremy@acm.org) Received: from mail11.syd.optusnet.com.au (mail11.syd.optusnet.com.au [211.29.132.192]) by mx1.freebsd.org (Postfix) with ESMTP id 283B78FC12 for ; Mon, 7 May 2012 11:49:37 +0000 (UTC) Received: from server.vk2pj.dyndns.org (c220-239-251-180.belrs5.nsw.optusnet.com.au [220.239.251.180]) by mail11.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q47BnTRD003550 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 7 May 2012 21:49:30 +1000 X-Bogosity: Ham, spamicity=0.000000 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.5/8.14.4) with ESMTP id q47BnQY2030570 for ; Mon, 7 May 2012 21:49:26 +1000 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.5/8.14.5/Submit) id q47BnOse030554 for freebsd-x11@freebsd.org; Mon, 7 May 2012 21:49:24 +1000 (EST) (envelope-from peter) Date: Mon, 7 May 2012 21:49:24 +1000 From: Peter Jeremy To: freebsd-x11@freebsd.org Message-ID: <20120507114924.GA19126@server.vk2pj.dyndns.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3MwIy2ne0vdjdPXF" Content-Disposition: inline X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.21 (2010-09-15) Subject: GL Programs SEGV on exit() X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 May 2012 11:49:37 -0000 --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--