NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/48729: Bug with /bin/sh and its 'wait'



>Number:         48729
>Category:       bin
>Synopsis:       Bug with /bin/sh and its 'wait'
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 09 11:35:00 +0000 2014
>Originator:     Torbjörn Granlund
>Release:        6.1.3
>Organization:
>Environment:
NetBSD tigris.csc.kth.se 6.1.3 NetBSD 6.1.3 (XEN3_DOM0) #0: Mon Feb 24 18:44:10 
CET 2014  
root%tigris.csc.kth.se@localhost:/usr/src/sys/arch/amd64/compile/XEN3_DOM0 amd64

>Description:
The shell builtin command 'wait' is documented to return
the exit status of the waited-for command when 'wait' is
given a pid.

It does not, at least not under all circumstances.
>How-To-Repeat:
#! /bin/sh

sleep 9999 &
pid=$!

(sleep 2; kill -9 $pid) &

wait $pid
stat=$?

echo "This should be 137:" $stat

>Fix:
My workaround is to use bash, or run the needed scripts under
another *BSD.



Home | Main Index | Thread Index | Old Index