Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 0263a925fa7ea6528c8c1a018ef89ea33aacbd6c
Ticket: 735186ffffffffffffffffffffffffffffffffff
tests cmdMZ-return-1.1 and proc-old-7.7 segfault
User & Date: mistachkin on 2003-05-09 19:50:33
Changes

  1. icomment:
    Logged In: YES 
    user_id=113501
    
    It's segfaulting in generic/tclIndexObj.c, near line 218:
    
    for (p1 = key, p2 = *entryPtr; *p1 == *p2; p1++, p2++) {
    
    It appears that somehow the parent loop is running off 
    the end of the passed in array (it fails at index 5 and the 
    maximum valid index is 4).
    
    After some effort, I isolated what I believe to be the root 
    cause of this problem:
    
    static CONST char *returnCodes[] = {
        "ok", "error", "return", "break", "continue"
    };
    
    should (most likely) really be:
    
    static CONST char *returnCodes[] = {
        "ok", "error", "return", "break", "continue", NULL
    };
    
    The above code is from tclCmdMZ.c, near line 1001.
    
    Here is the stack trace for Windows NT 4.0 (the only 
    platform so far where it seems to fail):
    
    Tcl_GetIndexFromObjStruct(Tcl_Interp * 0x00000000, 
    Tcl_Obj * 0x00fd0050, const void * 0x100bd560 
    returnCodes, int 0x00000004, const char * 
    0x00000000, int 0x00000001, int * 0x0026c530) line 
    218 + 43 bytes
    Tcl_GetIndexFromObj(Tcl_Interp * 0x00000000, Tcl_Obj 
    * 0x00fd0050, const char * * 0x100bd560 returnCodes, 
    const char * 0x00000000, int 0x00000001, int * 
    0x0026c530) line 127 + 31 bytes
    Tcl_ReturnObjCmd(void * 0x00000000, Tcl_Interp * 
    0x00a00fb0, int 0x00000000, Tcl_Obj * const * 
    0x0026c754) line 1006 + 24 bytes
    TclEvalObjvInternal(Tcl_Interp * 0x00a00fb0, int 
    0x00000003, Tcl_Obj * const * 0x0026c748, const char 
    * 0x00aaab85, int 0x00000011, int 0x00000000) line 
    3104 + 25 bytes
    Tcl_EvalEx(Tcl_Interp * 0x00a00fb0, const char * 
    0x00aaab80, int 0x00000016, int 0x00040000) line 
    3541 + 36 bytes
    Tcl_EvalObjEx(Tcl_Interp * 0x00a00fb0, Tcl_Obj * 
    0x00aaad80, int 0x00040000) line 3764 + 21 bytes
    Tcl_UplevelObjCmd(void * 0x00000000, Tcl_Interp * 
    0x00a00fb0, int 0x00000001, Tcl_Obj * const * 
    0x009f40a8) line 674 + 20 bytes
    TclEvalObjvInternal(Tcl_Interp * 0x00a00fb0, int 
    0x00000003, Tcl_Obj * const * 0x009f40a0, const char 
    * 0x00000000, int 0x00000000, int 0x00000000) line 
    3104 + 25 bytes
    TclExecuteByteCode(Tcl_Interp * 0x00a00fb0, ByteCode 
    * 0x00adcc68) line 1404 + 36 bytes
    TclCompEvalObj(Tcl_Interp * 0x00a00fb0, Tcl_Obj * 
    0x00ae7dc0) line 984 + 13 bytes
    TclObjInterpProc(void * 0x00ac20b8, Tcl_Interp * 
    0x00a00fb0, int 0x00000003, Tcl_Obj * const * 
    0x00fc5440) line 1080 + 19 bytes
    TclEvalObjvInternal(Tcl_Interp * 0x00a00fb0, int 
    0x00000003, Tcl_Obj * const * 0x00fc5440, const char 
    * 0x100dd11a, int 0x00000000, int 0x00040000) line 
    3104 + 25 bytes
    Tcl_EvalObjv(Tcl_Interp * 0x00a00fb0, int 0x00000003, 
    Tcl_Obj * const * 0x00fc5440, int 0x00040000) line 
    3218 + 32 bytes
    Tcl_EvalObjEx(Tcl_Interp * 0x00a00fb0, Tcl_Obj * 
    0x00fbdc30, int 0x00040000) line 3761 + 27 bytes
    Tcl_UplevelObjCmd(void * 0x00000000, Tcl_Interp * 
    0x00a00fb0, int 0x00000001, Tcl_Obj * const * 
    0x009f409c) line 674 + 20 bytes
    TclEvalObjvInternal(Tcl_Interp * 0x00a00fb0, int 
    0x00000003, Tcl_Obj * const * 0x009f4094, const char 
    * 0x00000000, int 0x00000000, int 0x00000000) line 
    3104 + 25 bytes
    TclExecuteByteCode(Tcl_Interp * 0x00a00fb0, ByteCode 
    * 0x00fd2098) line 1404 + 36 bytes
    TclCompEvalObj(Tcl_Interp * 0x00a00fb0, Tcl_Obj * 
    0x00ab1410) line 984 + 13 bytes
    TclObjInterpProc(void * 0x00ac4438, Tcl_Interp * 
    0x00a00fb0, int 0x00000003, Tcl_Obj * const * 
    0x00fdaea8) line 1080 + 19 bytes
    TclEvalObjvInternal(Tcl_Interp * 0x00a00fb0, int 
    0x00000003, Tcl_Obj * const * 0x00fdaea8, const char 
    * 0x100dd11a, int 0x00000000, int 0x00040000) line 
    3104 + 25 bytes
    Tcl_EvalObjv(Tcl_Interp * 0x00a00fb0, int 0x00000003, 
    Tcl_Obj * const * 0x00fdaea8, int 0x00040000) line 
    3218 + 32 bytes
    Tcl_EvalObjEx(Tcl_Interp * 0x00a00fb0, Tcl_Obj * 
    0x00aead08, int 0x00040000) line 3761 + 27 bytes
    Tcl_UplevelObjCmd(void * 0x00000000, Tcl_Interp * 
    0x00a00fb0, int 0x00000001, Tcl_Obj * const * 
    0x009f4090) line 674 + 20 bytes
    TclEvalObjvInternal(Tcl_Interp * 0x00a00fb0, int 
    0x00000003, Tcl_Obj * const * 0x009f4088, const char 
    * 0x00000000, int 0x00000000, int 0x00000000) line 
    3104 + 25 bytes
    TclExecuteByteCode(Tcl_Interp * 0x00a00fb0, ByteCode 
    * 0x00fc8d08) line 1404 + 36 bytes
    TclCompEvalObj(Tcl_Interp * 0x00a00fb0, Tcl_Obj * 
    0x00ac3738) line 984 + 13 bytes
    TclObjInterpProc(void * 0x00ac3138, Tcl_Interp * 
    0x00a00fb0, int 0x0000000b, Tcl_Obj * const * 
    0x009f405c) line 1080 + 19 bytes
    InvokeImportedCmd(void * 0x00f850b8, Tcl_Interp * 
    0x00a00fb0, int 0x0000000b, Tcl_Obj * const * 
    0x009f405c) line 1478 + 25 bytes
    TclEvalObjvInternal(Tcl_Interp * 0x00a00fb0, int 
    0x0000000b, Tcl_Obj * const * 0x009f405c, const char 
    * 0x00000000, int 0x00000000, int 0x00000000) line 
    3104 + 25 bytes
    TclExecuteByteCode(Tcl_Interp * 0x00a00fb0, ByteCode 
    * 0x00f83f78) line 1404 + 36 bytes
    TclCompEvalObj(Tcl_Interp * 0x00a00fb0, Tcl_Obj * 
    0x00a2e4f8) line 984 + 13 bytes
    Tcl_EvalObjEx(Tcl_Interp * 0x00a00fb0, Tcl_Obj * 
    0x00a2e4f8, int 0x00000000) line 3776 + 13 bytes
    NamespaceEvalCmd(void * 0x00000000, Tcl_Interp * 
    0x00a00fb0, int 0x00000004, Tcl_Obj * const * 
    0x0026fb6c) line 2978 + 18 bytes
    Tcl_NamespaceObjCmd(void * 0x00000000, Tcl_Interp * 
    0x00a00fb0, int 0x00000004, Tcl_Obj * const * 
    0x0026fb6c) line 2531 + 21 bytes
    TclEvalObjvInternal(Tcl_Interp * 0x00a00fb0, int 
    0x00000004, Tcl_Obj * const * 0x0026fb6c, const char 
    * 0x00a3dd22, int 0x000028ef, int 0x00000000) line 
    3104 + 25 bytes
    Tcl_EvalEx(Tcl_Interp * 0x00a00fb0, const char * 
    0x00a3da18, int 0x00002c24, int 0x00000000) line 
    3541 + 36 bytes
    Tcl_FSEvalFile(Tcl_Interp * 0x00a00fb0, Tcl_Obj * 
    0x00a084c0) line 1341 + 19 bytes
    Tcl_Main(int 0x00000023, char * * 0x008d6e24, int 
    (Tcl_Interp *)* 0x0040ddb5 Tcl_AppInit(Tcl_Interp *)) 
    line 292 + 18 bytes
    main() line 110 + 19 bytes
    mainCRTStartup() line 338 + 17 bytes
    
    
    
  2. login: "mistachkin"
  3. mimetype: "text/plain"
  4. username: "mistachkin"