zsh-workers
 help / color / mirror / code / Atom feed
From: "Rocky Bernstein" <rocky.bernstein@gmail.com>
To: zsh-workers@sunsite.dk
Subject: Re: Weird exit caused in a trap DEBUG which sources a file.
Date: Thu, 31 Jul 2008 06:05:30 -0400	[thread overview]
Message-ID: <6cd6de210807310305q5954b65ax405f51e54d6754ee@mail.gmail.com> (raw)
In-Reply-To: <200807310901.m6V91g8T002478@news01.csr.com>

I don't get different results by adding -f. However I do get different
results depending on the zsh version.

The buggy output was run using the stock zsh for Ubunty Hardy Heron:
zsh 4.3.4 (i686-pc-linux-gnu)

I don't get it for the "zsh-beta" package which is
zsh 4.3.5-dev-0+ (i686-pc-linux-gnu)

Life would be good were that were the end of the story.

This is this is whittled down from a larger set of files, and in that
larger set, I still have the problem no matter which of the above two
zsh's is used or a third or the one I built from recent CVS with the
patches I posted applied. So it looks like I'll have to go back and
start again from the larger program and whittle it down again.

If anyone is aware of what bug was fixed between 4.3.4 and 4.3.5-dev-0
that addresses this, it might help understand the nature of the
problem better. (I will also at some point scour ChangeLogs to try to
figure this out too.)

Thanks for double checking and the suggestions.


On Thu, Jul 31, 2008 at 5:01 AM, Peter Stephenson <pws@csr.com> wrote:
> "Rocky Bernstein" wrote:
>> Below is a small program whittled down from a larger one. It has
>> behavior I can't figure out.
>>
>> It seems to show that when a function is called via trap DEBUG and you
>> then source a file and it has a statement in it, on return from the
>> TRAP an exit will be taken.  Here is the program:
>>
>> #!/usr/bin/zsh
>> function debug_trap_handler {
>>     print $functrace[1]
>>     do_bug
>> }
>>
>> function do_bug {
>>    . ./bug-file
>> }
>>
>> trap 'echo EXIT hit' EXIT
>> trap 'debug_trap_handler' DEBUG
>> a=1
>> b=2
>> d=3
>>
>> In "bug-file" put any command. ":" will do. Or a print statement.
>> Let's say it contains the line:
>> print bug file here
>>
>> When I run the above I get:
>>
>> $ ./zshtrace.sh
>>
>> ./zshtrace.sh:12
>> bug file here
>> EXIT hit
>
> That certainly looks like a bug, but it didn't happen for me.  What
> version of the shell do you have, and does it happen with the -f option
> after /usr/bin/zsh?
>
> --
> Peter Stephenson <pws@csr.com>                  Software Engineer
> CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
> Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070
>


  reply	other threads:[~2008-07-31 10:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-31  2:38 Rocky Bernstein
2008-07-31  9:01 ` Peter Stephenson
2008-07-31 10:05   ` Rocky Bernstein [this message]
2008-08-01 12:29     ` Rocky Bernstein
2008-08-01 13:37       ` Peter Stephenson
2008-08-01 15:21         ` Rocky Bernstein
2008-08-01 15:31           ` Peter Stephenson
2008-08-02 11:21             ` Rocky Bernstein
2008-08-03 10:42               ` Peter Stephenson
2008-08-03 11:28                 ` Rocky Bernstein
2008-08-03 11:50                   ` Peter Stephenson
2008-08-05 11:18                     ` Rocky Bernstein

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=6cd6de210807310305q5954b65ax405f51e54d6754ee@mail.gmail.com \
    --to=rocky.bernstein@gmail.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).