Discussion:
[ast-developers] Crash with _.__.i in nested types...
Roland Mainz
2013-08-17 17:06:51 UTC
Permalink
Hi!

----

The following testcase...
-- snip --
typeset -T x_t=(
integer i=2
function printi
{
printf 'i1=%d i2=%d\n' _.i _.__.i
}
)

typeset -T y_t=(
integer i=3
x_t x
)


y_t y

y.x.printi
-- snip --

... should AFAIK print:
-- snip --
i1=2 i2=3
-- snip --

... but ast-ksh.2013-08-14 on SuSE 12.3/AMD64/64bit Linux crashes like this:
-- snip --
Program received signal SIGSEGV, Segmentation fault.
__strncmp_sse42 () at ../sysdeps/x86_64/multiarch/strcmp-sse42.S:1740
1740 movzx (%rdi), %eax
(gdb) where
#0 __strncmp_sse42 () at ../sysdeps/x86_64/multiarch/strcmp-sse42.S:1740
#1 0x00000000004986c8 in create_type (np=0x7ffff7f1d7d0,
name=0x7ffff7f18f24 "__.i", flag=933888, fp=0x7ffff7f3f260)
at /home/test001/work/ast_ksh_20130814/build_i386_64bit_debug/src/cmd/ksh93/sh/nvtype.c:551
#2 0x0000000000449e5c in create_tree (np=0x7ffff7f1d7d0,
name=0x7ffff7f18f24 "__.i", flag=933888, dp=0x7ffff7f1d2d0)
at /home/test001/work/ast_ksh_20130814/build_i386_64bit_debug/src/cmd/ksh93/sh/nvtree.c:80
#3 0x00000000004427e2 in nv_create (name=0x7ffff7f18f20 "y.x.__.i",
root=0x7ffff7edab10, flags=933888, dp=0x7fffffff7680)
at /home/test001/work/ast_ksh_20130814/build_i386_64bit_debug/src/cmd/ksh93/sh/name.c:1280
#4 0x0000000000443538 in nv_open (name=0x7ffff7f29401 "_.__.i",
root=0x7ffff7f289f0, flags=409600)
at /home/test001/work/ast_ksh_20130814/build_i386_64bit_debug/src/cmd/ksh93/sh/name.c:1512
#5 0x000000000049edf5 in arith (ptr=0x7fffffff7a10,
lvalue=0x7fffffff78f0, type=0, n=0)
at /home/test001/work/ast_ksh_20130814/build_i386_64bit_debug/src/cmd/ksh93/sh/arith.c:363
#6 0x000000000045ff9e in expr (vp=0x7fffffff7a00, precedence=0) at
/home/test001/work/ast_ksh_20130814/build_i386_64bit_debug/src/cmd/ksh93/sh/streval.c:902
#7 0x0000000000460417 in arith_compile (shp=0x806260 <sh>,
string=0x7ffff7f29401 "_.__.i", last=0x7fffffff7b80, fun=0x49e2e7
<arith>, emode=0)
at /home/test001/work/ast_ksh_20130814/build_i386_64bit_debug/src/cmd/ksh93/sh/streval.c:953
#8 0x0000000000460673 in strval (shp=0x806260 <sh>, s=0x7ffff7f29401
"_.__.i", end=0x7fffffff7b80, conv=0x49e2e7 <arith>, emode=0)
at /home/test001/work/ast_ksh_20130814/build_i386_64bit_debug/src/cmd/ksh93/sh/streval.c:1002
#9 0x000000000049fa6d in sh_strnum_20120720 (shp=0x806260 <sh>,
str=0x7ffff7f29401 "_.__.i", ptr=0x7fffffff7be8, mode=0)
at /home/test001/work/ast_ksh_20130814/build_i386_64bit_debug/src/cmd/ksh93/sh/arith.c:568
#10 0x0000000000487042 in extend (sp=0x803fe0 <_Sfstdout>,
v=0x7fffffffcd20, fe=0x7fffffffcfb0)
at /home/test001/work/ast_ksh_20130814/build_i386_64bit_debug/src/cmd/ksh93/bltins/print.c:864
#11 0x00000000005128d7 in sfvprintf (f=0x803fe0 <_Sfstdout>,
form=0x7ffff7f18eeb "\n", args=0x7fffffffcea8)
at /home/test001/work/ast_ksh_20130814/build_i386_64bit_debug/src/lib/libast/sfio/sfvprintf.c:547
#12 0x000000000050694a in sfprintf (f=0x803fe0 <_Sfstdout>,
form=0x58ffa7 "%!") at
/home/test001/work/ast_ksh_20130814/build_i386_64bit_debug/src/lib/libast/sfio/sfprintf.c:48
#13 0x0000000000485730 in b_print (argc=-1, argv=0x7ffff7f29440,
context=0x7fffffffd110)
at /home/test001/work/ast_ksh_20130814/build_i386_64bit_debug/src/cmd/ksh93/bltins/print.c:327
#14 0x0000000000484f53 in b_printf (argc=4, argv=0x7ffff7f29430,
context=0x8067c8 <sh+1384>)
at /home/test001/work/ast_ksh_20130814/build_i386_64bit_debug/src/cmd/ksh93/bltins/print.c:149
#15 0x0000000000468fc0 in sh_exec (shp=0x806260 <sh>,
t=0x7ffff7f29370, flags=6) at
/home/test001/work/ast_ksh_20130814/build_i386_64bit_debug/src/cmd/ksh93/sh/xec.c:1362
#16 0x0000000000471269 in sh_funscope_20120720 (shp=0x806260 <sh>,
argn=1, argv=0x7ffff7f18ba0, fun=0x0, arg=0x7fffffffd900, execflg=4)
at /home/test001/work/ast_ksh_20130814/build_i386_64bit_debug/src/cmd/ksh93/sh/xec.c:4055
#17 0x000000000046ffcd in sh_funct (shp=0x806260 <sh>,
np=0x7ffff7f3da30, argn=1, argv=0x7ffff7f18ba0, envlist=0x0,
execflg=4)
at /home/test001/work/ast_ksh_20130814/build_i386_64bit_debug/src/cmd/ksh93/sh/xec.c:3385
#18 0x0000000000469ae4 in sh_exec (shp=0x806260 <sh>,
t=0x7ffff7f18b40, flags=4) at
/home/test001/work/ast_ksh_20130814/build_i386_64bit_debug/src/cmd/ksh93/sh/xec.c:1561
#19 0x000000000040f592 in exfile (shp=0x806260 <sh>,
iop=0x7ffff7edcdf0, fno=11) at
/home/test001/work/ast_ksh_20130814/build_i386_64bit_debug/src/cmd/ksh93/sh/main.c:603
#20 0x000000000040e7dd in sh_main (ac=2, av=0x7fffffffe268,
userinit=0x0) at
/home/test001/work/ast_ksh_20130814/build_i386_64bit_debug/src/cmd/ksh93/sh/main.c:375
#21 0x000000000040d9b1 in main (argc=2, argv=0x7fffffffe268) at
/home/test001/work/ast_ksh_20130814/build_i386_64bit_debug/src/cmd/ksh93/sh/pmain.c:45
-- 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...