From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 20 13:44:54 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4F12B16A4CE for ; Tue, 20 Apr 2004 13:44:54 -0700 (PDT) Received: from creme-brulee.marcuscom.com (rrcs-midsouth-24-172-16-118.biz.rr.com [24.172.16.118]) by mx1.FreeBSD.org (Postfix) with ESMTP id C872A43D1D for ; Tue, 20 Apr 2004 13:44:53 -0700 (PDT) (envelope-from marcus@FreeBSD.org) Received: from [10.2.1.4] (vpn-client-4.marcuscom.com [10.2.1.4]) i3KKhrPb094529 for ; Tue, 20 Apr 2004 16:43:53 -0400 (EDT) (envelope-from marcus@FreeBSD.org) From: Joe Marcus Clarke To: freebsd-hackers@FreeBSD.org Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-EllP4eIeltJcC0f5zfCY" Organization: FreeBSD, Inc. Message-Id: <1082493900.837.79.camel@gyros> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Tue, 20 Apr 2004 16:45:00 -0400 X-Spam-Status: No, hits=-4.9 required=5.0 tests=BAYES_00 autolearn=ham version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on creme-brulee.marcuscom.com Subject: Help: threading problem in non-threaded applications X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2004 20:44:54 -0000 --=-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--