Hello ksh developers,
We have a customer running ksh version 93t+ 2010-03-05 and one of their
scripts is triggering a segmentation fault in the shell. We were able to reduce
the offending script to the following snip:
#!/bin/ksh
function crash
{
typeset L_FILE
typeset L_VALIDATION
typeset L_VARIABLE
typeset L_MOD IFS
OS=$(uname)
}
crash
# end
Here's the call trace extracted from the core dump:
Core was generated by `/bin/ksh ./crash.ksh'.
Program terminated with signal 11, Segmentation fault.
#0 0x00007f0f936d4c05 in nv_getv (np=0x60db28, nfp=<value optimized out>)
at /usr/src/debug/ksh93/src/cmd/ksh93/sh/nvdisc.c:50
50 if(!fp->disc || (!fp->disc->getnum &&
!fp->disc->getval))
(gdb) bt
#0 0x00007f0f936d4c05 in nv_getv (np=0x60db28, nfp=<value optimized out>)
at /usr/src/debug/ksh93/src/cmd/ksh93/sh/nvdisc.c:50
#1 0x00007f0f93703b7b in nv_getval (np=0x60db28)
at /usr/src/debug/ksh93/src/cmd/ksh93/sh/name.c:2464
#2 0x00007f0f9371e769 in sh_funscope (argn=<value optimized out>,
argv=0x60c4f0, fun=0, arg=0x7fff2a9892b0, execflg=5)
at /usr/src/debug/ksh93/src/cmd/ksh93/sh/xec.c:2668
#3 0x00007f0f9371ecf7 in sh_funct (np=0x616940, argn=1, argv=0x60c4f0,
envlist=0x0, execflg=5, shp=<value optimized out>)
at /usr/src/debug/ksh93/src/cmd/ksh93/sh/xec.c:2728
#4 0x00007f0f93723722 in sh_exec (t=0x60c490, flags=5)
at /usr/src/debug/ksh93/src/cmd/ksh93/sh/xec.c:1138
#5 0x00007f0f936d39a2 in exfile (shp=0x7f0f93957220, iop=0x615f90, fno=10)
at /usr/src/debug/ksh93/src/cmd/ksh93/sh/main.c:615
#6 0x00007f0f936d4331 in sh_main (ac=<value optimized out>,
av=0x7fff2a989bc8, userinit=<value optimized out>)
at /usr/src/debug/ksh93/src/cmd/ksh93/sh/main.c:387
#7 0x00007f0f92a1db7d in __libc_start_main () from /lib64/libc.so.6
#8 0x0000000000400669 in _start () at ../sysdeps/x86_64/elf/start.S:113
(gdb) print fp->disc
$1 = (const Namdisc_t *) 0xa0920
(gdb) print fp->disc->getnum
Cannot access memory at address 0xa0938
(gdb) print fp->disc->getval
Cannot access memory at address 0xa0930
I confirmed that this bug is already fixed in the latest stable ksh release
(2010-06-21) but, unfortunately, I can't just send the updated version to the
customer (they would have to retest all their scripts because of the version
update).
Checking the differences between 2010-03-05 and 2010-06-21, we were able
to isolate the fix to the changes in comsub/subdup and sh_subtmpfile together
with iousepipe() / iounpipe(). Since these changes are huge and we don't have
access to Ksh version control system, we are worried about the risk of missing
some parts of the fix.
And that's why I'm here to ask your help: if you remember which change fixed
this bug, could you please retrieve it from your repository and send me the
patch? I know this is an unusual request and I'll understand if you tell me to
just run the latest version :-)
Thanks!
Leonardo
_______________________________________________
ast-developers mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-developers