Hi!

----

The following "enum" array usage triggers a crash with
ast-ksh.2012-11-21 on SuSE 12.2/Linux/AMD64/64bit:
-- snip --
$ ~/bin/ksh -c $'enum bb=( ya ba ) ; \ntypeset -T x_t=( bb -a n=(
[2][6]=ba ) ) ; x_t y ; print $(( y.n[2][6] ))'
/home/test001/bin/ksh[2]: bb: line 1: .sh.type.x_t.x_t.n[2]=: no parent
Segmentation fault
-- snip --

Stack trace looks like this:
-- snip --
$ gdb --args ~/bin/ksh -c $'enum bb=( ya ba ) ; \ntypeset -T x_t=( bb
-a n=( [2][6]=ba ) ) ; x_t y ; print $(( y.n[2][6] ))'
GNU gdb (GDB) SUSE (7.4.50.20120603-2.1.2)
[snip]
(gdb) run
Starting program: /home/test001/bin/ksh -c enum\ bb=\(\ ya\ ba\ \)\ \;\ '
'typeset\ -T\ x_t=\(\ bb\ -a\ n=\(\ \[2\]\[6\]=ba\ \)\ \)\ \;\ x_t\ y\
\;\ print\ \$\(\(\ y.n\[2\]\[6\]\ \)\)
/home/test001/bin/ksh[2]: bb: line 1: .sh.type.x_t.x_t.n[2]=: no parent

Program received signal SIGSEGV, Segmentation fault.
0x000000000042b011 in nv_putsub_20120720 (np=0x0, sp=0x0, size=0,
flags=16777216) at
/home/test001/work/ast_ksh_20121121/build_i386_64bit_debug/src/cmd/ksh93/sh/array.c:1195
1195            Shell_t *shp = sh_ptr(np);
Missing separate debuginfos, use: zypper install
glibc-debuginfo-2.15-22.6.4.x86_64
(gdb) where
#0  0x000000000042b011 in nv_putsub_20120720 (np=0x0, sp=0x0, size=0,
flags=16777216) at
/home/test001/work/ast_ksh_20121121/build_i386_64bit_debug/src/cmd/ksh93/sh/array.c:1195
#1  0x000000000042b57b in nv_putsub_20120720 (np=0x7ffff7fab638,
sp=0x7ffff7fc3594 "2", size=2, flags=0)
    at 
/home/test001/work/ast_ksh_20121121/build_i386_64bit_debug/src/cmd/ksh93/sh/array.c:1310
#2  0x000000000042c5f9 in nv_endsubscript (np=0x7ffff7fab638,
cp=0x7ffff7fc3595 "", mode=1024, context=0x811620 <sh>)
    at 
/home/test001/work/ast_ksh_20121121/build_i386_64bit_debug/src/cmd/ksh93/sh/array.c:1581
#3  0x0000000000460751 in nv_create (name=0x7ffff7fc3590 "y.n[2",
root=0x7ffff7fe2f80, flags=1441792, dp=0x7fffffffc590)
    at 
/home/test001/work/ast_ksh_20121121/build_i386_64bit_debug/src/cmd/ksh93/sh/name.c:1048
#4  0x0000000000461b1f in nv_open (name=0x7ffff7fc3522 "y.n[2][6]",
root=0x7ffff7fe2f80, flags=1441792)
    at 
/home/test001/work/ast_ksh_20121121/build_i386_64bit_debug/src/cmd/ksh93/sh/name.c:1408
#5  0x00000000004257ad in scope (np=0x7ffff7fc3522,
lvalue=0x7fffffffc8c0, assign=0) at
/home/test001/work/ast_ksh_20121121/build_i386_64bit_debug/src/cmd/ksh93/sh/arith.c:83
#6  0x00000000004270df in arith (ptr=0x7fffffffc908,
lvalue=0x7fffffffc8c0, type=2, n=0)
    at 
/home/test001/work/ast_ksh_20121121/build_i386_64bit_debug/src/cmd/ksh93/sh/arith.c:451
#7  0x000000000047aa29 in arith_exec (ep=0x7ffff7fc3550) at
/home/test001/work/ast_ksh_20121121/build_i386_64bit_debug/src/cmd/ksh93/sh/streval.c:249
#8  0x000000000045a664 in comsubst (mp=0x7ffff7fe2990,
t=0x7ffff7fc3530, type=3) at
/home/test001/work/ast_ksh_20121121/build_i386_64bit_debug/src/cmd/ksh93/sh/macro.c:2051
#9  0x0000000000456cde in varsub (mp=0x7ffff7fe2990) at
/home/test001/work/ast_ksh_20121121/build_i386_64bit_debug/src/cmd/ksh93/sh/macro.c:1164
#10 0x00000000004552af in copyto (mp=0x7ffff7fe2990, endch=0,
newquote=0) at 
/home/test001/work/ast_ksh_20121121/build_i386_64bit_debug/src/cmd/ksh93/sh/macro.c:630
#11 0x0000000000453a54 in sh_macexpand (shp=0x811620 <sh>,
argp=0x7ffff7fc3480, arghead=0x7fffffffd330, flag=0)
    at 
/home/test001/work/ast_ksh_20121121/build_i386_64bit_debug/src/cmd/ksh93/sh/macro.c:241
#12 0x00000000004b3b74 in arg_expand (shp=0x811620 <sh>, argp=0x0,
argchain=0x7fffffffd330, flag=0)
    at 
/home/test001/work/ast_ksh_20121121/build_i386_64bit_debug/src/cmd/ksh93/sh/args.c:867
#13 0x00000000004b35c7 in sh_argbuild (shp=0x811620 <sh>,
nargs=0x7fffffffd57c, comptr=0x7ffff7fc3440, flag=0)
    at 
/home/test001/work/ast_ksh_20121121/build_i386_64bit_debug/src/cmd/ksh93/sh/args.c:724
#14 0x0000000000485234 in sh_exec (shp=0x811620 <sh>,
t=0x7ffff7fc3440, flags=5) at
/home/test001/work/ast_ksh_20121121/build_i386_64bit_debug/src/cmd/ksh93/sh/xec.c:963
#15 0x0000000000489aa0 in sh_exec (shp=0x811620 <sh>,
t=0x7ffff7fc3440, flags=5) at
/home/test001/work/ast_ksh_20121121/build_i386_64bit_debug/src/cmd/ksh93/sh/xec.c:2197
#16 0x0000000000419e57 in exfile (shp=0x811620 <sh>,
iop=0x7ffff7faa520, fno=-1) at
/home/test001/work/ast_ksh_20121121/build_i386_64bit_debug/src/cmd/ksh93/sh/main.c:582
#17 0x000000000041901c in sh_main (ac=3, av=0x7fffffffe218,
userinit=0x0) at
/home/test001/work/ast_ksh_20121121/build_i386_64bit_debug/src/cmd/ksh93/sh/main.c:354
#18 0x0000000000418121 in main (argc=3, argv=0x7fffffffe218) at
/home/test001/work/ast_ksh_20121121/build_i386_64bit_debug/src/cmd/ksh93/sh/pmain.c:45
-- snip --

----

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