From owner-freebsd-hackers Tue Apr 17 7:42:26 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from pcnet1.pcnet.com (pcnet1.pcnet.com [204.213.232.3]) by hub.freebsd.org (Postfix) with ESMTP id 34FE237B424; Tue, 17 Apr 2001 07:42:23 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from vigrid.com (pm3-pt19.pcnet.net [206.105.29.93]) by pcnet1.pcnet.com (8.8.7/PCNet) with ESMTP id KAA28054; Tue, 17 Apr 2001 10:41:33 -0400 (EDT) Message-ID: <3ADC5884.F48D58BD@vigrid.com> Date: Tue, 17 Apr 2001 10:51:48 -0400 From: Dan Eischen X-Mailer: Mozilla 4.5 [en] (X11; I; FreeBSD 5.0-CURRENT i386) X-Accept-Language: en MIME-Version: 1.0 To: Akinori MUSHA Cc: deischen@FreeBSD.org, hackers@FreeBSD.org Subject: Re: bin/25110 References: <86elury85r.wl@archon.local.idaemons.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Akinori MUSHA wrote: > > Hi, > > Would you take a look at PR#25110 ? Some programs are suffering with > a problem that with the threaded library a process cannot receive due > signals except SIGKILL and SIGSTOP from its children and thus it > stalls at waitpid() after forking. > > The PR precisely describes the underlying cause and points out how you > can examine and solve the problem. > > I'd appreciate if you or someone else with a clue could deal with it. You can try the patch below. I think I've posted this patch before, but I guess I never committed it. -- Dan Eischen Index: uthread/uthread_fork.c =================================================================== RCS file: /opt/b/CVS/src/lib/libc_r/uthread/uthread_fork.c,v retrieving revision 1.23 diff -u -r1.23 uthread_fork.c --- uthread/uthread_fork.c 2001/04/10 04:25:49 1.23 +++ uthread/uthread_fork.c 2001/04/17 14:44:37 @@ -32,6 +32,7 @@ * $FreeBSD: src/lib/libc_r/uthread/uthread_fork.c,v 1.23 2001/04/10 04:25:49 deischen Exp $ */ #include +#include #include #include #include @@ -112,7 +113,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-hackers" in the body of the message