From owner-freebsd-current Tue Oct 29 12:16:50 2002 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 3010237B401 for ; Tue, 29 Oct 2002 12:16:49 -0800 (PST) Received: from flamingo.mail.pas.earthlink.net (flamingo.mail.pas.earthlink.net [207.217.120.232]) by mx1.FreeBSD.org (Postfix) with ESMTP id E0BC143E3B for ; Tue, 29 Oct 2002 12:16:48 -0800 (PST) (envelope-from tlambert2@mindspring.com) Received: from pool0057.cvx22-bradley.dialup.earthlink.net ([209.179.198.57] helo=mindspring.com) by flamingo.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 186cn7-0004iQ-00; Tue, 29 Oct 2002 12:16:45 -0800 Message-ID: <3DBEEC61.A874B55C@mindspring.com> Date: Tue, 29 Oct 2002 12:15:29 -0800 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Doug Rabson Cc: current@freebsd.org Subject: Re: gnome on current References: <20021029121706.L97929-100000@herring.nlsystems.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Doug Rabson wrote: > On investigating one of the crashes more carefully, I discovered that all > calls to pthread_*() were being resolved to stubs in libXThrStub.so in > spite of the fact that libc_r was also loaded. This caused problems for > e.g. flockfile which failed to initialise its mutex (uthread_mutex.c's > init_static calls pthread_mutex_init instead of _pthread_mutex_init and > ends up in libXThrStub). After working around that, I had more fun where > one of the gnome libs tried to call pthread_getspecific(). > > Why isn't the linker resolving these symbols against the ones in libc_r? > For some reason, libc_r defines them weakly so they get resolved by the > first weak definition in the list of libs, which in this case is > libXThrStub :-( So that people who know what they are doing can implement their own versions of the code do in.strument things like "open". Unfortunately, the people who wrote libXThrStub.so apparently didn't know what they were doing... Or, more likely, you are not supposed to be linking against library at all, if you have a working threads library... I feel pretty safe guessing that, given that it's name seems to le "X Threads Stub Library". -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message