From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19260 invoked from network); 1 May 2007 09:41:50 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.8 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 1 May 2007 09:41:50 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 49815 invoked from network); 1 May 2007 09:41:45 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 1 May 2007 09:41:45 -0000 Received: (qmail 25585 invoked by alias); 1 May 2007 09:41:41 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23371 Received: (qmail 25576 invoked from network); 1 May 2007 09:41:40 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 1 May 2007 09:41:40 -0000 Received: (qmail 49482 invoked from network); 1 May 2007 09:41:40 -0000 Received: from cluster-c.mailcontrol.com (168.143.177.190) by a.mx.sunsite.dk with SMTP; 1 May 2007 09:41:37 -0000 Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly23c.srv.mailcontrol.com (MailControl) with ESMTP id l419a8dD027607 for ; Tue, 1 May 2007 10:41:24 +0100 Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.1830); Tue, 1 May 2007 10:38:57 +0100 Date: Tue, 1 May 2007 10:38:57 +0100 From: Peter Stephenson To: zsh-workers@sunsite.dk Subject: Re: [Patch] Fix race with signals in signal_block() Message-Id: <20070501103857.e9cf734a.pws@csr.com> In-Reply-To: <4636477B.8050608@yahoo.fr> References: <4636477B.8050608@yahoo.fr> Organization: Cambridge Silicon Radio X-Mailer: Sylpheed version 2.2.10 (GTK+ 2.10.8; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 01 May 2007 09:38:57.0542 (UTC) FILETIME=[8A724260:01C78BD4] X-Scanned-By: MailControl A-06-00-00 (www.mailcontrol.com) on 10.67.0.133 Guillaume Chazarain wrote: > Here is patch to fix a bug where zsh can become unkillable (except of > course with SIGKILL), I use Linux-2.6/i386 so the POSIX_SIGNALS macro > is defined. > > signal_block() and signal_unblock() use two global variables > dummy_sigset1 and dummy_sigset2. I observed a race between > child_block() and > oldmask = signal_block(newmask); /* Block all signals temporarily */ > called in the zhandler() signal handler. > > The attached patch fixes the problem by getting rid of the global > variables, and instead using the signal_block() and signal_unblock() > functions. Looking at your patch, it's hard to see what it wasn't done that way before... I couldn't see anything obviously wrong and I've committed it. Thanks. -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview