Discussion:
[ast-developers] ast-ksh 2013-06-11 alpha
Glenn Fowler
2013-06-12 11:46:33 UTC
Permalink
the ast-ksh 2013-06-11 alpha source has been posted to
http://www.research.att.com/sw/download/alpha/
its still a work in progress
dgk and I are corrdinating the new vmalloc implementation vs signals
in addition to the work dgk is doing in ksh vs signals
Simon Toedt
2013-06-12 13:05:25 UTC
Permalink
Post by Glenn Fowler
the ast-ksh 2013-06-11 alpha source has been posted to
http://www.research.att.com/sw/download/alpha/
its still a work in progress
dgk and I are corrdinating the new vmalloc implementation vs signals
in addition to the work dgk is doing in ksh vs signals
On Debian Linux signals.sh keeps hanging. An example:
./src/cmd/ksh93/tests/signal.sh
test signal begins at 2013-06-12+14:30:26
signal.sh[296]: kill -VTALRM $$ failed, required termination
by signal 'KILL'
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process

The parent process hangs in the memory allocator:
#0 0x00007eff3039c570 in __nanosleep_nocancel () at
../sysdeps/unix/syscall-template.S:81
#1 0x00007eff306fde67 in tvsleep (tv=0x0, rv=0x0) at
/home/simon/kshbuild/src/lib/libast/tm/tvsleep.c:63
#2 0x00007eff3076746f in asorelax (nsec=262144) at
/home/simon/kshbuild/src/lib/libast/aso/asorelax.c:46
#3 0x00007eff3076741e in asolock (lock=0x7eff301e303c, key=20130501,
type=4) at /home/simon/kshbuild/src/lib/libast/aso/asolock.c:40
#4 0x00007eff3076ebf9 in dballoc (vm=0x7eff31b22dc0, size=144,
local=0) at /home/simon/kshbuild/src/lib/libast/vmalloc/vmdebug.c:333
#5 0x00007eff30768793 in _ast_malloc (size=144) at
/home/simon/kshbuild/src/lib/libast/vmalloc/malloc.c:680
#6 0x00007eff3128f689 in set_trapinfo (shp=0x7eff3152bac0 <sh>,
sig=41, info=0x7fff8fa0d630)
at /home/simon/kshbuild/src/cmd/ksh93/sh/fault.c:93
#7 0x00007eff3128fc68 in sh_fault (sig=41, info=0x7fff8fa0d630,
context=0x7fff8fa0d500)
at /home/simon/kshbuild/src/cmd/ksh93/sh/fault.c:241
#8 <signal handler called>
#9 sh_fault (sig=0, info=0x0, context=0x0) at
/home/simon/kshbuild/src/cmd/ksh93/sh/fault.c:119
#10 <signal handler called>
#11 0x00007eff3076f5b0 in vmdbcheck (vm=0x7eff31b22dc0) at
/home/simon/kshbuild/src/lib/libast/vmalloc/vmdebug.c:560
#12 0x00007eff3076ec16 in dballoc (vm=0x7eff31b22dc0, size=176,
local=0) at /home/simon/kshbuild/src/lib/libast/vmalloc/vmdebug.c:336
#13 0x00007eff30768793 in _ast_malloc (size=176) at
/home/simon/kshbuild/src/lib/libast/vmalloc/malloc.c:680
#14 0x00007eff3073b9e3 in sfnew (oldf=0x0, buf=0x7eff301ecc60, size=8,
file=-1, flags=5)
at /home/simon/kshbuild/src/lib/libast/sfio/sfnew.c:97
#15 0x00007eff30758387 in _sfopenat (cwd=-100, f=0x0,
file=0x7eff301ecc60 "rttrap 6", mode=0x7eff312fe0d5 "s")
at /home/simon/kshbuild/src/lib/libast/sfio/_sfopen.c:120
#16 0x00007eff307584c3 in _sfopen (f=0x0, file=0x7eff301ecc60 "rttrap
6", mode=0x7eff312fe0d5 "s")
at /home/simon/kshbuild/src/lib/libast/sfio/_sfopen.c:203
#17 0x00007eff3073c5e7 in sfopen (f=0x0, file=0x7eff301ecc60 "rttrap
6", mode=0x7eff312fe0d5 "s")
at /home/simon/kshbuild/src/lib/libast/sfio/sfopen.c:40
#18 0x00007eff312917e6 in sh_trap_20120720 (shp=0x7eff3152bac0 <sh>,
trap=0x7eff301ecc60 "rttrap 6", mode=0)
at /home/simon/kshbuild/src/cmd/ksh93/sh/fault.c:876
#19 0x00007eff31290719 in sh_chktrap (shp=0x7eff3152bac0 <sh>) at
/home/simon/kshbuild/src/cmd/ksh93/sh/fault.c:516
#20 0x00007eff312eae90 in sh_exec (shp=0x7eff3152bac0 <sh>,
t=0x7eff3021ead0, flags=512) at
/home/simon/kshbuild/src/cmd/ksh93/sh/xec.c:2955
#21 0x00007eff312e9b0f in sh_exec (shp=0x7eff3152bac0 <sh>,
t=0x7eff3021eaa0, flags=512) at
/home/simon/kshbuild/src/cmd/ksh93/sh/xec.c:2626
#22 0x00007eff312e9200 in sh_exec (shp=0x7eff3152bac0 <sh>,
t=0x7eff3021ea60, flags=4) at
/home/simon/kshbuild/src/cmd/ksh93/sh/xec.c:2464
#23 0x00007eff31273005 in exfile (shp=0x7eff3152bac0 <sh>,
iop=0x7eff302386f0, fno=11) at
/home/simon/kshbuild/src/cmd/ksh93/sh/main.c:599
#24 0x00007eff312721ac in sh_main (ac=2, av=0x7fff8fa0f508,
userinit=0x0) at /home/simon/kshbuild/src/cmd/ksh93/sh/main.c:371
#25 0x0000000000400751 in main (argc=2, argv=0x7fff8fa0f508) at
/home/simon/kshbuild/src/cmd/ksh93/sh/pmain.c:45

Simon
Cedric Blancher
2013-06-12 17:21:10 UTC
Permalink
Post by Simon Toedt
Post by Glenn Fowler
the ast-ksh 2013-06-11 alpha source has been posted to
http://www.research.att.com/sw/download/alpha/
its still a work in progress
dgk and I are corrdinating the new vmalloc implementation vs signals
in addition to the work dgk is doing in ksh vs signals
./src/cmd/ksh93/tests/signal.sh
test signal begins at 2013-06-12+14:30:26
signal.sh[296]: kill -VTALRM $$ failed, required termination
by signal 'KILL'
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
kill: 46807: no such process
#0 0x00007eff3039c570 in __nanosleep_nocancel () at
../sysdeps/unix/syscall-template.S:81
#1 0x00007eff306fde67 in tvsleep (tv=0x0, rv=0x0) at
/home/simon/kshbuild/src/lib/libast/tm/tvsleep.c:63
#2 0x00007eff3076746f in asorelax (nsec=262144) at
/home/simon/kshbuild/src/lib/libast/aso/asorelax.c:46
#3 0x00007eff3076741e in asolock (lock=0x7eff301e303c, key=20130501,
type=4) at /home/simon/kshbuild/src/lib/libast/aso/asolock.c:40
#4 0x00007eff3076ebf9 in dballoc (vm=0x7eff31b22dc0, size=144,
local=0) at /home/simon/kshbuild/src/lib/libast/vmalloc/vmdebug.c:333
#5 0x00007eff30768793 in _ast_malloc (size=144) at
/home/simon/kshbuild/src/lib/libast/vmalloc/malloc.c:680
#6 0x00007eff3128f689 in set_trapinfo (shp=0x7eff3152bac0 <sh>,
sig=41, info=0x7fff8fa0d630)
at /home/simon/kshbuild/src/cmd/ksh93/sh/fault.c:93
#7 0x00007eff3128fc68 in sh_fault (sig=41, info=0x7fff8fa0d630,
context=0x7fff8fa0d500)
at /home/simon/kshbuild/src/cmd/ksh93/sh/fault.c:241
#8 <signal handler called>
#9 sh_fault (sig=0, info=0x0, context=0x0) at
/home/simon/kshbuild/src/cmd/ksh93/sh/fault.c:119
#10 <signal handler called>
#11 0x00007eff3076f5b0 in vmdbcheck (vm=0x7eff31b22dc0) at
/home/simon/kshbuild/src/lib/libast/vmalloc/vmdebug.c:560
#12 0x00007eff3076ec16 in dballoc (vm=0x7eff31b22dc0, size=176,
local=0) at /home/simon/kshbuild/src/lib/libast/vmalloc/vmdebug.c:336
#13 0x00007eff30768793 in _ast_malloc (size=176) at
/home/simon/kshbuild/src/lib/libast/vmalloc/malloc.c:680
#14 0x00007eff3073b9e3 in sfnew (oldf=0x0, buf=0x7eff301ecc60, size=8,
file=-1, flags=5)
at /home/simon/kshbuild/src/lib/libast/sfio/sfnew.c:97
#15 0x00007eff30758387 in _sfopenat (cwd=-100, f=0x0,
file=0x7eff301ecc60 "rttrap 6", mode=0x7eff312fe0d5 "s")
at /home/simon/kshbuild/src/lib/libast/sfio/_sfopen.c:120
#16 0x00007eff307584c3 in _sfopen (f=0x0, file=0x7eff301ecc60 "rttrap
6", mode=0x7eff312fe0d5 "s")
at /home/simon/kshbuild/src/lib/libast/sfio/_sfopen.c:203
#17 0x00007eff3073c5e7 in sfopen (f=0x0, file=0x7eff301ecc60 "rttrap
6", mode=0x7eff312fe0d5 "s")
at /home/simon/kshbuild/src/lib/libast/sfio/sfopen.c:40
#18 0x00007eff312917e6 in sh_trap_20120720 (shp=0x7eff3152bac0 <sh>,
trap=0x7eff301ecc60 "rttrap 6", mode=0)
at /home/simon/kshbuild/src/cmd/ksh93/sh/fault.c:876
#19 0x00007eff31290719 in sh_chktrap (shp=0x7eff3152bac0 <sh>) at
/home/simon/kshbuild/src/cmd/ksh93/sh/fault.c:516
#20 0x00007eff312eae90 in sh_exec (shp=0x7eff3152bac0 <sh>,
t=0x7eff3021ead0, flags=512) at
/home/simon/kshbuild/src/cmd/ksh93/sh/xec.c:2955
#21 0x00007eff312e9b0f in sh_exec (shp=0x7eff3152bac0 <sh>,
t=0x7eff3021eaa0, flags=512) at
/home/simon/kshbuild/src/cmd/ksh93/sh/xec.c:2626
#22 0x00007eff312e9200 in sh_exec (shp=0x7eff3152bac0 <sh>,
t=0x7eff3021ea60, flags=4) at
/home/simon/kshbuild/src/cmd/ksh93/sh/xec.c:2464
#23 0x00007eff31273005 in exfile (shp=0x7eff3152bac0 <sh>,
iop=0x7eff302386f0, fno=11) at
/home/simon/kshbuild/src/cmd/ksh93/sh/main.c:599
#24 0x00007eff312721ac in sh_main (ac=2, av=0x7fff8fa0f508,
userinit=0x0) at /home/simon/kshbuild/src/cmd/ksh93/sh/main.c:371
#25 0x0000000000400751 in main (argc=2, argv=0x7fff8fa0f508) at
/home/simon/kshbuild/src/cmd/ksh93/sh/pmain.c:45
Solaris 11.1 too hangs:
fffffd7ffbcaa44a nanosleep (fffffd7fffdfd058, fffffd7fffdfd048)
fffffd7ffba6a050 tvsleep () + 40
fffffd7ffbb07cac asorelax () + 3c
fffffd7ffbb07c2b asolock () + bb
fffffd7ffbb11f16 dballoc () + 96
fffffd7ffbb0968c _ast_malloc () + fc
fffffd7ffb86eaea set_trapinfo () + ba
fffffd7ffb86f298 sh_fault () + 6b8
fffffd7ffbca2326 __sighndlr () + 6
fffffd7ffbc94ffc call_user_handler () + 2a4
fffffd7ffbc95223 sigacthandler (30, fffffd7fffdfd708, fffffd7fffdfd3a0) + db
--- called from signal handler with signal 48 (SIGRTMIN+7) ---
fffffd7ffbcabb0b _syscall6 () + 1b
fffffd7ffbc94f65 call_user_handler () + 20d
fffffd7ffbc95223 sigacthandler (19, fffffd7fffdfdcd0, fffffd7fffdfd970) + db
--- called from signal handler with signal 25 (SIGCONT) ---
fffffd7ffbb12c4b vmdbcheck () + 1bb
fffffd7ffbb11f38 dballoc () + b8
fffffd7ffbb0968c _ast_malloc () + fc
fffffd7ffb8b58ff nv_putval () + 8df
fffffd7ffb8baac9 nv_newattr () + 6f9
fffffd7ffb83c780 setall () + 1630
fffffd7ffb83ab51 b_typeset () + 1101
fffffd7ffb8ecb39 sh_exec () + 2689
fffffd7ffb8f030b sh_exec () + 5e5b
fffffd7ffb8f7adb sh_funscope_20120720 () + aeb
fffffd7ffb8f561a sh_funct () + 37a
fffffd7ffb8ed7dc sh_exec () + 332c
fffffd7ffb8f82d9 sh_eval_20120720 () + 3d9
fffffd7ffb871a2e sh_trap_20120720 () + 2fe
fffffd7ffb870149 sh_chktrap () + 3c9
fffffd7ffb8f399f sh_exec () + 94ef
fffffd7ffb8f1eff sh_exec () + 7a4f
fffffd7ffb8f143b sh_exec () + 6f8b
fffffd7ffb84451f exfile () + 11df
fffffd7ffb843302 sh_main () + 17e2
000000000040bd12 main () + 92
000000000040bb2c ???????? ()

The funny thing is the trap nesting, i.e. SIGCONT immediately followed
by a SIGRTMIN+7.

WTF does the SIGCONT come from? Glenn?

Ced
--
Cedric Blancher <cedric.blancher at googlemail.com>
Institute Pasteur
Cedric Blancher
2013-06-12 16:56:05 UTC
Permalink
Post by Glenn Fowler
the ast-ksh 2013-06-11 alpha source has been posted to
http://www.research.att.com/sw/download/alpha/
its still a work in progress
dgk and I are corrdinating the new vmalloc implementation vs signals
in addition to the work dgk is doing in ksh vs signals
signals still do NOT work. For example my test below should print (
typeset -l -E i=200.00200 ) but as you can see below it doesn't sum
up:
ksh -c 'compound a=(float i=0) ; trap "((a.i+=.00001));kill -USR2 $$&
:" USR1 ; trap "((a.i+=1))" USR2 ; for ((j=0;j<200;j++));do kill -USR1
$$&;done ; true ; while ! wait ; do true;done;print ${a}'
( typeset -l -E i=58.00094 )
ksh -c 'compound a=(float i=0) ; trap "((a.i+=.00001));kill -USR2 $$&
:" USR1 ; trap "((a.i+=1))" USR2 ; for ((j=0;j<200;j++));do kill -USR1
$$&;done ; true ; while ! wait ; do true;done;print ${a}'
( typeset -l -E i=24.00048 )

Ced
--
Cedric Blancher <cedric.blancher at googlemail.com>
Institute Pasteur
Glenn Fowler
2013-06-12 17:46:40 UTC
Permalink
Post by Cedric Blancher
Post by Simon Toedt
Post by Glenn Fowler
the ast-ksh 2013-06-11 alpha source has been posted to
http://www.research.att.com/sw/download/alpha/
its still a work in progress
dgk and I are corrdinating the new vmalloc implementation vs signals
in addition to the work dgk is doing in ksh vs signals
...
Post by Cedric Blancher
Post by Simon Toedt
#0 0x00007eff3039c570 in __nanosleep_nocancel () at
../sysdeps/unix/syscall-template.S:81
#1 0x00007eff306fde67 in tvsleep (tv=0x0, rv=0x0) at
/home/simon/kshbuild/src/lib/libast/tm/tvsleep.c:63
#2 0x00007eff3076746f in asorelax (nsec=262144) at
/home/simon/kshbuild/src/lib/libast/aso/asorelax.c:46
#3 0x00007eff3076741e in asolock (lock=0x7eff301e303c, key=20130501,
type=4) at /home/simon/kshbuild/src/lib/libast/aso/asolock.c:40
#4 0x00007eff3076ebf9 in dballoc (vm=0x7eff31b22dc0, size=144,
local=0) at /home/simon/kshbuild/src/lib/libast/vmalloc/vmdebug.c:333
#5 0x00007eff30768793 in _ast_malloc (size=144) at
...
Post by Cedric Blancher
fffffd7ffbcaa44a nanosleep (fffffd7fffdfd058, fffffd7fffdfd048)
fffffd7ffba6a050 tvsleep () + 40
fffffd7ffbb07cac asorelax () + 3c
fffffd7ffbb07c2b asolock () + bb
fffffd7ffbb11f16 dballoc () + 96
fffffd7ffbb0968c _ast_malloc () + fc
...

I've been working on the main allocator
the debug allocator dballoc() is next
they both have windows of code that can hang when a signal handler
calls malloc or free, the dballoc windows are definitely bigger at the moment
Post by Cedric Blancher
The funny thing is the trap nesting, i.e. SIGCONT immediately followed
by a SIGRTMIN+7.
WTF does the SIGCONT come from? Glenn?
SIGCONT may be an artifact of debugging/tracing?
Cedric Blancher
2013-06-12 17:59:48 UTC
Permalink
Post by Cedric Blancher
Post by Glenn Fowler
the ast-ksh 2013-06-11 alpha source has been posted to
http://www.research.att.com/sw/download/alpha/
its still a work in progress
dgk and I are corrdinating the new vmalloc implementation vs signals
in addition to the work dgk is doing in ksh vs signals
signals still do NOT work. For example my test below should print (
typeset -l -E i=200.00200 ) but as you can see below it doesn't sum
ksh -c 'compound a=(float i=0) ; trap "((a.i+=.00001));kill -USR2 $$&
:" USR1 ; trap "((a.i+=1))" USR2 ; for ((j=0;j<200;j++));do kill -USR1
$$&;done ; true ; while ! wait ; do true;done;print ${a}'
( typeset -l -E i=58.00094 )
ksh -c 'compound a=(float i=0) ; trap "((a.i+=.00001));kill -USR2 $$&
:" USR1 ; trap "((a.i+=1))" USR2 ; for ((j=0;j<200;j++));do kill -USR1
$$&;done ; true ; while ! wait ; do true;done;print ${a}'
( typeset -l -E i=24.00048 )
I noticed some problems in the code:
+#ifdef _lib_sigaction
+ static void set_trapinfo(Shell_t *shp, int sig, siginfo_t *info)
+ {
+ sigset_t set,oset;
+ if(!shp->siginfo)
+ shp->siginfo = (void**)calloc(sizeof(void*),shp->gd->sigmax);

This should IMO not be done in the signal handler. if multiple signal
handlers are running stacked on each other it may cause a race
condition between the if(!shp->siginfo) and the value assignment to
shp->siginfo.Actually the timing window is quite huge.

+ if(info)
+ {
+ struct Siginfo *jp,*ip;
+ sigfillset(&set);
+ sigprocmask(SIG_BLOCK,&set,&oset);
+ ip = malloc(sizeof(struct Siginfo));
+ sigprocmask(SIG_UNBLOCK,&oset,&set);
+ ip->next = 0;
+ memcpy(&ip->info,info,sizeof(siginfo_t));
+ if(!(jp=(struct Siginfo*)shp->siginfo[sig]))

Isn't SIG_BLOCK a good way to loose signals? What happens if new
signals arrive while the signal block is active? Are they queued or
discarded? I think they are discarded and the time spend in the
allocator gives another large window of opportunity to screw up and
loose more signals.

Ced
--
Cedric Blancher <cedric.blancher at googlemail.com>
Institute Pasteur
Cedric Blancher
2013-06-12 18:11:41 UTC
Permalink
Post by Cedric Blancher
Post by Cedric Blancher
Post by Glenn Fowler
the ast-ksh 2013-06-11 alpha source has been posted to
http://www.research.att.com/sw/download/alpha/
its still a work in progress
dgk and I are corrdinating the new vmalloc implementation vs signals
in addition to the work dgk is doing in ksh vs signals
signals still do NOT work. For example my test below should print (
typeset -l -E i=200.00200 ) but as you can see below it doesn't sum
ksh -c 'compound a=(float i=0) ; trap "((a.i+=.00001));kill -USR2 $$&
:" USR1 ; trap "((a.i+=1))" USR2 ; for ((j=0;j<200;j++));do kill -USR1
$$&;done ; true ; while ! wait ; do true;done;print ${a}'
( typeset -l -E i=58.00094 )
ksh -c 'compound a=(float i=0) ; trap "((a.i+=.00001));kill -USR2 $$&
:" USR1 ; trap "((a.i+=1))" USR2 ; for ((j=0;j<200;j++));do kill -USR1
$$&;done ; true ; while ! wait ; do true;done;print ${a}'
( typeset -l -E i=24.00048 )
+#ifdef _lib_sigaction
+ static void set_trapinfo(Shell_t *shp, int sig, siginfo_t *info)
+ {
+ sigset_t set,oset;
+ if(!shp->siginfo)
+ shp->siginfo = (void**)calloc(sizeof(void*),shp->gd->sigmax);
This should IMO not be done in the signal handler. if multiple signal
handlers are running stacked on each other it may cause a race
condition between the if(!shp->siginfo) and the value assignment to
shp->siginfo.Actually the timing window is quite huge.
+ if(info)
+ {
+ struct Siginfo *jp,*ip;
+ sigfillset(&set);
+ sigprocmask(SIG_BLOCK,&set,&oset);
+ ip = malloc(sizeof(struct Siginfo));
+ sigprocmask(SIG_UNBLOCK,&oset,&set);
+ ip->next = 0;
+ memcpy(&ip->info,info,sizeof(siginfo_t));
+ if(!(jp=(struct Siginfo*)shp->siginfo[sig]))
Isn't SIG_BLOCK a good way to loose signals? What happens if new
signals arrive while the signal block is active? Are they queued or
discarded? I think they are discarded and the time spend in the
allocator gives another large window of opportunity to screw up and
loose more signals.
+#ifdef SIGRTMIN
+ register int flag, sig=SIGRTMIN;
+#else
register int flag, sig=shp->st.trapmax;
+#endif

Why is sig set to SIGRTMIN? Doesn't this prevent signals > SIGRTMIN,
i.e. SIGRTMAX from being processed? there's no POSIX gurantee that the
realtime signals are on the top of the signal list either.

while(sig-- > 0)
{
if(trap=shp->st.trapcom[sig])

The while loop to count down the signal numbers has to be removed too.
Otherwise signals are not processed by traps in the order they've
arrived.

+ struct Siginfo *ip=0, *ipnext;
+retry:
+ sighold(sig);
+ if(shp->siginfo)
+ {
+ ip = (struct Siginfo*)shp->siginfo[sig];
+ shp->siginfo[sig] = 0;
+ }
+ again:

What is the purpose of sighold()? Why is sighold() required when the
signals are queued in sh_fault() running on the signal handler stack
and processed on the user stack?

Ced
--
Cedric Blancher <cedric.blancher at googlemail.com>
Institute Pasteur
Lionel Cons
2013-06-12 20:56:25 UTC
Permalink
Post by Cedric Blancher
Post by Cedric Blancher
Post by Cedric Blancher
Post by Glenn Fowler
the ast-ksh 2013-06-11 alpha source has been posted to
http://www.research.att.com/sw/download/alpha/
its still a work in progress
dgk and I are corrdinating the new vmalloc implementation vs signals
in addition to the work dgk is doing in ksh vs signals
signals still do NOT work. For example my test below should print (
typeset -l -E i=200.00200 ) but as you can see below it doesn't sum
ksh -c 'compound a=(float i=0) ; trap "((a.i+=.00001));kill -USR2 $$&
:" USR1 ; trap "((a.i+=1))" USR2 ; for ((j=0;j<200;j++));do kill -USR1
$$&;done ; true ; while ! wait ; do true;done;print ${a}'
( typeset -l -E i=58.00094 )
ksh -c 'compound a=(float i=0) ; trap "((a.i+=.00001));kill -USR2 $$&
:" USR1 ; trap "((a.i+=1))" USR2 ; for ((j=0;j<200;j++));do kill -USR1
$$&;done ; true ; while ! wait ; do true;done;print ${a}'
( typeset -l -E i=24.00048 )
+#ifdef _lib_sigaction
+ static void set_trapinfo(Shell_t *shp, int sig, siginfo_t *info)
+ {
+ sigset_t set,oset;
+ if(!shp->siginfo)
+ shp->siginfo = (void**)calloc(sizeof(void*),shp->gd->sigmax);
This should IMO not be done in the signal handler. if multiple signal
handlers are running stacked on each other it may cause a race
condition between the if(!shp->siginfo) and the value assignment to
shp->siginfo.Actually the timing window is quite huge.
+ if(info)
+ {
+ struct Siginfo *jp,*ip;
+ sigfillset(&set);
+ sigprocmask(SIG_BLOCK,&set,&oset);
+ ip = malloc(sizeof(struct Siginfo));
+ sigprocmask(SIG_UNBLOCK,&oset,&set);
+ ip->next = 0;
+ memcpy(&ip->info,info,sizeof(siginfo_t));
+ if(!(jp=(struct Siginfo*)shp->siginfo[sig]))
Isn't SIG_BLOCK a good way to loose signals? What happens if new
signals arrive while the signal block is active? Are they queued or
discarded? I think they are discarded and the time spend in the
allocator gives another large window of opportunity to screw up and
loose more signals.
+#ifdef SIGRTMIN
+ register int flag, sig=SIGRTMIN;
+#else
register int flag, sig=shp->st.trapmax;
+#endif
Why is sig set to SIGRTMIN? Doesn't this prevent signals > SIGRTMIN,
i.e. SIGRTMAX from being processed? there's no POSIX gurantee that the
realtime signals are on the top of the signal list either.
while(sig-- > 0)
{
if(trap=shp->st.trapcom[sig])
The while loop to count down the signal numbers has to be removed too.
Otherwise signals are not processed by traps in the order they've
arrived.
+ struct Siginfo *ip=0, *ipnext;
+ sighold(sig);
+ if(shp->siginfo)
+ {
+ ip = (struct Siginfo*)shp->siginfo[sig];
+ shp->siginfo[sig] = 0;
+ }
What is the purpose of sighold()? Why is sighold() required when the
signals are queued in sh_fault() running on the signal handler stack
and processed on the user stack?
The use of sighold() may be the culprit for some issues. The Linux
manpage clearly says " This API is obsolete: new appli-
cations should use the POSIX signal API (sigaction(2),
sigprocmask(2), etc.)". On some platforms its even not possible to
safely mix sighold() with sigaction() without loosing signals.

The other issue which jumped in my eye is that the queue management is
far from async signal safe and that the natural ordering of signals is
badly disturbed by processing them by signal number instead of the
order they've been received.

Did anyone thought about the idea of using signalfd() instead?

Lionel
Dr. Werner Fink
2013-06-14 07:41:34 UTC
Permalink
Post by Lionel Cons
The use of sighold() may be the culprit for some issues. The Linux
manpage clearly says " This API is obsolete: new appli-
cations should use the POSIX signal API (sigaction(2),
sigprocmask(2), etc.)". On some platforms its even not possible to
safely mix sighold() with sigaction() without loosing signals.
The other issue which jumped in my eye is that the queue management is
far from async signal safe and that the natural ordering of signals is
badly disturbed by processing them by signal number instead of the
order they've been received.
Did anyone thought about the idea of using signalfd() instead?
AFAIK signalfd() is very specific to Linux ...

Werner
--
"Having a smoking section in a restaurant is like having
a peeing section in a swimming pool." -- Edward Burr
Loading...