From owner-freebsd-threads@FreeBSD.ORG Thu May 29 13:56:49 2003 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 8A2B337B401 for ; Thu, 29 May 2003 13:56:49 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id E86AC43F85 for ; Thu, 29 May 2003 13:56:48 -0700 (PDT) (envelope-from eischen@pcnet.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h4TKulNc029708; Thu, 29 May 2003 16:56:47 -0400 (EDT) Date: Thu, 29 May 2003 16:56:47 -0400 (EDT) From: Daniel Eischen To: Alexander Kabaev In-Reply-To: <20030529164629.5963bde9.ak03@gte.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Martin Blapp cc: freebsd-threads@freebsd.org Subject: Re: lock with openoffice build with libkse X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2003 20:56:49 -0000 On Thu, 29 May 2003, Alexander Kabaev wrote: > On Thu, 29 May 2003 16:29:23 -0400 (EDT) > Daniel Eischen wrote: > > > On Thu, 29 May 2003, Alexander Kabaev wrote: > > > > > Daniel, > > > > > > attached program is enough to trigger the loop. It looks like > > > the setjump/longjmp from signal handler trick only forks for > > > the first time. > > > > You can try this patch. It puts the cart before the horse > > though, so signals could get delivered in a different > > order. > > Yuck :(. Shouldn't you just unblock this particular signal instead of > setting the whole mask? If it never returns from the handler (longjmp's out), then the signal mask will never be correct. You have to set the mask back to what it would be if sigreturn() were called. Ok, this fix should be better. -- Dan Eischen Index: thread/thr_sigprocmask.c =================================================================== RCS file: /home/ncvs/src/lib/libpthread/thread/thr_sigprocmask.c,v retrieving revision 1.13 diff -u -r1.13 thr_sigprocmask.c --- thread/thr_sigprocmask.c 16 Sep 2002 08:45:36 -0000 1.13 +++ thread/thr_sigprocmask.c 29 May 2003 20:55:28 -0000 @@ -44,5 +44,8 @@ int _sigprocmask(int how, const sigset_t *set, sigset_t *oset) { - return (pthread_sigmask(how, set, oset)); + if (_kse_isthreaded() != 0) + return (pthread_sigmask(how, set, oset)); + else + return (__sys_sigprocmask(how, set, oset)); }