Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2014-07-31
19:59 • Closed ticket [a84a720966]: Crash when deleting interpreter in combination with ... artifact: 0c295313fb user: dgp
19:58
[a84a720966] Protect against double free in TclOO classChainCache teardown. check-in: 61e0390b0a user: dgp tags: trunk
19:38 • Ticket [a84a720966] Crash when deleting interpreter in combination with oo delet... artifact: 56a38ec869 user: dgp
19:29 • Ticket [a84a720966]: 3 changes artifact: 0b1404fd65 user: dgp
11:34 • Ticket [a84a720966]: 3 changes artifact: a15cc1bf7f user: dgp
11:29 • Ticket [a84a720966]: 5 changes artifact: 8a74599dbe user: dgp
04:01 • Ticket [a84a720966]: 3 changes artifact: c7a11cc3ff user: apnadkarni
04:00 • New ticket [a84a720966]. artifact: 868fe027f4 user: apnadkarni

Crash when deleting interpreter in combination with oo deletemethod

Closed / Fixeda84a72096602821953f6d1d9f623d67e4a69e2d0Created 12 years agoUpdated 12 years ago
Descriptionplain2014-07-31 04:00:32
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
Referenced by1
  • 61e0390b0a[a84a720966] Protect against double free in TclOO classChainCache teardown. check-in2014-07-31 19:58:53
apnadkarni Ticket [a84a720966]: 3 changes [History diff]2014-07-31 04:01:44
dgp Ticket [a84a720966]: 5 changes [History diff]2014-07-31 11:29:36
dgpplain2014-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
dgpplain2014-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
dgpplain2014-07-31 19:38:13
What's that I was saying?

http://core.tcl.tk/tcl/tktview?name=75b8433707
dgpplain2014-07-31 19:59:38
fixed on trunk.
Log in (anonymous is fine) to add a comment.