From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15721 invoked from network); 1 Aug 2008 12:30:14 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,WEIRD_PORT autolearn=no version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 1 Aug 2008 12:30:14 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 54291 invoked from network); 1 Aug 2008 12:30:11 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 1 Aug 2008 12:30:11 -0000 Received: (qmail 25568 invoked by alias); 1 Aug 2008 12:29:44 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25366 Received: (qmail 25517 invoked from network); 1 Aug 2008 12:29:36 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 1 Aug 2008 12:29:36 -0000 Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.178]) by bifrost.dotsrc.org (Postfix) with ESMTP id 6A748805A42E for ; Fri, 1 Aug 2008 14:29:30 +0200 (CEST) Received: by wa-out-1112.google.com with SMTP id v27so726840wah.21 for ; Fri, 01 Aug 2008 05:29:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=UT6onG1XnXWORbX7Up1T8/JjlPMlOeJwt9WIKWlSevA=; b=MTpdaaUwuu2QQGb+M1Krf3AQhQY3TZBXoPHveshoOZX+ZJO85N2kO8pruNdv5Zf4/q vftRY991fbUTMo8RTQjSurHPBKaxu47E0obObRyKYmV1zfKzdv13sPTLeHumYJEhgq5H AoGopZ52YkJxxeYNwhDvPjHQRaCxqtACpQ/Jg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=xz5cXaQ/sDplXJOAEuBqJtxnaCfQ8En0zyYbKAoPArtVfJP1iofXI62ZuEWwUUIwGl einV/VgpQutVm3QMWdhsecGZbFLcx+P2/+nD2LeWfyOIdMduKFw/av8yaWwDIVQvjexr Jat6fRQKEUq8JvueGZPKBPE7nd+vzk/1gBvXc= Received: by 10.114.36.4 with SMTP id j4mr11402392waj.156.1217593769250; Fri, 01 Aug 2008 05:29:29 -0700 (PDT) Received: by 10.114.159.2 with HTTP; Fri, 1 Aug 2008 05:29:29 -0700 (PDT) Message-ID: <6cd6de210808010529h11898619kba301fddf8b72f00@mail.gmail.com> Date: Fri, 1 Aug 2008 08:29:29 -0400 From: "Rocky Bernstein" To: zsh-workers@sunsite.dk Subject: Re: Weird exit caused in a trap DEBUG which sources a file. In-Reply-To: <6cd6de210807310305q5954b65ax405f51e54d6754ee@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <6cd6de210807301938m28e05c84vf6296aa5b1bc0d44@mail.gmail.com> <200807310901.m6V91g8T002478@news01.csr.com> <6cd6de210807310305q5954b65ax405f51e54d6754ee@mail.gmail.com> X-Virus-Scanned: ClamAV 0.92.1/7910/Fri Aug 1 13:14:31 2008 on bifrost X-Virus-Status: Clean Looks like the crucial change that makes zsh 4.3.5-dev and current SVN sources fail is an extra source after the trap DEBUG: #!/bin/zsh-beta -f function debug_trap_handler { print $functrace[1] . ./bug-file } trap 'echo EXIT hit' EXIT trap 'debug_trap_handler' DEBUG . ./testing.sh Put in ./testing.sh and bug-file some executable code. You probably want to have several statements in testing.sh so you can see exiting after the first statement. On Thu, Jul 31, 2008 at 6:05 AM, Rocky Bernstein wrote: > 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 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 Software Engineer >> CSR PLC, Churchill House, Cambridge Business Park, Cowley Road >> Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 >> >