zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: Dave Yost <Dave@Yost.com>, zsh-workers@sunsite.dk
Subject: Re: zsh malloc bug
Date: Tue, 08 Jun 2004 14:20:27 +0100	[thread overview]
Message-ID: <200406081320.i58DKROp011482@news01.csr.com> (raw)
In-Reply-To: "Dave Yost"'s message of "Wed, 02 Jun 2004 11:21:20 PDT." <pdy98830611045dbce3ca1d0698@[209.128.98.50]>

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 <pws@csr.com>                  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
**********************************************************************


  reply	other threads:[~2004-06-08 13:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-01 18:01 Dave Yost
2004-06-02  9:32 ` Peter Stephenson
2004-06-02 18:21   ` Dave Yost
2004-06-08 13:20     ` Peter Stephenson [this message]
2004-06-08 18:09       ` RANDOMSMALL <range> [ <seed> ] Dave Yost
2004-06-08 21:20         ` Peter Stephenson
2004-06-08 21:51           ` PATCH: " Peter Stephenson
2004-06-08 21:55         ` Larry Bakst
2004-06-16 19:13       ` zsh malloc bug Dave Yost
2004-06-16 19:16 Dave Yost
2004-07-26 13:05 ` Peter Stephenson
2004-07-26 16:48   ` Bart Schaefer
2004-07-26 16:57     ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200406081320.i58DKROp011482@news01.csr.com \
    --to=pws@csr.com \
    --cc=Dave@Yost.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).