Discussion:
[ast-developers] Short int array in an user-defined type crashes ast-ksh.2013-07-27 ...
Roland Mainz
2013-07-30 22:36:49 UTC
Permalink
Hi!

----

The following one-liner crashes ast-ksh.2013-07-27 on SuSE
12.3/AMD64/64bit when I use an array of short integers:
-- snip --
$ ksh -c 'typeset -T x_t=( typeset -s -i i=( 5 6 7 ) ); x_t t ; print
$(( t.i[1]=0xFFFFFFFFFFFE , t.i[1] )) ; true'
-- snip --

Stack trace looks like this:
-- snip --
#0 0x00000000004442bf in nv_putval (np=0x7ffff7f2f558,
string=0x7fffffffc7d0 "", flags=26) at
/home/test001/work/ast_ksh_20130727/build_sync/src/cmd/ksh93/sh/name.c:1837
#1 0x0000000000493c11 in nv_putv (np=0x7ffff7f2f558,
value=0x7fffffffc7d0 "", flags=26, nfp=0x0) at
/home/test001/work/ast_ksh_20130727/build_sync/src/cmd/ksh93/sh/nvdisc.c:157
#2 0x00000000004978e1 in put_chtype (np=0x7ffff7f2f558,
val=0x7fffffffc7d0 "", flag=26, fp=0x7ffff7f2f4e8)
at /home/test001/work/ast_ksh_20130727/build_sync/src/cmd/ksh93/sh/nvtype.c:239
#3 0x0000000000493be8 in nv_putv (np=0x7ffff7f2f558,
value=0x7fffffffc7d0 "", flags=26, nfp=0x0) at
/home/test001/work/ast_ksh_20130727/build_sync/src/cmd/ksh93/sh/nvdisc.c:152
#4 0x00000000004a50ba in array_putval (np=0x7ffff7f2f558,
string=0x7fffffffc7d0 "", flags=26, dp=0x7ffff7f21570)
at /home/test001/work/ast_ksh_20130727/build_sync/src/cmd/ksh93/sh/array.c:741
#5 0x0000000000493be8 in nv_putv (np=0x7ffff7f2f558,
value=0x7fffffffc7d0 "", flags=26, nfp=0x0) at
/home/test001/work/ast_ksh_20130727/build_sync/src/cmd/ksh93/sh/nvdisc.c:152
#6 0x0000000000443ad0 in nv_putval (np=0x7ffff7f2f558,
string=0x7fffffffc7d0 "", flags=26) at
/home/test001/work/ast_ksh_20130727/build_sync/src/cmd/ksh93/sh/name.c:1653
#7 0x000000000049e82e in arith (ptr=0x7fffffffc898,
lvalue=0x7fffffffc850, type=1, n=281474976710654)
at /home/test001/work/ast_ksh_20130727/build_sync/src/cmd/ksh93/sh/arith.c:238
#8 0x000000000045cca3 in arith_exec (ep=0x7ffff7f1ce10) at
/home/test001/work/ast_ksh_20130727/build_sync/src/cmd/ksh93/sh/streval.c:307
#9 0x000000000043bb7d in comsubst (mp=0x7ffff7ee28e0,
t=0x7ffff7f1cdf0, type=3) at
/home/test001/work/ast_ksh_20130727/build_sync/src/cmd/ksh93/sh/macro.c:2073
#10 0x000000000043852c in varsub (mp=0x7ffff7ee28e0) at
/home/test001/work/ast_ksh_20130727/build_sync/src/cmd/ksh93/sh/macro.c:1190
#11 0x00000000004368e4 in copyto (mp=0x7ffff7ee28e0, endch=0,
newquote=0) at /home/test001/work/ast_ksh_20130727/build_sync/src/cmd/ksh93/sh/macro.c:634
#12 0x000000000043505c in sh_macexpand (shp=0x803260 <sh>,
argp=0x7ffff7f1cc60, arghead=0x7fffffffd2e0, flag=0)
at /home/test001/work/ast_ksh_20130727/build_sync/src/cmd/ksh93/sh/macro.c:245
#13 0x00000000004a3136 in arg_expand (shp=0x803260 <sh>, argp=0x0,
argchain=0x7fffffffd2e0, flag=0) at
/home/test001/work/ast_ksh_20130727/build_sync/src/cmd/ksh93/sh/args.c:1112
#14 0x00000000004a29e1 in sh_argbuild (shp=0x803260 <sh>,
nargs=0x7fffffffd524, comptr=0x7ffff7f1cc20, flag=0)
at /home/test001/work/ast_ksh_20130727/build_sync/src/cmd/ksh93/sh/args.c:950
#15 0x000000000046724e in sh_exec (shp=0x803260 <sh>,
t=0x7ffff7f1cc20, flags=4) at
/home/test001/work/ast_ksh_20130727/build_sync/src/cmd/ksh93/sh/xec.c:992
#16 0x000000000046bad7 in sh_exec (shp=0x803260 <sh>,
t=0x7ffff7f1cd30, flags=5) at
/home/test001/work/ast_ksh_20130727/build_sync/src/cmd/ksh93/sh/xec.c:2223
#17 0x000000000040f4c2 in exfile (shp=0x803260 <sh>,
iop=0x7ffff7ee04d0, fno=-1) at
/home/test001/work/ast_ksh_20130727/build_sync/src/cmd/ksh93/sh/main.c:603
#18 0x000000000040e70d in sh_main (ac=3, av=0x7fffffffe188,
userinit=0x0) at
/home/test001/work/ast_ksh_20130727/build_sync/src/cmd/ksh93/sh/main.c:375
#19 0x000000000040d8e1 in main (argc=3, argv=0x7fffffffe188) at
/home/test001/work/ast_ksh_20130727/build_sync/src/cmd/ksh93/sh/pmain.c:45
(gdb) print up->sp
$1 = (int16_t *) 0x0
-- snip --

----

Bye,
Roland
--
__ . . __
(o.\ \/ /.o) roland.mainz at nrubsig.org
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 3992797
(;O/ \/ \O;)
Loading...