Skip to content
Tcl Source Code History Of Ticket 593baa032c
Login

History Of Ticket 593baa032c

Artifacts Associated With Ticket 593baa032c

  1. Ticket change [b7deee9f7b] (rid 144222) by dgp on 2015-12-18 14:41:30:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. 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
      
    5. foundin initialized to: "trunk"
    6. is_private initialized to: "0"
    7. login: "dgp"
    8. priority initialized to: "5 Medium"
    9. resolution initialized to: "None"
    10. severity initialized to: "Severe"
    11. status initialized to: "Open"
    12. submitter initialized to: "dgp"
    13. subsystem initialized to: "35. TclOO Package"
    14. title initialized to: "superclass refcount error?"
    15. type initialized to: "Bug"
  2. Ticket change [c5d9e7e210] (rid 144223) by dgp on 2015-12-18 14:41:49:

    1. assignee changed to: "dkf"
    2. login: "dgp"
    3. mimetype: "text/plain"
  3. Ticket change [3762b5bd85] (rid 144226) by dkf on 2015-12-18 15:50:03:

    1. 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.
      
    2. login: "dkf"
    3. mimetype: "text/html"
    4. username: "dkf"
  4. Ticket change [201f8eb328] (rid 144227) by dgp on 2015-12-18 19:25:09:

    1. 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
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  5. Ticket change [c1e51abd64] (rid 144228) by dgp on 2015-12-18 19:51:18:

    1. 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
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  6. Ticket change [2dd7e82f76] (rid 144317) by dgp on 2015-12-22 16:53:35:

    1. 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
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  7. Ticket change [8b643e18db] (rid 144322) by dgp on 2015-12-22 18:44:54:

    1. 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().
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  8. Ticket change [311dee15e3] (rid 144323) by dgp on 2015-12-22 19:04:04:

    1. 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
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  9. Ticket change [2e7b5ef6e7] (rid 144326) by dgp on 2015-12-22 20:36:08:

    1. icomment:
      
      fix for that included now on branch too
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  10. Ticket change [e29b34eea2] (rid 144386) by dgp on 2016-01-08 16:06:42:

    1. icomment:
      
      Any chance this might get a review soon?
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. priority changed to: "9 Immediate"
  11. Ticket change [7e383dca64] (rid 144567) by dgp on 2016-01-19 13:09:33:

    1. assignee changed to: "dgp"
    2. closedate changed to: "2457407.04830516"
    3. closer changed to: "dgp"
    4. icomment:
      
      Would rather have under-reviewed fix than no fix at all.
      
    5. login: "dgp"
    6. mimetype: "text/plain"
    7. resolution changed to: "Fixed"
    8. status changed to: "Closed"