From owner-freebsd-hackers Wed Aug 7 14:56:50 2002 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 92BC637B400 for ; Wed, 7 Aug 2002 14:56:47 -0700 (PDT) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 404B543E3B for ; Wed, 7 Aug 2002 14:56:47 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.12.5/8.12.4) with ESMTP id g77Luldc000928; Wed, 7 Aug 2002 14:56:47 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.5/8.12.4/Submit) id g77Lulgi000927; Wed, 7 Aug 2002 14:56:47 -0700 (PDT) (envelope-from dillon) Date: Wed, 7 Aug 2002 14:56:47 -0700 (PDT) From: Matthew Dillon Message-Id: <200208072156.g77Lulgi000927@apollo.backplane.com> To: John Polstra Cc: hackers@FreeBSD.ORG Subject: Re: Help needed. Deadlock in rtld makes openoffice build hang ag References: <20020807231439.F58571-100000@levais.imp.ch> <200208072132.g77LWOBD058671@vashon.polstra.com> <200208072140.g77LeL2b000769@apollo.backplane.com> <200208072146.g77Lkke8058706@vashon.polstra.com> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG :In article <200208072140.g77LeL2b000769@apollo.backplane.com>, :Matthew Dillon wrote: :> :> If it's a matter of one thread hogging the cpu and the other (which :> holds the lock) not being able to run to completion, maybe putting :> the sleep back in would work. : : :Yes, that was the original idea behind the sleeps. But in practice :it doesn't work, because the rtld isn't really linked with the rest :of the application. When the rtld calls nanosleep(), it's getting :the real system call rather than the threads package's version. : :John :-- : John Polstra : John D. Polstra & Co., Inc. Seattle, Washington USA So the only solution may be a callback vector to switch threads that the application can set. Martin's earlier comment in regards to the problem occuring in exit() led me to search for 'atexit' use inside rtld-elf. I found a comment in rtld_start.S (for i386) but no direct link. If there is an at-exit function it could be deadlocking against a thread trying to cause the program to exit. Odd, but possible. Judicious use of write()'s to stderr (descriptor 2) on Martin's part may shed some light on exactly how the deadlock is occuring. (I'm getting into this conversation late. I am actually on vacation and will not have email access for about a week starting in about a day). -Matt Matthew Dillon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message