NetBSD-Bugs archive

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

bin/48138: sh(1) wait(1) builtin fails after bg job was SIG(STOP|TSTP|CONT) controlled



>Number:         48138
>Category:       bin
>Synopsis:       sh(1) wait(1) builtin fails after bg job was 
>SIG(STOP|TSTP|CONT) controlled
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 20 17:35:00 +0000 2013
>Originator:     Steffen
>Release:        6.99.23
>Organization:
>Environment:
NetBSD nhead 6.99.23 NetBSD 6.99.23 (GENERIC) #0: Thu Aug  8 19:07:01 UTC 2013  
builds%b6.netbsd.org@localhost:/home/builds/ab/HEAD/amd64/201308081710Z-obj/home/builds/ab/HEAD/src/sys/arch/amd64/compile/GENERIC
 amd64
>Description:
* [steffen@nhead]$ /bin/sleep 30 &
* [steffen@nhead]$ jobs
[1] + Running                 /bin/sleep 30
* [steffen@nhead]$ kill -STOP %1
* [steffen@nhead]$ jobs
[1] + Running                 /bin/sleep 30
* [steffen@nhead]$ wait %1
[1] + Suspended (signal)      /bin/sleep 30
* [steffen@nhead]$ kill -CONT %1
* [steffen@nhead]$ jobs
[1] + Suspended (signal)      /bin/sleep 30
* [steffen@nhead]$ wait %1
* [steffen@nhead]$ wait
* [steffen@nhead]$ jobs
[1] + Suspended (signal)      /bin/sleep 30
* [steffen@nhead]$ 
[1]   Done                    /bin/sleep 30
* [steffen@nhead]$ 


Of the tested mksh(1), NetBSD sh(1), dash(1), FreeBSD sh(1), Mac OS X /bin/ksh 
and bash(1), only the latter two "do the right thing" (satisfy me, that is):


Mac OS X /bin/ksh(1):

?0[steffen@sherwood]$ /bin/sleep 30 &
[1]     43762
?0[steffen@sherwood]$ jobs
[1] +  Running                 /bin/sleep 30 &
?0[steffen@sherwood]$ wait  
^C?258[steffen@sherwood]$ jobs
[1] +  Running                 /bin/sleep 30 &
?0[steffen@sherwood]$ kill -STOP %1
?0[steffen@sherwood]$ jobs         
[1] +  Running                 /bin/sleep 30 &
?0[steffen@sherwood]$ wait %1
[1] + Stopped (SIGSTOP)        /bin/sleep 30 &
?0[steffen@sherwood]$ kill -CONT %1
?0[steffen@sherwood]$ jobs
[1] +  Running                 /bin/sleep 30 &
?0[steffen@sherwood]$ wait %1

^C?258[steffen@sherwood]$ jobs
?0[steffen@sherwood]$ 


bash(1):


?0[steffen@sherwood]$ /bin/sleep 30 &
[1] 43752
?0[steffen@sherwood]$ wait %1
^C
?1[steffen@sherwood]$ kill -STOP %1
?0[steffen@sherwood]$ jobs
[1]+  Running                 /bin/sleep 30 &
?0[steffen@sherwood]$ wait %1

[1]+  Stopped                 /bin/sleep 30
?145[steffen@sherwood]$ wait %1
bash: warning: wait_for_job: job 1 is stopped
?145[steffen@sherwood]$ kill -CONT %1
?0[steffen@sherwood]$ jobs
[1]+  Running                 /bin/sleep 30 &
?0[steffen@sherwood]$ wait %1
^C
?1[steffen@sherwood]$ jobs
[1]+  Running                 /bin/sleep 30 &
?0[steffen@sherwood]$ 
[1]+  Done                    /bin/sleep 30


>How-To-Repeat:

>Fix:
no.



Home | Main Index | Thread Index | Old Index