Tcl Source Code

View Ticket
Login
Ticket UUID: a84a72096602821953f6d1d9f623d67e4a69e2d0
Title: Crash when deleting interpreter in combination with oo deletemethod
Type: Bug Version: 8.6.1
Submitter: apnadkarni Created on: 2014-07-31 04:00:32
Subsystem: 35. TclOO Package Assigned To: dgp
Priority: 8 Severity: Critical
Status: Closed Last Modified: 2014-07-31 19:59:38
Resolution: Fixed Closed By: dgp
    Closed on: 2014-07-31 19:59:38
Description:
The following code causes the tclsh to crash (8.6.0 and 8.6.1)

interp create ip; # Need slave because crash only occurs when interp is deleted
set script {
    oo::class create C {method m {} {}}
    C create c
    c m
    oo::define C {deletemethod m}
    c m
}

catch { interp eval ip $script }
interp delete ip

If method m is not deleted or not called after deletion,or interp is not deleted, crash does not occur.

/Ashok
User Comments: dgp added on 2014-07-31 19:59:38:
fixed on trunk.

dgp added on 2014-07-31 19:38:13:
What's that I was saying?

http://core.tcl.tk/tcl/tktview?name=75b8433707

dgp added on 2014-07-31 19:29:42:
Program received signal SIGSEGV, Segmentation fault.
0x00000000005a57e8 in TclOODeleteChain (callPtr=0x0)
    at /home/dgp/fossil/tcl/generic/tclOOCall.c:153
153	    if (--callPtr->refCount >= 1) {
(gdb) bt
#0  0x00000000005a57e8 in TclOODeleteChain (callPtr=0x0)
    at /home/dgp/fossil/tcl/generic/tclOOCall.c:153
#1  0x000000000059edc4 in ReleaseClassContents (interp=0x8daef8, oPtr=0x9bdce8)
    at /home/dgp/fossil/tcl/generic/tclOO.c:1051
#2  0x000000000059e5a9 in ObjectRenamedTrace (clientData=0x9bdce8, 
    interp=0x8daef8, oldName=0x9b6108 "::C", newName=0x0, flags=16512)
    at /home/dgp/fossil/tcl/generic/tclOO.c:874
#3  0x00000000004131f7 in CallCommandTraces (iPtr=0x8daef8, cmdPtr=0x9c32b8, 
    oldName=0x9b6108 "::C", newName=0x0, flags=16512)
    at /home/dgp/fossil/tcl/generic/tclBasic.c:3268
#4  0x0000000000412e32 in Tcl_DeleteCommandFromToken (interp=0x8daef8, 
    cmd=0x9c32b8) at /home/dgp/fossil/tcl/generic/tclBasic.c:3075
#5  0x0000000000545426 in TclTeardownNamespace (nsPtr=0x904838)
    at /home/dgp/fossil/tcl/generic/tclNamesp.c:1133
#6  0x0000000000410c47 in DeleteInterpProc (interp=0x8daef8)
    at /home/dgp/fossil/tcl/generic/tclBasic.c:1449
#7  0x000000000055ebe8 in Tcl_EventuallyFree (clientData=0x8daef8, 
    freeProc=0x410a8a <DeleteInterpProc>)
    at /home/dgp/fossil/tcl/generic/tclPreserve.c:296
#8  0x0000000000410a88 in Tcl_DeleteInterp (interp=0x8daef8)
    at /home/dgp/fossil/tcl/generic/tclBasic.c:1338
#9  0x000000000051ca34 in SlaveObjCmdDeleteProc (clientData=0x8daef8)
    at /home/dgp/fossil/tcl/generic/tclInterp.c:2715
#10 0x0000000000412f2d in Tcl_DeleteCommandFromToken (interp=0x822648, 
    cmd=0x996d08) at /home/dgp/fossil/tcl/generic/tclBasic.c:3130

dgp added on 2014-07-31 11:34:26:
Crash is present since the very first checkin of TclOO to Tcl:

checkout:     e46e1575d392981d674e659a6c6649dc51ecf5dc 2008-05-31 11:41:59 UTC