Hi!

----

While testing the signal issues we stumbled over an issue with the
"wait" builtin - it seems doing a $ while ! wait ; do true ; done #
(the loop is neccesary since "wait" can be interupted by signals)
doesn't wait for all child processes launched by the shell.

The following testcase...
-- snip --
$ cat ksh_waitjobs1.sh

typeset -i i

for (( i=0 ; i < 256 ; i++ )) ; do
        {
                sleep 10
                exit 0
        } &
done

while ! wait ; do
        true
done

jl="$(LC_ALL='C' jobs -l | fgrep Running)"

if [[ "$jl" == '' ]] ; then
        printf '# success.\n'
        exit 0
else
        printf '# error: job list not empty:\n%s\n' "$jl"
        exit 1
fi

# notreached
-- snip --

... works flawlessly with bash4 (bash 4.2.42(1)) on SuSE 12.3/AMD64/64bit:
-- snip --
$ bash ksh_waitjobs1.sh
# success.
-- snip --

... but the same script fails with ast-ksh.2013-05-24:
-- snip --
$ ~/bin/ksh ksh_waitjobs1.sh
# error: job list not empty:
[256] + 8094     Running                 <command unknown>
[255] - 8093     Running                 <command unknown>
[254]   8092     Running                 <command unknown>
[253]   8091     Running                 <command unknown>
[252]   8090     Running                 <command unknown>
[251]   8089     Running                 <command unknown>
[250]   8088     Running                 <command unknown>
[249]   8087     Running                 <command unknown>
[snip]
[6]   7844       Running                 <command unknown>
[5]   7843       Running                 <command unknown>
[4]   7842       Running                 <command unknown>
[3]   7841       Running                 <command unknown>
[2]   7840       Running                 <command unknown>
[1]   7839       Running                 <command unknown>
-- snip --

Uhm... is this a bug or am I doing something wrong ?

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) [email protected]
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)
_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to