Sure. Using this ksh
http://www2.research.att.com/~gsf/download/tgz/ast-ksh.2010-03-09.linux.i386-64.tgz
with MD5 checksum of 3550d5cecbadc66077110334c9363227

Please extract and place the attached test script in the same directory
as that ksh or change the script so it runs the correct revision of ksh.

Example output:
jhhu...@treasure:/tmp/ksh/arch/linux.i386-64/bin> ./testtrap.sh 
Version JM 93t+ 2010-03-05
oops 0
oops 1
Error occurred 2 times.

-- 
Jared H. Hudson
Dedicated Support Engineer
[email protected] 
479-657-4309 Office
479-283-4677 Cellular

On Tue, 2010-04-06 at 14:32 +0200, ольга крыжановская wrote:
> Jared, do you have a script (not an interactive shell mode test case)
> which reproduces this problem?
> 
> Olga
> 
> On Mon, Apr 5, 2010 at 8:19 PM, Jared Hudson <[email protected]> wrote:
> > He meant oops 0, oops 177.
> >
> > Depending on the system it can take several iterations before the
> > problem demonstrates itself. I would recommend trying a higher sequence
> > than 200 if the problem does not occur immediately.
> >
> > treasure:~ # ksh
> > treasure:/root # echo ${.sh.version}
> > Version JM 93t+ 2010-02-14
> > treasure:/root # let n=0; for d in $(seq 1 10000); do if echo foo | grep
> > bar; then echo oops $((n++)); fi; done
> > treasure:/root # trap "" CHLD
> > treasure:/root # let n=0; for d in $(seq 1 10000); do if echo foo | grep
> > bar; then echo oops $((n++)); fi; done
> > oops 0
> > oops 1
> > treasure:/root #
> >
> > --
> > Jared H. Hudson
> > Dedicated Support Engineer
> > [email protected]
> > 479-657-4309 Office
> > 479-283-4677 Cellular
> >
> > On Mon, 2010-04-05 at 14:03 -0400, Glenn Fowler wrote:
> >> what in the example code prints "bang"?
> >>
> >> On Mon, 29 Mar 2010 11:08:37 +0200 Dr. Werner Fink wrote:
> >> > I've just become owner of a bug report reporting a flaky behaviour
> >> > in handling traps on SIGCHLD.  For a simply test see
> >>
> >> >  ksh> echo ${sh.version}
> >> >  Version JM 93t+ 2010-02-14
> >> >  ksh> trap "" CHLD
> >> >  let n=0; for d in $(seq 1 200); do if echo foo | grep bar; then echo 
> >> > oops $((n++)); fi; done
> >> >  bang 0
> >> >  [...]
> >> >  bang 177
> >> >  ksh>
> >>
> >> > and repeating the loop results in different numbers of reports
> >> > showing that there is a race as there should no report at all.
> >>
> >> > Beside this setting the trap to something not empty works like
> >>
> >> >  ksh> trap ";" CHLD
> >> >  let n=0; for d in $(seq 1 200); do if echo foo | grep bar; then echo 
> >> > oops $((n++)); fi; done
> >> >  ksh>
> >>
> >> > which is very strange.  It is very common to use an
> >> > empty string for traps used for ignoring signals, though.
> >>
> >> >        Werner
> >>
> >> > --
> >> >   "Having a smoking section in a restaurant is like having
> >> >           a peeing section in a swimming pool." -- Edward Burr
> >> > _______________________________________________
> >> > ast-users mailing list
> >> > [email protected]
> >> > https://mailman.research.att.com/mailman/listinfo/ast-users
> >
> >
> >
> >
> > _______________________________________________
> > ast-users mailing list
> > [email protected]
> > https://mailman.research.att.com/mailman/listinfo/ast-users
> >
> 
> 
> 



Attachment: testtrap.sh
Description: application/shellscript

_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to