Tcl Source Code

View Ticket
Login
Ticket UUID: 604239
Title: leak in linked variables
Type: Bug Version: None
Submitter: msofer Created on: 2002-09-03 23:04:41
Subsystem: 07. Variables Assigned To: msofer
Priority: 8 Severity:
Status: Closed Last Modified: 2002-09-04 22:20:06
Resolution: Fixed Closed By: msofer
    Closed on: 2002-09-04 15:20:06
Description:
The script

    namespace eval tst {
        upvar 0 a(x) b
        variable b
     }
     namespace delete tst

leaks the Var struct corresponding to the array element
a(x). The leak depends on the upvar being to an array
element, it will not happen for scalars.
User Comments: msofer added on 2002-09-04 22:20:06:
Logged In: YES 
user_id=148712

Fixing the leak in HEAD. 

A deeper and subtler issue concerns the intended meaning of
such commmand sequences, and touches on Tcl's variable name
resolution rules and the namespace  infrastructure in
general. Postponed ...

msofer added on 2002-09-04 20:29:18:

File Added - 30409: varleak2.patch

Logged In: YES 
user_id=148712

varleak2.patch removes the leak and passes the testsuite.
But the real question remains: is it really a(x) that should
get the VAR_NAMESPACE_VAR flag, or should it rather be b?

msofer added on 2002-09-04 19:24:34:
Logged In: YES 
user_id=148712

Nojoy, the leak is still there :(

dgp added on 2002-09-04 10:04:15:

File Deleted - 30386: 



File Added - 30387: varleak.patch

Logged In: YES 
user_id=80530

updated patch passes test suite; no segfaults.

Does it patch the leak?

dgp added on 2002-09-04 09:01:19:
Logged In: YES 
user_id=80530

the patch may be a starting point, but it causes segfaults
in the test suite, so more work is needed.

dgp added on 2002-09-04 06:53:54:

File Added - 30386: varleak.patch

Logged In: YES 
user_id=80530

check if this is a fix for the problem

Attachments: