From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28529 invoked from network); 6 Dec 2007 23:09:12 -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.6 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; 6 Dec 2007 23:09:12 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 96865 invoked from network); 6 Dec 2007 23:09:01 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 6 Dec 2007 23:09:01 -0000 Received: (qmail 23412 invoked by alias); 6 Dec 2007 23:08:55 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24170 Received: (qmail 23394 invoked from network); 6 Dec 2007 23:08:54 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 6 Dec 2007 23:08:54 -0000 Received: (qmail 96478 invoked from network); 6 Dec 2007 23:08:54 -0000 Received: from smtp3-g19.free.fr (212.27.42.29) by a.mx.sunsite.dk with SMTP; 6 Dec 2007 23:08:48 -0000 Received: from smtp3-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp3-g19.free.fr (Postfix) with ESMTP id 4704317BC79 for ; Fri, 7 Dec 2007 00:08:46 +0100 (CET) Received: from localhost.localdomain (bar06-2-82-224-157-131.fbx.proxad.net [82.224.157.131]) by smtp3-g19.free.fr (Postfix) with ESMTP id 0945F17B5F9 for ; Fri, 7 Dec 2007 00:08:45 +0100 (CET) Date: Fri, 7 Dec 2007 00:02:07 +0100 From: Guillaume Chazarain To: Zsh Hackers' List Subject: Re: deadlock caused by gettext usage in a signal handler Message-ID: <20071207000207.2eb7e5e7@inria.fr> In-Reply-To: <20071204203017.35a29727.p.w.stephenson@ntlworld.com> References: <20071130203534.1d1ea29c@inria.fr> <20071204203017.35a29727.p.w.stephenson@ntlworld.com> X-Mailer: Claws Mail 3.0.2 (GTK+ 2.10.14; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Le Tue, 4 Dec 2007 20:30:17 +0000, Peter Stephenson a =C3=A9crit : > That leaves me wondering if forking might be > the problem; do we need to queue signals around there? It's not obvious > why that would be. It appears that glibc's fork is playing with locks: http://sourceware.org/cgi-bin/cvsweb.cgi/libc/nptl/sysdeps/unix/sysv/linux/= fork.c?rev=3D1.11.2.3&content-type=3Dtext/x-cvsweb-markup&cvsroot=3Dglibc This patch solved the problem for me: diff --git a/Src/exec.c b/Src/exec.c index cf79ea8..6f16b9e 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -229,6 +229,7 @@ zfork(struct timeval *tv) { pid_t pid; struct timezone dummy_tz; + sigset_t signals; =20 /* * Is anybody willing to explain this test? @@ -239,7 +240,10 @@ zfork(struct timeval *tv) } if (tv) gettimeofday(tv, &dummy_tz); + sigfillset(&signals); + signals =3D signal_block(signals); pid =3D fork(); + signal_setmask(signals); if (pid =3D=3D -1) { zerr("fork failed: %e", errno); return -1; Thanks. --=20 Guillaume