[Pkg-zsh-devel] Bug#859070: /bin/zsh: status of resumed background jobs incorrectly listed as 'unknown signal (core dumped)'

Nathan Dorfman ndorf at rtfm.net
Thu Mar 30 05:42:04 UTC 2017


Package: zsh
Version: 5.3.1-3+b1
Severity: normal
File: /bin/zsh

Dear Maintainer,

After a stopped pipeline job is resumed via the 'bg' builtin command,
the status of every command in the pipeline except the first is
incorrectly displayed. For example:

stretch% sleep 10 | sleep 15 | sleep 20
^Z
zsh: suspended  sleep 10 | sleep 15 | sleep 20
stretch% bg
[1]  + continued  sleep 10 | sleep 15 | sleep 20
stretch% jobs -l
[1]  + 1556 running    sleep 10 | 
       1557 unknown signal (core dumped)                 sleep 15 | 
       1558 unknown signal (core dumped)                 sleep 20
stretch%

The same thing happens regardless of what the commands are, as long as
there are at least two commands with a pipe petween them. Despite the
status, the jobs are definitely running:

stretch% cp /dev/null /tmp/emptyfile && tail -F /tmp/emptyfile | sed
's/foo/quux/'
^Z
zsh: suspended  tail -F /tmp/emptyfile | sed 's/foo/quux/'
stretch% bg
[1]  - continued  tail -F /tmp/emptyfile | sed 's/foo/quux/'
stretch% jobs -l
[1]  + 1583 running    tail -F /tmp/emptyfile | 
       1584 unknown signal (core dumped)                 sed
's/foo/quux/'
stretch% echo foobar > /tmp/emptyfile
stretch% quuxbar

After the job completes, the status is correctly displayed as 'done':

stretch% kill 1583
stretch% 
[1]  + terminated  tail -F /tmp/emptyfile | 
       done        sed 's/foo/quux/'

While sending SIGCONT to the processes directly usually has the same
effect, by sending the signals individually in a certain order it's
actually possible to coax the correct behavior out:

stretch% sleep 120 | cat | cat
^Z
zsh: suspended  sleep 120 | cat | cat
stretch% jobs -l
[1]  + 1613 suspended  sleep 120 | 
       1614 suspended  cat | 
       1615 suspended  cat
stretch% kill -CONT 1615 ; jobs -l        
[1]  + 1613 suspended  sleep 120 | 
       1614 suspended  cat | 
       1615 running    cat
stretch% kill -CONT 1614 ; jobs -l
[1]  + 1613 suspended  sleep 120 | 
       1614 running    cat | 
       1615 running    cat
stretch% kill -CONT 1613 ; jobs -l
[1]  + 1613 running    sleep 120 | 
       1614 running    cat | 
       1615 running    cat
stretch% 

Trying a different order seems to suggest that it happens to the
reader of a pipe if it wakes up (receives SIGCONT) after the writer,
but not if the writer is still suspended:

stretch% jobs -l
[1]  + 1653 suspended  sleep 120 | 
       1654 suspended  cat | 
       1655 suspended  cat
stretch% kill -CONT 1654; jobs -l
[1]  + 1653 suspended  sleep 120 | 
       1654 running    cat | 
       1655 suspended  cat
stretch% kill -CONT 1655; jobs -l
[1]  + 1653 suspended  sleep 120 | 
       1654 running    cat | 
       1655 unknown signal (core dumped)                 cat

-- Package-specific info:
Packages which provide code meant to be sourced in .zshrc:

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name            Version      Architecture Description
+++-===============-============-============-====================================
un  grml-debootstra <none>       <none>       (no description available)

Packages which provide vendor completions:

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name            Version      Architecture Description
+++-===============-============-============-====================================
ii  pulseaudio      10.0-1       amd64        PulseAudio sound server
ii  systemd         232-20~test0 amd64        system and service manager
ii  udev            232-20~test0 amd64        /dev/ and hotplug management daemon
ii  vlc-bin         2.2.4-14     amd64        binaries from VLC

dpkg-query: no path found matching pattern /usr/share/zsh/vendor-functions/


-- System Information:
Debian Release: 9.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages zsh depends on:
ii  dpkg        1.18.23
ii  libc6       2.24-9
ii  libcap2     1:2.25-1
ii  libtinfo5   6.0+20161126-1
ii  zsh-common  5.3.1-3

Versions of packages zsh recommends:
ii  libc6         2.24-9
ii  libncursesw5  6.0+20161126-1
ii  libpcre3      2:8.39-2.1

Versions of packages zsh suggests:
pn  zsh-doc  <none>

-- no debconf information



More information about the Pkg-zsh-devel mailing list