From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16269 invoked by alias); 22 Jun 2004 22:07:14 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 16246 invoked from network); 22 Jun 2004 22:07:14 -0000 Received: from unknown (HELO sunsite.ms.mff.cuni.cz) (195.113.15.26) by sourceware.org with SMTP; 22 Jun 2004 22:07:14 -0000 Received: from sunsite.ms.mff.cuni.cz (sunsite.mff.cuni.cz [127.0.0.1]) by sunsite.ms.mff.cuni.cz (8.12.8/8.12.8) with ESMTP id i5MJqb3j016688; Tue, 22 Jun 2004 21:52:37 +0200 Received: (from jakub@localhost) by sunsite.ms.mff.cuni.cz (8.12.8/8.12.8/Submit) id i5MJqbgv016686; Tue, 22 Jun 2004 21:52:37 +0200 Date: Tue, 22 Jun 2004 22:07:00 -0000 From: Jakub Jelinek To: Thorsten Kukuk Cc: libc-hacker@sources.redhat.com Subject: Re: deadlock in signal handler with NPTL Message-ID: <20040622195237.GK5191@sunsite.ms.mff.cuni.cz> Reply-To: Jakub Jelinek References: <20040622215059.GA1204@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040622215059.GA1204@suse.de> User-Agent: Mutt/1.4i X-SW-Source: 2004-06/txt/msg00044.txt.bz2 On Tue, Jun 22, 2004 at 11:50:59PM +0200, Thorsten Kukuk wrote: > > Hi, > > I got the following test program. I know, it is very ugly and there > are a lot of things somebody should not do, but this is something > what programs like sshd are doing. Then they should be fixed. Neither syslog, nor printf, nor fflush are supposed to be async-signal safe, nor they actually are in glibc. > The problem is: This program deadlocks very fast in a FUTEX_WAIT > call. This does not happen with LinuxThreads. Try linking the program with -lpthread and retry with LinuxThreads. It will hang the same way. The thing is that NPTL uses locking (on IA-32/x86-64 without lock prefix) even when -lpthread has not been linked in. Jakub