From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26423 invoked from network); 11 Jul 2005 01:39:43 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 11 Jul 2005 01:39:43 -0000 Received: (qmail 55557 invoked from network); 11 Jul 2005 01:39:38 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 11 Jul 2005 01:39:37 -0000 Received: (qmail 27690 invoked by alias); 11 Jul 2005 01:39:34 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21424 Received: (qmail 26663 invoked from network); 11 Jul 2005 01:32:53 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 11 Jul 2005 01:32:53 -0000 Received: (qmail 52575 invoked from network); 11 Jul 2005 01:32:53 -0000 Received: from snoopy.microcomaustralia.com.au (202.173.153.89) by a.mx.sunsite.dk with SMTP; 11 Jul 2005 01:32:47 -0000 Received: from localhost (localhost [127.0.0.1]) by snoopy.microcomaustralia.com.au (Postfix) with ESMTP id BA696D8BDF; Mon, 11 Jul 2005 11:32:33 +1000 (EST) Received: from snoopy.microcomaustralia.com.au ([127.0.0.1]) by localhost (snoopy [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 10414-07; Mon, 11 Jul 2005 11:32:29 +1000 (EST) Received: by snoopy.microcomaustralia.com.au (Postfix, from userid 10003) id 90DFDD8BD0; Mon, 11 Jul 2005 11:32:29 +1000 (EST) To: zsh-workers@sunsite.dk Subject: [Brian May] zsh random behaviour From: Brian May MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/mixed; boundary="Multipart_Mon_Jul_11_11:32:29_2005-1" Date: Mon, 11 Jul 2005 11:32:29 +1000 Message-ID: User-Agent: T-gnus/6.17.2 (based on No Gnus v0.2) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/21.4 (i386-pc-linux-gnu) MULE/5.0 (SAKAKI) X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at snoopy.apana.org.au 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=BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 --Multipart_Mon_Jul_11_11:32:29_2005-1 Content-Type: text/plain; charset=US-ASCII Hello, I found this weird behavior of zsh, when using the version in Debian stable. Version 4.2.5-7. As I have no reason to suspect this is Debian specific, so I am reporting it here. I recently reported it to my local Linux mailing list just in case anybody could explain it, but so far everyone appears to be stumped. The full details are in the attached email. Any ideas? Is this a zsh bug or a bug sitting at the console? The same thing works with bash. I also tried zsh-beta (4.3.0-dev-1+20050424-1) from Debian stable, and got similar results. I suspect a zsh bug. Its totally weird. Even the weird parts are weird. The parts that aren't weird are also weird. I have copied the screen output verbatim, I have not omitted anything except for the hundreds of tests I conducted (repeat: press up arrow; press enter). I didn't dare try to automate the process in case this altered the results (the initial problem was in a zsh script though; the entire script aborted for no good reason). For the moment I have changed my executable (used by the script) to return 1 instead of 255, and it works fine. Is a return value of 255 treated specially by zsh? Please CC responses to me, thanks. --Multipart_Mon_Jul_11_11:32:29_2005-1 Content-Type: message/rfc822 From: Brian May To: luv-main@luv.asn.au Subject: zsh random behaviour MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Mail-Followup-To: luv-main@luv.asn.au Date: Fri, 08 Jul 2005 18:58:13 +1000 Message-ID: Hello, Before I file a bug report against zsh, I want a second opinion. If I compile this code: --- cut --- int main() { return -1; } --- cut --- like so: --- cut --- [663] [snoopy:bam] ~/tree/diary-data >gcc -Wall -otest test.c --- cut --- and run the following command numerous times: --- cut --- [662] [snoopy:bam] ~/tree/diary-data >set -x; ./test | read -r i; echo $? +zsh:898> set -x +zsh:898> ./test +zsh:898> read -r i [662] [snoopy:bam] ~/tree/diary-data >set -x; ./test | read -r i; echo $? +zsh:899> set -x +zsh:899> ./test +zsh:899> read -r i +zsh:899> echo 1 1 --- cut --- I get different behavior every time. Two versions are shown above. This only seems to happen if test.c returns 250, 254, 255 or -1 and I pipe the output the read. If it return 1 it works. I haven't checked other values. The zsh documentation says that only the return code from the last command in a pipe statement matters. If I try to do the same thing with "false", "sh false", or "sh -c false", so far it works every time. The -r parameter (raw mode) is not important. It happens anyway. No, I didn't set -e, it is off. The shell should always execute the echo statement regardless of if the previous commands fail or not. also: --- cut --- [673] [snoopy:bam] ~/tree/diary-data >myread() { sleep 10; read -r $1; } [678] [snoopy:bam] ~/tree/diary-data >set -x; ./test | myread i; echo $? +zsh:988> set -x +zsh:988> ./test +zsh:988> myread i +myread:0> sleep 10 --- cut --- if I change the definition of myread to only include the sleep command: --- cut --- [679] [snoopy:bam] ~/tree/diary-data >myread() { sleep 1; } [681] [snoopy:bam] ~/tree/diary-data >set -x; ./test | myread i; echo $? +zsh:996> set -x +zsh:996> ./test +zsh:996> myread i +myread:0> sleep 10 --- cut --- ... I was going to say it works every time, but apparently not anymore. Maybe I was confused. If I replace the myread with the sleep command directly, it works. The 10 seconds always seems closer to 0 seconds. i.e there is no delay. Occasionally the sleep command will executes in the background! --- cut --- [683] [snoopy:bam] ~/tree/diary-data >set -x; ./test | myread i; echo $? +zsh:1014> set -x +zsh:1014> ./test +zsh:1014> myread i [683] [snoopy:bam] ~/tree/diary-data >+myread:0> sleep 10 --- cut --- Success rate varies remarkably depending on the phase of the moon, number of people reading this mailing list at a given time, direction and speed of the wind above the Rialto, etc. I can't get that last command to execute the echo instruction at all though. I was about to start pulling my hair out, but I will let you pull your hair out instead . The same thing seems OK with bash. ii zsh 4.2.5-7 A shell with lots of features -- Brian May --Multipart_Mon_Jul_11_11:32:29_2005-1 Content-Type: text/plain; charset=US-ASCII -- Brian May --Multipart_Mon_Jul_11_11:32:29_2005-1--