Date: Tue, 17 Apr 2001 10:51:48 -0400 From: Dan Eischen <eischen@vigrid.com> To: Akinori MUSHA <knu@iDaemons.org> Cc: deischen@FreeBSD.org, hackers@FreeBSD.org Subject: Re: bin/25110 Message-ID: <3ADC5884.F48D58BD@vigrid.com> References: <86elury85r.wl@archon.local.idaemons.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <errno.h> +#include <signal.h> #include <string.h> #include <stdlib.h> #include <unistd.h> @@ -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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3ADC5884.F48D58BD>