From owner-freebsd-hackers Tue Apr 17 10:33:57 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.musha.org (daemon.musha.org [61.122.44.178]) by hub.freebsd.org (Postfix) with ESMTP id 2C98E37B423; Tue, 17 Apr 2001 10:33:46 -0700 (PDT) (envelope-from knu@iDaemons.org) Received: from archon.local.idaemons.org (archon.local.idaemons.org [192.168.1.32]) by mail.musha.org (Postfix) with ESMTP id F3E084DF47; Wed, 18 Apr 2001 02:33:44 +0900 (JST) Date: Wed, 18 Apr 2001 02:33:44 +0900 Message-ID: <868zkzxwg7.wl@archon.local.idaemons.org> From: "Akinori MUSHA" To: deischen@FreeBSD.org, Cc: hackers@FreeBSD.org, jagarl@creator.club.ne.jp Subject: Re: bin/25110 In-Reply-To: <3ADC5884.F48D58BD@vigrid.com> References: <86elury85r.wl@archon.local.idaemons.org> <3ADC5884.F48D58BD@vigrid.com> User-Agent: Wanderlust/2.5.4 (Smooth) SEMI/1.14.2 (=?ISO-8859-1?Q?Daish=F2?= =?ISO-8859-1?Q?ji?=) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 MULE XEmacs/21.1 (patch 14) (Cuyahoga Valley) (i386--freebsd) Organization: Associated I. Daemons X-PGP-Public-Key: finger knu@FreeBSD.org X-PGP-Fingerprint: 081D 099C 1705 861D 4B70 B04A 920B EFC7 9FD9 E1EE MIME-Version: 1.0 (generated by SEMI 1.14.2 - =?ISO-8859-1?Q?=22Daish=F2ji=22?=) Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Thanks for the quick reply! At Tue, 17 Apr 2001 10:51:48 -0400, Dan Eischen wrote: > Akinori MUSHA wrote: > > 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. I tested your patch with the latest 4-STABLE and the latest 5-CURRENT, and both passed my test programs that didn't work before! Of course, the test program provided in the PR by Ueno-san also worked properly. Attached is the patch I used for 4-STABLE. Now Dan, do you consider sliding it into 4.3-RELEASE? The problem had been reported, you recognized and posted a fix, and the fix looks reasonable and indeed works. I would be great to see 4.3-RELEASE shipped with the fork-safe libc_r. If you are sure it's a mature fix, I'd like you to pester jkh for approval. :) Regards, -- / /__ __ Akinori.org / MUSHA.org / ) ) ) ) / FreeBSD.org / Ruby-lang.org Akinori MUSHA aka / (_ / ( (__( @ iDaemons.org / and.or.jp "Freeze this moment a little bit longer, make each impression a little bit stronger.. Experience slips away -- Time stand still" Index: uthread/uthread_fork.c =================================================================== RCS file: /home/ncvs/src/lib/libc_r/uthread/uthread_fork.c,v retrieving revision 1.19.2.1 diff -u -r1.19.2.1 uthread_fork.c --- uthread/uthread_fork.c 2000/11/09 23:46:03 1.19.2.1 +++ uthread/uthread_fork.c 2001/04/17 17:07:43 @@ -32,6 +32,7 @@ * $FreeBSD: src/lib/libc_r/uthread/uthread_fork.c,v 1.19.2.1 2000/11/09 23:46:03 deischen Exp $ */ #include +#include #include #include #include @@ -108,7 +109,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 (_thread_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