From owner-freebsd-hackers@FreeBSD.ORG Wed Mar 22 11:12:18 2006 Return-Path: X-Original-To: hackers@freebsd.org 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 8EFBA16A401; Wed, 22 Mar 2006 11:12:18 +0000 (UTC) (envelope-from julian@elischer.org) Received: from a50.ironport.com (a50.ironport.com [63.251.108.112]) by mx1.FreeBSD.org (Postfix) with ESMTP id F415443D80; Wed, 22 Mar 2006 11:12:07 +0000 (GMT) (envelope-from julian@elischer.org) Received: from unknown (HELO [192.168.2.4]) ([10.251.60.21]) by a50.ironport.com with ESMTP; 22 Mar 2006 03:12:08 -0800 Message-ID: <44213107.7050808@elischer.org> Date: Wed, 22 Mar 2006 03:12:07 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.11) Gecko/20050727 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Volker Stolz References: <20060322102436.GB54061@i2.informatik.rwth-aachen.de> In-Reply-To: <20060322102436.GB54061@i2.informatik.rwth-aachen.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: hackers@freebsd.org Subject: Re: 6.1 libpthread: pthread_create and _pq_insert_tail: Already in priority queue X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Mar 2006 11:12:18 -0000 Volker Stolz wrote: >A rather largish application (the most recent version of GHC, see lang/ghc) >fails in its runtime system with: > >_pq_insert_tail: Already in priority queue > >Basically some threads and mutexes are involved, then the application forks, some more threads >are created and then I get this error on a pthread_create(). > >If I use libmap.conf to map libpthread to either libthr or libc_r, the error >doesn't occur. I'm a bit baffled by this...any pointers are welcome! > >This is mentioned on some MySQL-lists as well, but never with an explanation :| >Maybe the runtime is violation some assumptions on what it should be able to do >with threads, but I couldn't find anything "interesting". > >Cheers, > Volker > > This is probably the old "The pthead standard says that after a fork a pthreaded child can only do async-safe library calls (those that are safe for signals), before it does an exec() (which it almost must do). The parent can of course continue on doing normal work.. All othe rthreads in teh child will have been uncerimoniously killed.