Bug 1162198

Summary: zsh wait builtin does not work for already exited processes [Fedora]
Product: [Fedora] Fedora Reporter: Kamil Dudka <kdudka>
Component: zshAssignee: Kamil Dudka <kdudka>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 20CC: dmaphy, james.antill, lnie, michele
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: zsh-5.0.7-4.fc21 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1150541 Environment:
Last Closed: 2014-12-01 18:58:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1150554    

Description Kamil Dudka 2014-11-10 13:48:46 UTC
Still a bug with zsh-5.0.7-1.fc22, upstream fix available:

http://sourceforge.net/p/zsh/code/ci/b4f7ccec
http://sourceforge.net/p/zsh/code/ci/9a551ca8

+++ This bug was initially created as a clone of Bug #1150541 +++

Description of problem:
When a child process is started, and finished before a call to wait, an error is signaled.

Version-Release number of selected component (if applicable):
zsh-4.3.10-7.el6.x86_64


How reproducible:
100%

Steps to Reproduce:
Run the following script with zsh (or with zsh in ksh emulation mode):
#!/bin/ksh
sh -c "echo done" &
pid1=$!
sleep 1
wait $pid1
echo "rc: $?"

sh -c "exit 3" &
pid2=$!
sleep 1
wait $pid2
echo "rc: $?"

Actual results:
$ zsh test.sh
done
test.sh:wait:5: pid 6156 is not a child of this shell
rc: 1
test.sh:wait:11: pid 6159 is not a child of this shell
rc: 1


Expected results:
$ zsh test.sh 
done
rc: 0
rc: 3


Additional info:
This is equally so for running zsh in ksh emulation mode. Running the same script with either bash or mksh, produces the expected result.

Comment 1 Kamil Dudka 2014-11-10 15:21:07 UTC
fixed in zsh-5.0.7-2.fc22

Comment 2 Fedora Update System 2014-11-13 19:00:18 UTC
zsh-5.0.7-2.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/zsh-5.0.7-2.fc21

Comment 3 Fedora Update System 2014-11-13 19:00:25 UTC
zsh-5.0.7-2.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/zsh-5.0.7-2.fc20

Comment 4 Fedora Update System 2014-11-14 12:03:14 UTC
Package zsh-5.0.7-2.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing zsh-5.0.7-2.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-15007/zsh-5.0.7-2.fc20
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2014-11-19 19:01:57 UTC
zsh-5.0.7-4.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/zsh-5.0.7-4.fc21

Comment 6 Fedora Update System 2014-11-19 19:02:06 UTC
zsh-5.0.7-4.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/zsh-5.0.7-4.fc20

Comment 7 lnie 2014-11-20 05:01:47 UTC
zsh-5.0.7-4.fc21 works

Comment 8 Kamil Dudka 2014-11-20 07:20:46 UTC
(In reply to lnie from comment #7)
> zsh-5.0.7-4.fc21 works

Thanks for the feedback!

Comment 9 Fedora Update System 2014-12-01 18:58:59 UTC
zsh-5.0.7-4.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2014-12-06 10:36:37 UTC
zsh-5.0.7-4.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.