From owner-freebsd-current Fri Mar 9 10: 0:46 2001 Delivered-To: freebsd-current@freebsd.org Received: from pcnet1.pcnet.com (pcnet1.pcnet.com [204.213.232.3]) by hub.freebsd.org (Postfix) with ESMTP id 5447E37B719; Fri, 9 Mar 2001 10:00:43 -0800 (PST) (envelope-from eischen@vigrid.com) Received: (from eischen@localhost) by pcnet1.pcnet.com (8.8.7/PCNet) id NAA20426; Fri, 9 Mar 2001 13:00:11 -0500 (EST) Date: Fri, 9 Mar 2001 13:00:09 -0500 (EST) From: Daniel Eischen To: James FitzGibbon Cc: freebsd-current@FreeBSD.ORG Subject: Re: PR bin/25110 - pthreads signal handling problem In-Reply-To: <20010309122047.A34827@targetnet.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, 9 Mar 2001, James FitzGibbon wrote: > I'm wondering if anyone has the time or inclination to take a look at a fix > for PR bin/25110. We're having problems using a freshly-built 4.2-stable > box (technically 4.3 rc at this point), and the bug is still present. > > I'm not sure how many people would see this problem (we see it because we > have to compile Apache 1.x with the -pthread switch due to add-on modules > that are threaded). Under 4.1-stable, everything was fine. At some point > between 4.1-stable and 4.2-release, something changed, but my hunt through > the CVS repository hasn't revealed anything obvious. > > In any case, it's a repeatable bug (the PR includes a code sample) and > unless looked at, it will be a bug in 4.3-release. > > If there's any clarification needed, please let me know. You can try the included patch. -- Dan Eischen Index: uthread_fork.c =================================================================== RCS file: /opt/FreeBSD/cvs/src/lib/libc_r/uthread/uthread_fork.c,v retrieving revision 1.21 diff -u -r1.21 uthread_fork.c --- uthread_fork.c 2001/01/24 13:03:33 1.21 +++ uthread_fork.c 2001/03/09 17:53:37 @@ -32,6 +32,7 @@ * $FreeBSD: src/lib/libc_r/uthread/uthread_fork.c,v 1.21 2001/01/24 13:03:33 deischen Exp $ */ #include +#include #include #include #include @@ -110,7 +111,16 @@ else if (_pq_init(&_readyq) != 0) { /* Abort this application: */ PANIC("Cannot initialize priority ready queue."); - } else { + } else if ((_thread_sigstack.ss_sp == NULL) && + ((_thread_sigstack.ss_sp = malloc(SIGSTKSZ)) == NULL)) + PANIC("Unable to allocate alternate signal stack"); + else { + /* Install the alternate signal stack: */ + _thread_sigstack.ss_size = SIGSTKSZ; + _thread_sigstack.ss_flags = 0; + if (__sys_sigaltstack(&_thread_sigstack, NULL) != 0) + PANIC("Unable to install alternate signal stack"); + /* * Enter a loop to remove all threads other than * the running thread from the thread list: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message