Bug 1150541

Summary: zsh wait builtin does not work for already exited processes [RHEL-6 moved to RHEL-7 for compatibility reasons]
Product: Red Hat Enterprise Linux 7 Reporter: Tim Speetjens <tspeetje>
Component: zshAssignee: Kamil Dudka <kdudka>
Status: CLOSED DUPLICATE QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: james.antill, kdudka, michele, ovasik, tspeetje
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1150554 1162198 (view as bug list) Environment:
Last Closed: 2014-11-21 11:29:57 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: 1150554    
Bug Blocks:    
Attachments:
Description Flags
reproducer script none

Description Tim Speetjens 2014-10-08 12:13:03 UTC
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 2 Tim Speetjens 2014-10-08 12:23:37 UTC
Created attachment 944977 [details]
reproducer script

Comment 10 Kamil Dudka 2014-11-21 11:29:57 UTC
We already had a RHEL-7 sibling of this bug, merging...

*** This bug has been marked as a duplicate of bug 1150554 ***