On 9 June 2013 23:57, Roland Mainz <[email protected]> wrote:
> Hi!
>
> ----
>
> Below is another testcase for ksh93's signal trap subsystem which
> currently doesn't work:
> -- snip --
>
> set -o nounset
>
> integer i
>
> compound c=(
>         compound child=(
>                 float sum=0.0
>         )
> )
> integer -r pid=$$
> integer -r numprocs=256
>
> trap '(( c.child.sum-=1.7 ))' USR1
> trap '(( c.child.sum-=3.3 ))' USR2
> trap '(( c.child.sum+=.sh.sig.status ))' CHLD
>
> for (( i=0 ; i < numprocs ; i++ )) ; do
>         {
>                 sleep $((numprocs / 64.))
>                 kill -s USR1 ${pid}
>                 kill -s USR2 ${pid}
>                 exit 5
>         } &
> done
>
> float start=$SECONDS
> while ! wait ; do
>         /usr/bin/true
>
>         if (( (SECONDS-start) > 20 )) ; then
>                 print '# Aborting wait loop...'
>                 break
>         fi
> done
>
> if (( c.child.sum == 0.0 )) ; then
>         printf '# success.\n'
>         exit 0
> else
>         printf 'sum for all signals=%f (should be "0")\n' \
>                 c.child.sum
>         exit 1
> fi
>
> # notreached
> -- snip --
>
> Expected output is '# success.' ... but ast-ksh.2013-05-24 currently
> has more or less random values in c.child.sum, e.g. the output looks
> like 'sum for all signals=1203.400000 (should be "0")'.

Confirming that this is still the case in ast-ksh.20130611

Lionel
_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to