From owner-freebsd-current@FreeBSD.ORG Sat Jun 19 16:20:50 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 13BE016A4CE for ; Sat, 19 Jun 2004 16:20:50 +0000 (GMT) Received: from meitner.wh.uni-dortmund.de (meitner.wh.Uni-Dortmund.DE [129.217.129.133]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8803F43D39 for ; Sat, 19 Jun 2004 16:20:49 +0000 (GMT) (envelope-from michaelnottebrock@gmx.net) Received: from lofi.dyndns.org (pc2-105.intern.meitner [10.3.12.105]) by meitner.wh.uni-dortmund.de (Postfix) with ESMTP id 36EA01675A8; Sat, 19 Jun 2004 18:20:28 +0200 (CEST) Received: from kiste.my.domain (kiste.my.domain [192.168.8.4]) (authenticated bits=0) by lofi.dyndns.org (8.12.10/8.12.10) with ESMTP id i5JGKQxm018271 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Sat, 19 Jun 2004 18:20:27 +0200 (CEST) (envelope-from michaelnottebrock@gmx.net) From: Michael Nottebrock To: freebsd-current@FreeBSD.org Date: Sat, 19 Jun 2004 18:20:26 +0200 User-Agent: KMail/1.6.2 MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Boundary-03=_KfG1A8rFm9PbZfd"; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200406191820.26499.michaelnottebrock@gmx.net> X-Virus-Scanned: by amavisd-new X-Content-Filtered-By: Mailman/MimeDel 2.1.1 cc: Frerich Raabe Subject: dlclose problem X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2004 16:20:50 -0000 --Boundary-03=_KfG1A8rFm9PbZfd Content-Type: multipart/mixed; boundary="Boundary-01=_KfG1Audb/22LbFL" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_KfG1Audb/22LbFL Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Attached is a small testcase made by Frerich Raabe (cc'd) which segfaults o= n=20 =2DSTABLE and 5.2.1-R but not on -CURRENT as of June 17th - I can't find wh= at's=20 changed in libc that prevents the segfault though. Any clues? =46rerich had this to say about the problem and testcase (it originally sur= faced=20 in KDE/Qt): > I think this is a flaw in the dlclose() code of the C library. The KDE > styles are implemented as plugins (read: shared libraries) and allocate > memory on the free store, and initialize static variables. > > The problem is that dlclose() does not seem to destruct those statics > properly though, but silently succeeds. Then the main program triggers a > segmentation fault as it tries to call __tfc_0 (an internal g++ function > AFAICS) in the plugin - but the plugin has been unloaded already. > > IMHO the true fix would be to fix the C library. > > I attached a simple testcase which demonstrates the problem using nothing > standard C and C++ library calls, so you don't have to install KDE to=20 > reproduce this crash. Note that making "s" (in plugin.cc) a normal (auto)= =20 > variable and not static does not trigger the crash. =2D-=20 ,_, | Michael Nottebrock | lofi@freebsd.org (/^ ^\) | FreeBSD - The Power to Serve | http://www.freebsd.org \u/ | K Desktop Environment on FreeBSD | http://freebsd.kde.org --Boundary-01=_KfG1Audb/22LbFL-- --Boundary-03=_KfG1A8rFm9PbZfd Content-Type: application/pgp-signature Content-Description: signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQBA1GfKXhc68WspdLARAuWwAJ0Vr4iHXvnSQBiDaEhoMPJerdsW8wCeMaPP LIFNuccW8luzSrCgb5NQUSc= =k/Q8 -----END PGP SIGNATURE----- --Boundary-03=_KfG1A8rFm9PbZfd--