Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


#5231 wish crash when modifying auto_load procedure

current: 8.6.0
69. Other (102)
Thomas Perschak

Win7, MinGW gcc 4.7.2

For debug I put a "puts" into the "auto_load" procedure like this:

proc auto_load {cmd {namespace {}}} {
## @tombert crash!
puts "hello"
global auto_index auto_path

When starting the "wish" it crashes immediately. The "tclsh" works fine.



  • Do you have a stack trace? Or at least *some* description of what the problem is in detail?

    I'm guessing that the problem is probably due to the incomplete setup of the special channels connecting the main interpreter to the fake console at the time when [auto_load] is first called. I don't have any evidence for this yet — it's just a hunch — but it is where I'd look initially. I am, however, on a very different platform so more debug info if you've got it would be super-useful!

    (Be aware that there may be some technical issues with bugs submitted here due to SF "upgrading the project".)

  • (gdb) run
    Starting program: E:\CM.git\tcltk86\debug\bin\wish.exe
    [New Thread 4924.0x508]
    warning: alloc: invalid block: 004F0998: b0 2

    Program received signal SIGILL, Illegal instruction.
    0x67547b2e in tclWinDebugPanic (format=0x6757325c "alloc: invalid block: %p: %x %x") at tclWinFile.c:819
    819 MessageBoxW(NULL, msgString, L"Fatal Error",
    (gdb) backtrace
    #0 0x67547b2e in tclWinDebugPanic (format=0x6757325c "alloc: invalid block: %p: %x %x") at tclWinFile.c:819
    #1 0x67501b23 in Tcl_PanicVA (format=0x6757325c "alloc: invalid block: %p: %x %x", argList=0x28ece4 "$%G")
    at e:/CM.git/tcltk86/dcompile/tcl/generic/tclPanic.c:95
    #2 0x67501c0f in Tcl_Panic (format=0x6757325c "alloc: invalid block: %p: %x %x")
    at e:/CM.git/tcltk86/dcompile/tcl/generic/tclPanic.c:149
    #3 0x675204ad in Ptr2Block (ptr=0x4f09a0 "\020") at e:/CM.git/tcltk86/dcompile/tcl/generic/tclThreadAlloc.c:780
    #4 0x6751fcc5 in TclpFree (ptr=0x4f09a0 "\020") at e:/CM.git/tcltk86/dcompile/tcl/generic/tclThreadAlloc.c:406
    #5 0x674c55c0 in RecycleBuffer (statePtr=0x472510, bufPtr=0x4f09a0, mustDiscard=0)
    at e:/CM.git/tcltk86/dcompile/tcl/generic/tclIO.c:2378
    #6 0x674c5a19 in FlushChannel (interp=0x0, chanPtr=0x471c90, calledFromAsyncFlush=0)
    at e:/CM.git/tcltk86/dcompile/tcl/generic/tclIO.c:2675
    #7 0x674c7819 in CheckFlush (chanPtr=0x471c90, bufPtr=0x4f09a0, newlineFlag=0)
    at e:/CM.git/tcltk86/dcompile/tcl/generic/tclIO.c:4529
    #8 0x674c755e in WriteChars (chanPtr=0x471c90, src=0x2694c65 "", srcLen=0)
    at e:/CM.git/tcltk86/dcompile/tcl/generic/tclIO.c:4324
    #9 0x674c6f9c in Tcl_WriteObj (chan=0x471c90, objPtr=0x2729a90)
    at e:/CM.git/tcltk86/dcompile/tcl/generic/tclIO.c:4000
    #10 0x674cf301 in Tcl_PutsObjCmd (dummy=0x0, interp=0x492bc8, objc=2, objv=0x2793efc)
    at e:/CM.git/tcltk86/dcompile/tcl/generic/tclIOCmd.c:184
    #11 0x67418866 in TclNREvalObjv (interp=0x492bc8, objc=2, objv=0x2793efc, flags=2097152, cmdPtr=0x26dfe98)
    at e:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:4305
    #12 0x674a405d in TEBCresume (data=0x284d714, interp=0x492bc8, result=0)
    at e:/CM.git/tcltk86/dcompile/tcl/generic/tclExecute.c:2853
    #13 0x674188d8 in TclNRRunCallbacks (interp=0x492bc8, result=0, rootPtr=0x2780d18)
    at e:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:4339
    #14 0x674184c7 in Tcl_EvalObjv (interp=0x492bc8, objc=4, objv=0x28f380, flags=0)
    at e:/CM.git/tcltk86/dcompile/tcl/generic/tclBasic.c:4139