Skip to content
Tcl Source Code History Of Ticket 3422267ed6
Login

History Of Ticket 3422267ed6

Artifacts Associated With Ticket 3422267ed6

  1. Ticket change [c887514b1a] (rid 185528) by pooryorick on 2020-08-12 12:54:58:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized to:
      The following script produces a segmentation fault in an interprter built with
      -DPURIFY and --enable-symobls-debug:
      
      <code><verbatim>
      variable res {}
      
      proc p1 args {
          return success
      }
      namespace eval ns1 {
          namespace export *
      }
      interp alias {} [namespace current]::ns1::p2 {} [namespace current]::p1
      namespace eval ns2 {
          namespace import [namespace parent]::ns1::p2
      }
      proc ondelete {oldname newname op} {
          variable res
          namespace delete ns1
          catch {
              ns1::p2
          }  res
      }
      
      trace add command ns2::p2 delete [namespace which ondelete]
      rename ns2::p2 {}
      rename p1 {}
      </verbatim></code>
      
      The expected result is an error message about <code>ns1::p2</code>
      
      <code><verbatim>
      invalid command name "ns1::p2"
      </verbatim></code>
      
      
      The issue is that in <code>tclNamesp.c:DeleteImportedCmd</code>,
      <code>realCmdPtr</code> points to memory that has already been deallocated.
      For imported commands reference counting and cleanup is currently incomplete.
      
    5. is_private initialized to: "0"
    6. login: "pooryorick"
    7. priority initialized to: "5 Medium"
    8. resolution initialized to: "None"
    9. severity initialized to: "Minor"
    10. status initialized to: "Open"
    11. submitter initialized to: "pooryorick"
    12. subsystem initialized to: "21. [namespace]"
    13. title initialized to:
      segmentation fault from deleting the the target of an imported alias during a trace on the target of the alias
      
    14. type initialized to: "Bug"
  2. Ticket change [31551b410a] (rid 185536) by pooryorick on 2020-08-12 13:29:21:

    1. icomment: "Fixed in [37243ff47659d65c]."
    2. login: "pooryorick"
    3. mimetype: "text/x-fossil-wiki"
  3. Ticket change [b07751bb73] (rid 185537) by pooryorick on 2020-08-12 13:32:25:

    1. icomment: "Body of test case in [2da1596304896026]"
    2. login: "pooryorick"
    3. mimetype: "text/x-fossil-wiki"
  4. Ticket change [5726b0cac3] (rid 185544) by pooryorick on 2020-08-12 18:15:32:

    1. icomment:
      Further fixes in [de751a349009f88a] and [b9d1a1ce1aef55c3].
      
    2. login: "pooryorick"
    3. mimetype: "text/x-fossil-wiki"
  5. Ticket change [366d2ff816] (rid 185547) by jan.nijtmans on 2020-08-13 10:36:47:

    1. assignee changed to: "pooryorick"
    2. icomment:
      When running the testsuite on MacOS (most likely on other platforms too):
      <pre>
      aaa_exit.test
      append.test
      appendComp.test
      Test file error: alloc: invalid block: 0x7fc0eb01f9d0: a0 ea
      apply.test
      Test file error: alloc: invalid block: 0x7ffdc801f9d0: d0 c7
      assemble.test
      assocd.test
      async.test
      Test file error: alloc: invalid block: 0x7f81e801f9d0: 60 e7
      autoMkindex.test
      ....
      </pre>
      
      Bisecting gives:
      <pre>
      2020-08-12 13:35:00 9d087059ef BAD
      2020-08-12 10:30:14 eab09ae8ff GOOD
      </pre>
      
      Suggestion: If you are able to fix this soon, please do so. Otherwise, please revert this change from core-8-branch and continue on your branch until this is fixed.
      
    3. login: "jan.nijtmans"
    4. mimetype: "text/x-fossil-wiki"
  6. Ticket change [c6b14f2161] (rid 185549) by jan.nijtmans on 2020-08-13 10:42:43:

    1. icomment:
       Travis shows failing build on UNIX: [https://travis-ci.org/github/tcltk/tcl/jobs/717502919]
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  7. Ticket change [217a9e88d5] (rid 185551) by jan.nijtmans on 2020-08-13 12:46:42:

    1. icomment:
      Uncomplete fix now reverted from core-8-branch, but bugfix branch left as-is
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  8. Ticket change [db5108fc04] (rid 185611) by pooryorick on 2020-08-16 17:43:20:

    1. icomment:
      A missing reference count adjustment was added in [08e3b17c955f062d].
      
    2. login: "pooryorick"
    3. mimetype: "text/x-fossil-wiki"
  9. Ticket change [9295cd6f31] (rid 185612) by pooryorick on 2020-08-16 17:44:15:

    1. login: "pooryorick"
    2. mimetype: "text/plain"
    3. resolution changed to: "Fixed"
  10. Ticket change [06cf98c4fc] (rid 185624) by jan.nijtmans on 2020-08-18 13:26:27:

    1. icomment:
      Please look at the Travis build of this 'fix': [https://travis-ci.org/github/tcltk/tcl/builds/718869670].
      
      I'm sorry, but this shows that the solution is still not OK.
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/plain"
    4. resolution changed to: "None"
  11. Ticket change [96e208a519] (rid 185730) by pooryorick on 2020-08-28 09:38:12:

    1. icomment:
      Fixed in commit [0af4ad496cd234d3].  The problem was that the
      <code>Command</code> structure for a lambda application is not allocated, but
      instead synthesized by <code>TclNRApplyObjCmd</code>.
      <code>tclProc.c/FreeLambdaInternalRep</code> calls
      <code>TclProcCleanupProc(procPtr)</code>, which tries to do cleanup on
      <code>procPtr->cmdPtr</code>.  The solution is to set
      <code>procPtr->cmdPtr</code> to <code>NULL</code> before calling
      <code>TclProcCleanupProc</code>.
      
    2. login: "pooryorick"
    3. mimetype: "text/x-fossil-wiki"
    4. resolution changed to: "Fixed"
  12. Ticket change [06cb7ea3c3] (rid 185745) by jan.nijtmans on 2020-08-28 15:20:27:

    1. foundin changed to: "8.7"
    2. icomment:
      Apparently, this report is for Tcl 8.7, so added that.
      
      This time all tests seem to pass. Congratulations! If Travis is content too, it can be merged to other branches.
      
    3. login: "jan.nijtmans"
    4. mimetype: "text/x-fossil-wiki"
    5. status changed to: "Pending"
  13. Ticket change [0fbe8390bc] (rid 185752) by pooryorick on 2020-08-29 09:01:15:

    1. closedate changed to: "2459090.87587203"
    2. closer changed to: "pooryorick"
    3. login: "pooryorick"
    4. mimetype: "text/plain"
    5. status changed to: "Closed"
  14. Ticket change [3a16708111] (rid 185767) by jan.nijtmans on 2020-08-29 21:50:41:

    1. closedate changed to: "2459091.41019976"
    2. closer changed to: "jan.nijtmans"
    3. icomment:
      Sorry, Travis fails for all "MemDebug" builds!
      
      See: [https://travis-ci.org/github/tcltk/tcl/jobs/722235077]:
      
      <pre>
      ==== proc-4.8 TclCreateProc, procbody obj, no leak on multiple iterations FAILED
      ==== Contents of test case:
          set end [getbytes]
          for {set i 0} {$i < 5} {incr i} {
      	procbodytest::proc tx x px
      	set tmp $end
      	set end [getbytes]
          }
          set leakedBytes [expr {$end - $tmp}]
      ---- Result was:
      112
      ---- Result should have been (exact matching):
      0
      ==== proc-4.8 FAILED
      </pre>
      
      This indicates there's still a memory leak. Sorry, again.
      
    4. login: "jan.nijtmans"
    5. mimetype: "text/x-fossil-wiki"
  15. Ticket change [deffeb522d] (rid 185775) by jan.nijtmans on 2020-08-29 22:06:04:

    1. closer changed to: "nobody"
    2. login: "jan.nijtmans"
    3. mimetype: "text/plain"
    4. resolution changed to: "None"
    5. status changed to: "Open"
  16. Ticket change [e8a2b02b14] (rid 185844) by pooryorick on 2020-08-31 17:24:06:

    1. icomment:
      The issue this time is that <code>ProcBodyTestProcObjCmd()</code> synthesizes a
      proc body that imitates a Tcl Pro proc body and then passes it to
      <code>Tcl_ProcObjCmd()</code>, which recognizes it as a Tcl Pro compiled proc
      body and reuses the existing proc rather than creating a new proc.  This means
      that two different commands now share the same Proc structure, which is odd
      because the <code>Proc</code> structure itself keeps a pointer to the
      <code>Command</code> structure it is associated with.  Which command is it
      supposed to point to?  It seems that in the case of a Tcl Pro compiled
      procedure, a pointer to the most recent created command is stored, and previous
      information discarded. 
      
      In this unusual case, the <code>Proc</code> structure is shared between
      multiple commands, but that means that <code>Tcl_ProcObjCommand</code>  might
      replace the exising <code>procPtr->cmdPtr</code> with a new one.  When it does
      this it should decrement the reference count of the existing
      <code>cmdPtr</code>.
      
      Previously this wasn't an issue because reference counting of Command
      structures was limited to its occurrences in ByteCode instruction sequences.
      
      Fixed in [c045363cb0b77bf7].
      
    2. login: "pooryorick"
    3. mimetype: "text/x-fossil-wiki"
  17. Ticket change [275c68d7c2] (rid 185845) by aku on 2020-08-31 17:44:58:

    1. comment changed to:
      The following script produces a segmentation fault in an interpreter built with
      -DPURIFY and --enable-symbols-debug:
      
      <code><verbatim>
      variable res {}
      
      proc p1 args {
          return success
      }
      namespace eval ns1 {
          namespace export *
      }
      interp alias {} [namespace current]::ns1::p2 {} [namespace current]::p1
      namespace eval ns2 {
          namespace import [namespace parent]::ns1::p2
      }
      proc ondelete {oldname newname op} {
          variable res
          namespace delete ns1
          catch {
              ns1::p2
          }  res
      }
      
      trace add command ns2::p2 delete [namespace which ondelete]
      rename ns2::p2 {}
      rename p1 {}
      </verbatim></code>
      
      The expected result is an error message about <code>ns1::p2</code>
      
      <code><verbatim>
      invalid command name "ns1::p2"
      </verbatim></code>
      
      
      The issue is that in <code>tclNamesp.c:DeleteImportedCmd</code>,
      <code>realCmdPtr</code> points to memory that has already been deallocated.
      For imported commands reference counting and cleanup is currently incomplete.
      
    2. login: "aku"
    3. mimetype: "text/plain"
  18. Ticket change [d650b2e6f1] (rid 186333) by jan.nijtmans on 2020-09-05 20:56:30:

    1. icomment:
      > Fixed in [c045363cb0b77bf7].
      
      Sorry, still a memory leak!   Therefore I put it back in the original branch.
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  19. Ticket change [b9451e1446] (rid 186340) by jan.nijtmans on 2020-09-05 21:41:03:

    1. icomment:
      Sorry, I was a little to quick reverthing this fix. Looks OK!
      
      The actual cause of the memory leak was [c1a376375e], an earlier merge to core-8-branch which was too early.
      
      Please, wait until core-8-branch is stable on Travis again, and the travis build for this branch is OK. Then it can be merged again.
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  20. Ticket change [884168443c] (rid 186351) by jan.nijtmans on 2020-09-06 14:50:07:

    1. icomment:
      Well, the Travis build of this branch failed again, turns out it's still not correct. So, I merged in the latest 8.7, so you can try again.
      
      Current symptom:
      <pre>
      interp.test
      Test file error: child killed: segmentation violation
      </pre>
      
      See: [https://travis-ci.org/github/tcltk/tcl/builds/724602003]
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  21. Ticket change [f017e40e3d] (rid 235286) by jan.nijtmans on 2024-11-21 13:39:28:

    1. closedate changed to: "2460636.06908171"
    2. closer changed to: "jan.nijtmans"
    3. icomment:
      It looks like the branch "bug-3422267ed6b7992" was abandoned. All of the bug-fix attempts introduced more problems than they solved.
      
      Nathan, if you are not working on this any more, better close the ticket.
      
      My guess is, that this is duplicate of [02977e0004]. If not, feel free to re-open and start working on it again. But - please - not directly on trunk, breaking all the CI builds.
      
    4. login: "jan.nijtmans"
    5. mimetype: "text/x-fossil-wiki"
    6. resolution changed to: "Duplicate"
    7. status changed to: "Closed"