From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24231 invoked from network); 7 Dec 2007 11:28:48 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 7 Dec 2007 11:28:48 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 37154 invoked from network); 7 Dec 2007 11:28:45 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 7 Dec 2007 11:28:45 -0000 Received: (qmail 23991 invoked by alias); 7 Dec 2007 11:28:38 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24179 Received: (qmail 23979 invoked from network); 7 Dec 2007 11:28:38 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 7 Dec 2007 11:28:38 -0000 Received: (qmail 36400 invoked from network); 7 Dec 2007 11:28:38 -0000 Received: from cluster-g.mailcontrol.com (85.115.41.190) by a.mx.sunsite.dk with SMTP; 7 Dec 2007 11:28:32 -0000 Received: from rly09g.srv.mailcontrol.com (localhost.localdomain [127.0.0.1]) by rly09g.srv.mailcontrol.com (MailControl) with ESMTP id lB7BS2KU008425 for ; Fri, 7 Dec 2007 11:28:29 GMT Received: from submission.mailcontrol.com (submission.mailcontrol.com [86.111.216.190]) by rly09g.srv.mailcontrol.com (MailControl) id lB7BRMiF006034 for zsh-workers@sunsite.dk; Fri, 7 Dec 2007 11:27:22 GMT Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly09g-eth0.srv.mailcontrol.com (envelope-sender Peter.Stephenson@csr.com) (MIMEDefang) with ESMTP id lB7BRC1K004855; Fri, 07 Dec 2007 11:27:21 +0000 (GMT) Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.1830); Fri, 7 Dec 2007 11:27:12 +0000 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.14.1/8.13.4) with ESMTP id lB7BRC2f012716; Fri, 7 Dec 2007 11:27:12 GMT Received: from csr.com (pws@localhost) by news01.csr.com (8.14.1/8.14.1/Submit) with ESMTP id lB7BRC1F012713; Fri, 7 Dec 2007 11:27:12 GMT Message-Id: <200712071127.lB7BRC1F012713@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: Guillaume Chazarain , "Zsh Hackers' List" Subject: Re: deadlock caused by gettext usage in a signal handler In-reply-to: <071207032122.ZM25420@torch.brasslantern.com> References: <20071130203534.1d1ea29c@inria.fr> <20071204203017.35a29727.p.w.stephenson@ntlworld.com> <20071207000207.2eb7e5e7@inria.fr> <20071207103533.47776664@news01> <20071207114631.7fa1eab9@inria.fr> <071207032122.ZM25420@torch.brasslantern.com> Comments: In-reply-to Bart Schaefer message dated "Fri, 07 Dec 2007 03:21:22 -0800." Date: Fri, 07 Dec 2007 11:27:12 +0000 From: Peter Stephenson X-OriginalArrivalTime: 07 Dec 2007 11:27:12.0823 (UTC) FILETIME=[1CD07C70:01C838C4] X-Scanned-By: MailControl A-06-00-00 (www.mailcontrol.com) on 10.71.1.119 Bart Schaefer wrote: > On Dec 7, 11:46am, Guillaume Chazarain wrote: > } > } Ok, but I don't mind changing it to queue_signals(). > > I think that might be better anyway, because I'm not sure that > sigfillset() et al. are as portable as the code that queue_signals() > encapsulates. That's already worked around... we use the same code Guillaume just added in zhandler(), unconditionally. It's fixed up by definitions in the header. However, it's trivial to make it consistent with other places... Index: Src/exec.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/exec.c,v retrieving revision 1.125 diff -u -r1.125 exec.c --- Src/exec.c 7 Dec 2007 10:33:58 -0000 1.125 +++ Src/exec.c 7 Dec 2007 11:25:54 -0000 @@ -229,7 +229,6 @@ { pid_t pid; struct timezone dummy_tz; - sigset_t signals; /* * Is anybody willing to explain this test? @@ -240,10 +239,9 @@ } if (tv) gettimeofday(tv, &dummy_tz); - sigfillset(&signals); - signals = signal_block(signals); + queue_signals(); pid = fork(); - signal_setmask(signals); + unqueue_signals(); if (pid == -1) { zerr("fork failed: %e", errno); return -1; -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070