Date: Sat, 19 Jun 2004 18:20:26 +0200 From: Michael Nottebrock <michaelnottebrock@gmx.net> To: freebsd-current@FreeBSD.org Cc: Frerich Raabe <raabe@kde.org> Subject: dlclose problem Message-ID: <200406191820.26499.michaelnottebrock@gmx.net>
next in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200406191820.26499.michaelnottebrock>