Date: Tue, 20 Apr 2004 16:45:00 -0400 From: Joe Marcus Clarke <marcus@FreeBSD.org> To: freebsd-hackers@FreeBSD.org Subject: Help: threading problem in non-threaded applications Message-ID: <1082493900.837.79.camel@gyros>
next in thread | raw e-mail | index | archive | help
--=-EllP4eIeltJcC0f5zfCY Content-Type: text/plain Content-Transfer-Encoding: quoted-printable I have a problem I'm hoping someone can help me with. GTK+ 2.4 introduced a new file selection GUI which works just fine in threaded and non-threaded applications. However, GNOME 2.6 augmented this dialog with a dynamically loadable threaded shared object. The GNOME version is automatically used by all GTK+ apps when run under a GNOME desktop if libgnomeui is installed. When this object is dynamically loaded into GNOME applications, they work just fine as they are linked to a thread library. However, when a GTK+ non-threaded app tries to load this object, I get a segmentation fault because the pthread_cond_wait() symbol gets found in libc before the thread library, and threaded locking isn't setup. I've tried a lot of things to try and fix this. I tried using dlopen/dlsym to resolve pthread_cond_wait from the thread library, but this doesn't work. I tried setting __isthreaded to 1, but that didn't work (it gets overridden). The only thing that works is to set LD_PRELOAD to the thread library before running the non-threaded app (or fixing the app to link against PTHREAD_LIBS). Is there a better solution to this? This problem only seems to affect 5.X. I'm hoping not to have to link every GTK+ app that might use the new file selector to PTHREAD_LIBS. Any advice would be greatly appreciated. Thanks. Joe --=20 Joe Marcus Clarke FreeBSD GNOME Team :: marcus@FreeBSD.org gnome@FreeBSD.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome --=-EllP4eIeltJcC0f5zfCY Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQBAhYvMb2iPiv4Uz4cRAiCOAKCVApHEGtZOZ6Kcauj9UanrqP/QnQCdEFIT Gd5hJgXBRNXr2RI4b5VnoTI= =Znrg -----END PGP SIGNATURE----- --=-EllP4eIeltJcC0f5zfCY--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1082493900.837.79.camel>