Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 3d481a0942d095dc4037fdc9c627c70dda18ca65
Ticket: 3614226fffffffffffffffffffffffffffffffff
Memory leaks in compiled code
User & Date: dkf on 2013-06-01 21:03:55
Changes

  1. assignee changed to: "dkf"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    This procedure leaks memory when run (or would if it didn't crash):
    
        proc foo {} {while 1 {list a [list b [continue]]}}
    
    The problem? The INST_CONTINUE doesn't clear things down. (This is a general problem if we've got a [return -code continue]; this is all work-in-progress.) So we add tracking of stack depth (dkf-compile-improvements branch) so we can issue the right number of INST_POPs and it hangs without memory consumption, absolutely correctly. Yay!
    
    Let's try in our enhanced code with a new procedure:
    
        proc foo {} {while 1 {puts {*}[puts {*}[continue]]}}
    
    This is now worse; it leaks memory like it is going out of fashion! The problem is that we've got a build-up on the TD->auxObjList that can't be cleared.
    
    I've not analyzed what happens when there's a [catch] involved.
    
  4. foundin changed to: "current: 8.6.0"
  5. is_private changed to: "0"
  6. priority changed to: "8"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "dkf"
  10. subsystem changed to: "47. Bytecode Compiler"
  11. title changed to: "Memory leaks in compiled code"
  12. type changed to: "Bug"