Tcl Source Code

View Ticket
Login
Ticket UUID: 1710825
Title: "Still reachable" memory leaks in Tcl I/O subsystem
Type: Bug Version: obsolete: 8.5a6
Submitter: kennykb Created on: 2007-05-01 21:18:02
Subsystem: 25. Channel System Assigned To: andreas_kupries
Priority: 7 High Severity:
Status: Open Last Modified: 2011-09-24 05:19:18
Resolution: Fixed Closed By: kennykb
    Closed on: 2007-05-02 04:44:37
Description:
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.
User Comments: ferrieux added on 2011-09-24 05:19:18:
Is that still valid after recent leak hunts ?

dgp added on 2007-05-11 01:47:01:
Logged In: YES 
user_id=80530
Originator: NO


Re-open;  Request a review to
see if any part of this needs
backporting for 8.4.15.

kennykb added on 2007-05-02 04:18:02:

File Added - 227417: ioleak.patch

Attachments: