From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14616 invoked from network); 1 May 2005 18:57:04 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 1 May 2005 18:57:04 -0000 Received: (qmail 14980 invoked from network); 1 May 2005 18:56:59 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 1 May 2005 18:56:59 -0000 Received: (qmail 22096 invoked by alias); 1 May 2005 18:56:56 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21221 Received: (qmail 22082 invoked from network); 1 May 2005 18:56:55 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 1 May 2005 18:56:55 -0000 Received: (qmail 14718 invoked from network); 1 May 2005 18:56:55 -0000 Received: from lakermmtao03.cox.net (68.230.240.36) by a.mx.sunsite.dk with SMTP; 1 May 2005 18:56:50 -0000 Received: from quark.hightek.org ([68.12.75.33]) by lakermmtao03.cox.net (InterMail vM.6.01.04.00 201-2131-118-20041027) with ESMTP id <20050501185647.HEAV18229.lakermmtao03.cox.net@quark.hightek.org> for ; Sun, 1 May 2005 14:56:47 -0400 Received: by quark.hightek.org (Postfix, from userid 501) id 05DF84583E; Sun, 1 May 2005 13:54:48 -0500 (CDT) Date: Sun, 1 May 2005 13:54:47 -0500 From: Vincent Stemen To: Zsh hackers list Subject: Re: localtraps Message-ID: <20050501185447.GA24296@quark.hightek.org> References: <20050425063521.GA17598@quark.hightek.org> <1050425163202.ZM25027@candle.brasslantern.com> <20050426030308.GA21501@quark.hightek.org> <200504261834.j3QIYHSa018951@news01.csr.com> <1050427053638.ZM28743@candle.brasslantern.com> <200504270954.j3R9sujP029445@news01.csr.com> <1050427140931.ZM29524@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1050427140931.ZM29524@candle.brasslantern.com> User-Agent: Mutt/1.4.1i X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 On Wed, Apr 27, 2005 at 02:09:31PM +0000, Bart Schaefer wrote: > On Apr 27, 10:54am, Peter Stephenson wrote: > } > } OK, this one's fairly straightforward: starttrapscope() and > } endtrapscope() don't run inside traps. > > This works much better now, though there's still this extra newline > being printed just before INNER on each alternate interrupt: > ... > > Plus the prompt not reprinted until accept-line or send-break, but that > probably isn't a bug. > > } Are we reasonably confident the other problems are specific to the > } NetBSD style of signal handling? > > I'm not confident of that, no. Let's wait and see what Vincent has to > say after this patch is applied. Sorry about being a bit slow about getting back to you on this. Thanks Bart for letting me know this thread was moved to zsh-workers. I checked out zsh-4.2.5 from CVS and then updated to the zsh-4_2-patches branch. It still does not work correctly but the behavior has changed. In the results below, I will refer to zsh-4.2.1 as "oldz" and the patched 4.2.5 as "newz". #======== ========== sigterm1() { # setopt LOCAL_TRAPS trap sigterm2 TERM echo "sigterm1(): sending SIGTERM" kill -s TERM $$ # trap sigterm1 TERM sleep 1 } sigterm2() { echo "sigterm2()" } trap sigterm1 TERM echo echo "main: sending SIGTERM" kill -s TERM $$ echo "main: sending SIGTERM" kill -s TERM $$ #======== ========== ** Uncomment "setopt LOCAL_TRAPS" main: sending SIGTERM sigterm1(): sending SIGTERM sigterm2() main: sending SIGTERM sigterm2() As we already know, localtraps is ignored. main: sending SIGTERM sigterm1(): sending SIGTERM sigterm1(): sending SIGTERM sigterm1(): sending SIGTERM sigterm1(): sending SIGTERM ^C Continued indefinitely. The "trap sigterm2 TERM" statement is ignored when localtraps is on. ** Comment out "setopt LOCAL_TRAPS" and uncomment "trap sigterm1 TERM" in sigterm1() to try to accomplish the same thing without localopts. main: sending SIGTERM sigterm1(): sending SIGTERM sigterm1(): sending SIGTERM sigterm1(): sending SIGTERM sigterm1(): sending SIGTERM ^C main: sending SIGTERM sigterm1(): sending SIGTERM sigterm1(): sending SIGTERM sigterm1(): sending SIGTERM sigterm1(): sending SIGTERM ^C main: sending SIGTERM sigterm1(): sending SIGTERM sigterm2() main: sending SIGTERM sigterm1(): sending SIGTERM sigterm2() newz is the same as oldz. It works under BSD-sh because it processes the signal immediately so that it does not execute the "trap sigterm1 TERM" before calling the sig handler again. This is the desired behavior. On a side note, even though the binaries all seemed to compile OK, I got a compilation error on NetBSD with 4.2.5 with the zsh-4_2-patches that looks to me like a failure in generating the manuals. Here is the error. ------------------------------------------------------------- rm -f zleparameter.so gcc -s -Wl,-x -shared --whole-archive -o zleparameter.so zleparameter..o -ltermcap -lm -lc ( echo 'STARTDEF()'; echo 'def(version)(0)('4.2.5')'; echo 'def(date)(0)(''April 6, 2 005'')'; echo 'ENDDEF()#' | tr '#' '\\'; ) > ./version.yo case zsh.1 in */*) target=zsh.1 ;; *) target=./zsh.1 ;; esac; case ': yodl' in :*) ; ; *) : yodl -I. -w zman.yo version.yo zsh.yo | sed -e '1s/\\-/-/g' -e '/^\.'\''/d' > $t arget ;; esac; test -f $target *** Error code 1 Stop. make: stopped in /home/src/zsh-4.2.5-20050430/Doc *** Error code 1 Stop. make: stopped in /home/src/zsh-4.2.5-20050430 ------------------------------------------------------------- To compare the result, I compiled the 4.2.5 release and it ended without error after the line, ------------------------------------------------------------- gcc -s -Wl,-x -shared --whole-archive -o zleparameter.so zleparameter..o -ltermcap -lm -lc ------------------------------------------------------------- So it is something in the latest patches. -- Vincent Stemen Avoid the VeriSign/Network Solutions domain registration trap! Read how Network Solutions (NSI) was involved in stealing our domain name. http://www.InetAddresses.net