From owner-freebsd-x11@FreeBSD.ORG Mon May 7 12:14:11 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 3C2511065670 for ; Mon, 7 May 2012 12:14:11 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id AAE028FC12 for ; Mon, 7 May 2012 12:14:10 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q47CDriS005430; Mon, 7 May 2012 15:13:53 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q47CDqoO068867; Mon, 7 May 2012 15:13:52 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q47CDqE8068866; Mon, 7 May 2012 15:13:52 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 7 May 2012 15:13:52 +0300 From: Konstantin Belousov To: Peter Jeremy Message-ID: <20120507121352.GM2358@deviant.kiev.zoral.com.ua> References: <20120507114924.GA19126@server.vk2pj.dyndns.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="p5kAXTFF7AV1gnsc" Content-Disposition: inline In-Reply-To: <20120507114924.GA19126@server.vk2pj.dyndns.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-x11@freebsd.org Subject: Re: 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 12:14:11 -0000 --p5kAXTFF7AV1gnsc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 07, 2012 at 09:49:24PM +1000, Peter Jeremy wrote: > 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. >=20 > 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 load= ed. >=20 > http://lists.freebsd.org/pipermail/freebsd-hackers/2007-December/022764.h= tml > covers as similar issue and notes that this approach is doomed to failure. >=20 > 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. >=20 > More to the point, I'm not sure how to fix this. Which OS version do you use ? It was fixed in r211706 and some follow-up commits. The change is not in 8. --p5kAXTFF7AV1gnsc Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk+nvIAACgkQC3+MBN1Mb4jFQwCfUdhNaF7GdhspC6ePW0lHKh63 MlgAn0J6V+Fgp1JVYH7etJTLKLsOlke0 =rwjl -----END PGP SIGNATURE----- --p5kAXTFF7AV1gnsc--