From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12767 invoked from network); 8 Jun 2004 13:21:29 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.86) by ns1.primenet.com.au with SMTP; 8 Jun 2004 13:21:29 -0000 Received: (qmail 28545 invoked from network); 8 Jun 2004 13:21:13 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 8 Jun 2004 13:21:13 -0000 Received: (qmail 21929 invoked by alias); 8 Jun 2004 13:21:03 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20024 Received: (qmail 21918 invoked from network); 8 Jun 2004 13:21:02 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.86) by sunsite.dk with SMTP; 8 Jun 2004 13:20:59 -0000 Received: (qmail 28067 invoked from network); 8 Jun 2004 13:20:59 -0000 Received: from lhuumrelay3.lnd.ops.eu.uu.net (62.189.58.19) by a.mx.sunsite.dk with SMTP; 8 Jun 2004 13:20:58 -0000 Received: from MAILSWEEPER01.csr.com (mailhost1.csr.com [62.189.183.235]) by lhuumrelay3.lnd.ops.eu.uu.net (8.11.0/8.11.0) with ESMTP id i58DKVv23949 for ; Tue, 8 Jun 2004 13:20:31 GMT Received: from EXCHANGE02.csr.com (unverified [192.168.137.45]) by MAILSWEEPER01.csr.com (Content Technologies SMTPRS 4.3.12) with ESMTP id ; Tue, 8 Jun 2004 14:19:55 +0100 Received: from news01.csr.com ([192.168.143.38]) by EXCHANGE02.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Tue, 8 Jun 2004 14:23:20 +0100 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (Postfix) with ESMTP id 6ED726E0205; Tue, 8 Jun 2004 14:20:28 +0100 (BST) Received: from csr.com (pws@localhost) by news01.csr.com (8.12.10/8.12.10/Submit) with ESMTP id i58DKROp011482; Tue, 8 Jun 2004 14:20:28 +0100 Message-Id: <200406081320.i58DKROp011482@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: Dave Yost , zsh-workers@sunsite.dk Subject: Re: zsh malloc bug In-reply-to: "Dave Yost"'s message of "Wed, 02 Jun 2004 11:21:20 PDT." Date: Tue, 08 Jun 2004 14:20:27 +0100 From: Peter Stephenson X-OriginalArrivalTime: 08 Jun 2004 13:23:20.0562 (UTC) FILETIME=[C4665520:01C44D5B] X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=BAYES_50 autolearn=no version=2.63 X-Spam-Hits: 0.0 Dave Yost wrote: > zsh 4.2.0 hangs on my cygwin system when I try some of these scenarios. I couldn't get this to happen on Solaris 8 or Fedora Core 1. I would be a bit suspicious about Cygwin, since they had to jump through lots of hoops to make it look like a UNIX environment. > BTW, the TRAPxxx documentation should be more explicit about whether trapping > the event prevents exit Yes, it should say how the return status is handled and apparently it doesn't. That's a big omission. > and what happens if you exit explicitly from within the trap. I'm not quite sure what this means, since if you exit explicitly with the trap it exits, but the recent behaviour is not to run exit traps at that point. Index: Doc/Zsh/func.yo =================================================================== RCS file: /cvsroot/zsh/zsh/Doc/Zsh/func.yo,v retrieving revision 1.7 diff -u -r1.7 func.yo --- Doc/Zsh/func.yo 10 Jul 2001 08:59:18 -0000 1.7 +++ Doc/Zsh/func.yo 8 Jun 2004 13:17:22 -0000 @@ -193,6 +193,24 @@ If a function of this form is defined and null, the shell and processes spawned by it will ignore tt(SIG)var(NAL). + +The return value from the function is handled specially. If it is +zero, the signal is assumed to have been handled, and execution continues +normally. Otherwise, the normal effect of the signal is produced; +if this causes execution to terminate, the status returned to the shell is +the status returned from the function. + +Programs terminated by uncaught signals typically return the status 128 +plus the signal number. Hence the following causes the handler for +tt(SIGINT) to print a message, then mimic the usual effect of the signal. + +example(TRAPINT() { + print "Caught SIGINT, aborting." + return $(( 128 + $1 )) +}) + +The functions tt(TRAPZERR), tt(TRAPDEBUG) and tt(TRAPEXIT) are never +executed inside other traps. ) findex(TRAPDEBUG) item(tt(TRAPDEBUG))( -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 692070 ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************