Artifacts Associated With Ticket 593baa032c
Ticket change [b7deee9f7b] (rid 144222) by dgp on 2015-12-18 14:41:30:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Using the trunk of Tcl and the trunk of Itcl, this script segfaults: package require Itcl ::itcl::class C {method m {} {::oo::class destroy}} [C c] m This might be Itcl's fault, but the backtrace suggests TclOO is not getting its refcounting right in its superclass list: Program received signal SIGSEGV, Segmentation fault. 0x000000000059b0f9 in ObjectNamespaceDeleted (clientData=0x97f298) at /home/dgp/fossil/tcl/generic/tclOO.c:1228 1228 if (!Deleted(superPtr->thisPtr)) { Missing separate debuginfos, use: debuginfo-install glibc-2.17-106.el7_2.1.x86_64 zlib-1.2.7-15.el7.x86_64 (gdb) bt #0 0x000000000059b0f9 in ObjectNamespaceDeleted (clientData=0x97f298) at /home/dgp/fossil/tcl/generic/tclOO.c:1228 #1 0x0000000000542eba in TclTeardownNamespace (nsPtr=0x9282b8) at /home/dgp/fossil/tcl/generic/tclNamesp.c:1220 #2 0x0000000000542b90 in Tcl_DeleteNamespace (namespacePtr=0x9282b8) at /home/dgp/fossil/tcl/generic/tclNamesp.c:1028 #3 0x0000000000541f3e in Tcl_PopCallFrame (interp=0x822378) at /home/dgp/fossil/tcl/generic/tclNamesp.c:421 #4 0x000000000055e277 in InterpProcNR2 (data=0x9aed80, interp=0x822378, result=0) at /home/dgp/fossil/tcl/generic/tclProc.c:1869 #5 0x0000000000414cf8 in TclNRRunCallbacks (interp=0x822378, result=0, rootPtr=0x0) at /home/dgp/fossil/tcl/generic/tclBasic.c:4386 #6 0x000000000041454c in Tcl_EvalObjv (interp=0x822378, objc=2, objv=0x8259f0, flags=2097168) at /home/dgp/fossil/tcl/generic/tclBasic.c:4116 #7 0x00000000004169e6 in TclEvalEx (interp=0x822378, script=0x8ecba8 "load ./libitcl4.0.3.so\npackage require Itcl\n::itcl::class C {method m {} {::oo::class destroy}}\n[C c] m\n", numBytes=104, flags=0, line=4, clNextOuter=0x0, outerScript=0x8ecba8 "load ./libitcl4.0.3.so\npackage require Itcl\n::itcl::class C {method m {} {::oo::class destroy}}\n[C c] m\n") at /home/dgp/fossil/tcl/generic/tclBasic.c:5255 #8 0x000000000053687b in Tcl_FSEvalFileEx (interp=0x822378, pathPtr=0x8d9468, encodingName=0x0) at /home/dgp/fossil/tcl/generic/tclIOUtil.c:1827 #9 0x0000000000540f2a in Tcl_MainEx (argc=-1, argv=0x7fffffffd668, appInitProc=0x40f456 <Tcl_AppInit>, interp=0x822378) at /home/dgp/fossil/tcl/generic/tclMain.c:420 #10 0x000000000040f44f in main (argc=2, argv=0x7fffffffd658) at /home/dgp/fossil/tcl/unix/tclAppInit.c:84 - foundin initialized to: "trunk"
- is_private initialized to: "0"
- login: "dgp"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Severe"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "35. TclOO Package"
- title initialized to: "superclass refcount error?"
- type initialized to: "Bug"
Ticket change [c5d9e7e210] (rid 144223) by dgp on 2015-12-18 14:41:49:
- assignee changed to: "dkf"
- login: "dgp"
- mimetype: "text/plain"
Ticket change [3762b5bd85] (rid 144226) by dkf on 2015-12-18 15:50:03:
- icomment:
Yet this works fine (mem-debugging enabled build, commit c5394a312b): <pre> % oo::class create C {method m {} {::oo::class destroy}} ::C % [C create c] m % </pre> Whatever is going on is subtle. - login: "dkf"
- mimetype: "text/html"
- username: "dkf"
- icomment:
Ticket change [201f8eb328] (rid 144227) by dgp on 2015-12-18 19:25:09:
- icomment:
Here's a script with only Tcl causing the same segfault: oo::class create R {} oo::class create Z {superclass ::oo::class} oo::define ::oo::class export createWithNamespace Z createWithNamespace C C oo::define C superclass R oo::define C method m {} { namespace eval ::C { ::oo::class destroy } } C create c c m - login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [c1e51abd64] (rid 144228) by dgp on 2015-12-18 19:51:18:
- icomment:
Simpler demo that segfaults a memdebug enabled Tcl shell: % oo::class create R ::R % oo::class create C { superclass R method m ns {namespace eval $ns {::oo::class destroy}} } ::C % C create c ::c % c m [info object namespace C] make: *** [shell] Segmentation fault - login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [2dd7e82f76] (rid 144317) by dgp on 2015-12-22 16:53:35:
- icomment:
Another simplification round. Don't need to tear down the whole world. % oo::class create B {} ::B % oo::class create D {superclass B} ::D % namespace eval [info object namespace D] {::B destroy} make: *** [shell] Segmentation fault - login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [8b643e18db] (rid 144322) by dgp on 2015-12-22 18:44:54:
- icomment:
See branch bug-593baa032c for possible fix. Needs review. Also the buggy pattern seen here with the superclass list seems to also be present in the mixins list guiding calls to TclOORemoveFromMixinSubs().
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [311dee15e3] (rid 144323) by dgp on 2015-12-22 19:04:04:
- icomment:
Indeed: % oo::class create B {} ::B % oo::class create D {mixin B} ::D % namespace eval [info object namespace D] {::B destroy} make: *** [shell] Segmentation fault - login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [2e7b5ef6e7] (rid 144326) by dgp on 2015-12-22 20:36:08:
- icomment:
fix for that included now on branch too
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [e29b34eea2] (rid 144386) by dgp on 2016-01-08 16:06:42:
- icomment:
Any chance this might get a review soon?
- login: "dgp"
- mimetype: "text/plain"
- priority changed to: "9 Immediate"
- icomment:
Ticket change [7e383dca64] (rid 144567) by dgp on 2016-01-19 13:09:33:
- assignee changed to: "dgp"
- closedate changed to: "2457407.04830516"
- closer changed to: "dgp"
- icomment:
Would rather have under-reviewed fix than no fix at all.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"