Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 97aca1b73dc42a1076cc61d7675ffca1338455d7
Ticket: 1710825fffffffffffffffffffffffffffffffff
"Still reachable" memory leaks in Tcl I/O subsystem
User & Date: kennykb on 2007-05-01 21:18:02
Changes

  1. assignee changed to: "andreas_kupries"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    I'm tracking down places where Tcl leaves memory "still reachable" on exit.  For reference, I'm adding
    
    proc exit args {}
    
    at the end of tests/all.tcl, so that the main interp will be properly destroyed.
    
    I find two major sources of leakage:
    
    (1) In a non-threaded build, TSD blocks are never
        freed.  This problem happens simply because the
        #ifdef's in TclFinalizeSynchronization are
        misplaced.
    (2) TclFinalizeIOSubsystem never gets past closing the
        first still-open channel, because by the time
        control returns from Tcl_Close, the
        'nextCSPtr' field in the channel state has
        been cleared.
    
    The attach patch, for your review, appears to close
    both leaks and introduces no new failures in 'make test'.
    Sorry that it's so hard to read; the indentation changes
    get in the way a bit.
    
  4. foundin changed to: "obsolete: 8.5a6"
  5. is_private changed to: "0"
  6. priority changed to: "7 High"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "kennykb"
  10. subsystem changed to: "25. Channel System"
  11. title changed to:
    "Still reachable" memory leaks in Tcl I/O subsystem
    
  12. type changed to: "Bug"