From owner-freebsd-threads@FreeBSD.ORG Mon Apr 18 14:28:09 2005 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6911216A4CE; Mon, 18 Apr 2005 14:28:09 +0000 (GMT) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id EEC3243D2F; Mon, 18 Apr 2005 14:28:08 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) j3IES7nI016206; Mon, 18 Apr 2005 10:28:07 -0400 (EDT) Date: Mon, 18 Apr 2005 10:28:07 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Archie Cobbs In-Reply-To: <4263BC94.9040308@dellroad.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) cc: David Xu cc: freebsd-threads@freebsd.org Subject: Re: Bug with pthread_getspecific() and signals X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Daniel Eischen List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2005 14:28:09 -0000 On Mon, 18 Apr 2005, Archie Cobbs wrote: > Daniel Eischen wrote: > >>Does POSIX say that pthread_getspecific can be used in signal handler ? > > > > I don't think using it in a signal handler should cause a problem > > for our implementation though. Probably the real problem is that > > the signal handler is not running in the expected thread. I'd > > double check the signal masks and make sure there is only one > > thread that could possibly handle the signal. > > This is a synchronous signal (SIGSEGV) and it's occurring in > application code. So it should be delivered to the thread that > caused it, right? That's what almost always happens. I don't think libc_r differentiates between synchronous and asynchronous signals. It'll look for threads in sigwait(), then sigsuspend(), then any thread with the signal unmasked. > Still working on a simple test case... if you want a large and complex > test case I have that already... :-) Try -stable or -current with libpthread and libthr. -- DE