[Pkg-tcltk-devel] Bug#487549: tcLex segfaults under tcl8.5 (in transcriber)

Stephen McCamant smcc at CSAIL.MIT.EDU
Sun Jun 22 15:34:10 UTC 2008


Package: tclex
Version: 1.2a1-14

When I try to run transcriber, which uses tcLex, under a version 8.5
Tcl/Tk wish, it segfaults. If a file is specified on the command line,
it crashes immediately; otherwise it opens a file chooser and then
crashes after you choose a file. (I suspect that this is the same
failure behind transcriber bug #484738, though it's hard to be sure
because there aren't any details of the failure in that report.)

Here's the tcLex part of the stack backtrace:

#0  0xb6dfc722 in RuleGetRange (interp=0x8053f80, lexer=0x8358ff8, 
    rule=0x82d34f8, stringObj=0x88cab00, index=0, rangeIndex=0, 
    startPtr=0xbfd21880, endPtr=0xbfd2187c) at RE82.c:140
#1  0xb6dfa779 in RuleTry (interp=0x8053f80, lexer=0x8358ff8, iRule=0,
    bCheckOverrun=0, pMinLength=0xbfd218d4) at tcLex.c:1580
#2  0xb6dfad3c in LexerEval (interp=0x8053f80, lexer=0x8358ff8, 
    bCheckOverrun=0) at tcLex.c:1859
#3  0xb6dfb5fc in LexerEvalObjCmd (interp=0x8053f80, lexer=0x8358ff8, objc=4, 
    objv=0x816c8c4, op=0) at tcLex.c:2193
#4  0xb6dfc23b in LexerObjCmd (clientData=0x8358ff8, interp=0x8053f80, objc=4, 
    objv=0x816c8c4) at tcLex.c:2950
#5  0xb7cdb741 in TclEvalObjvInternal (interp=0x8053f80, objc=4, 
    objv=0x816c8c4, command=0xffffffff <Address 0xffffffff out of bounds>, 
    length=-1, flags=0)

(My invocation to get this to run under GDB with debugging symbols is:

LD_LIBRARY_PATH=/src/debian/tclex-1.2a1/install/lib:/src/debian/tcl8.5-8.5.2/install/lib TCLLIBPATH=/src/debian/tclex-1.2a1/install/lib/tcltk gdb --args /src/debian/tk8.5-8.5.2/unix/wish /usr/lib/transcriber1.5/tcl/Main.tcl /tmp/foo.wav

where I've done source builds of the respective tcl8.5, tk8.5, and
tclex packages with debugging enabled)

Line 140 is:

            *startPtr = regexpPtr->matches[rangeIndex].rm_so+index;

and the proximate cause of the segfault is that regexpPtr->matches is
null. I tried adding an extra guard condition of "|| !regexpPtr->matches"
on the preceding if statement, and that prevents the segfault, but it
seems to give the wrong behavior. It causes transcriber to die with a
parse error on a file that should be known to be correct. (The XML DTD
describing its file format.)

Looking back at the package history, it appears that tcLex has needed
a bit of porting for every time the Tcl regexp library is updated, so
I think that's what's called for again. But it still works fine for me
with Tcl 8.4, so a fallback would be detect the incompatibility and
give a better error.

Relevant package versions:

ii  tcl8.5         8.5.2-1        Tcl (the Tool Command Language) v8.5 - run-t
ii  tk8.5          8.5.2-1        Tk toolkit for Tcl and X11, v8.5 - run-time 
ii  transcriber    1.5.1.1-1      Transcribe speech data using an integrated e

 -- Stephen





More information about the Pkg-tcltk-devel mailing list