Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2014-11-06
17:03 • Closed ticket [3611474fff]: wish crash when modifying auto_load procedure pl... artifact: 83cf9d44e3 user: dgp
2014-10-23
13:22 • Pending ticket [3611474fff]. artifact: d0333e0d8a user: dgp
2013-04-22
20:56 • Ticket [3611474fff]: 4 changes artifact: 212ceb5b37 user: tombert
15:23 • Ticket [3611474fff]: 4 changes artifact: ec4aafa1b6 user: dkf
2013-04-20
20:07 • New ticket [3611474fff]. artifact: f37702a299 user: tombert

wish crash when modifying auto_load procedure

Closed / Fixed3611474fffffffffffffffffffffffffffffffffCreated 14 years agoUpdated 12 years ago
Descriptionplain2013-04-20 20:07:31
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.

thx!
dkfplain2013-04-22 15:23:40
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".)
tombertplain2013-04-22 20:56:57
(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
dgpplain2014-10-23 13:22:06
The stack trace indicates a failure in
buffer recycling.

In a refactoring of the I/O code since this
ticket was opened, corrections were made to
I/O buffer lifetime management.  They may
have fixed this problem.  A retest would be
worth doing on the 8.6.3 RCs.
dgpplain2014-11-06 17:03:29
Looks ok now.
Log in (anonymous is fine) to add a comment.