[email protected]
[Top] [All Lists]

Bug#288323: marked as forwarded (zsh: doesn't handle suspension of comma

Subject: Bug#288323: marked as forwarded zsh: doesn't handle suspension of commands in conditional lists correctly
From: Debian Bug Tracking System
Date: Sun, 02 Jan 2005 20:18:07 -0800
Your message dated Sun, 2 Jan 2005 23:15:12 -0500
with message-id <[email protected]>
has caused the Debian Bug report #288323,
regarding zsh: doesn't handle suspension of commands in conditional lists 
to be marked as having been forwarded to the upstream software
author(s) [email protected]

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

Received: (at 288323-forwarded) by bugs.debian.org; 3 Jan 2005 04:15:15 +0000
>From [email protected] Sun Jan 02 20:15:15 2005
Return-path: <[email protected]>
Received: from acolyte.scowler.net [] 
        by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
        id 1ClJcg-00089U-00; Sun, 02 Jan 2005 20:15:15 -0800
Received: by acolyte.scowler.net (Postfix, from userid 1000)
        id A96987004A; Sun,  2 Jan 2005 23:15:12 -0500 (EST)
Date: Sun, 2 Jan 2005 23:15:12 -0500
From: Clint Adams <[email protected]>
To: [email protected]
Cc: [email protected],
        [email protected]
Subject: and lists and suspended processes
Message-ID: <[email protected]>
Mail-Followup-To: [email protected], [email protected],
        [email protected]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.6+20040907i
Delivered-To: [email protected]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
        (1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-3.0 required=4.0 tests=BAYES_00 autolearn=no 

Should zsh wait for a suspended process to exit before continuing along
the sublist?

----- Forwarded message from Branden Robinson <[email protected]> -----

Things like:

foo && bar && baz

are a basic POSIX shell feature, and Bash doesn't handle them right.


echo one && sleep 10 && echo two

While, in the sleep, background the command with CTRL-Z.

The 'echo two' will run immediately.  This is wrong.  The sleep has no exit
status yet because it has not exited, and the && and || connectives must
only be evaluated once the preceding command has exited.  Until then, the
command in question *has* no exit status.  The box with Schroedinger's Cat
in it has not yet been opened.

ash, dash, pdksh, and zsh are also buggy, but instead they never run "echo
two" at all.  It appears that of Debian's allegedly POSIX-compliant shells
have this problem, except for posh.

Here are some speculations/argument from #debian-devel as to what may be
going on:

08:42PM|<asuffield> Overfiend: what you have in bash is bloody broken
   conditionals. I can't see how to fix it, and I can't stand looking
   at bash any longer to figure it out
08:42PM|<asuffield> it passes WUNTRACED to wait() when job control is
   enabled, so that it can spot jobs which have been sent SIGSTOP
08:43PM|<asuffield> somewhere in the pipeline logic is a missing check
   for WIFSTOPPED on the status code, to see if the process is really
   dead yet or not
08:49PM|<asuffield> look, WSTOPCODE() and WEXITCODE() are the same
   macro. zsh is calling WEXITCODE() and treating it as the exit code,
   and this is *INCORRECT*, because WIFEXITED() is false and WIFSTOPPED()
   is true
08:51PM|<Keybuk> and zsh documents that it won't continue a pipeline if
   the process is terminated by an unhandled signal
08:52PM|<Keybuk> so zsh is being correct, just different to bash
08:52PM|<asuffield> zsh has incorrectly interpreted the result from wait()
   as if the process had been terminated
08:52PM|<asuffield> the process has been stopped. this is a different

To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

<Prev in Thread] Current Thread [Next in Thread>
  • Bug#288323: marked as forwarded (zsh: doesn't handle suspension of commands in conditional lists correctly), Debian Bug Tracking System <=