Skip to content
Tcl Source Code View Ticket
Login

View Ticket

leak in linked variables

Closed / Fixed604239ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 24 years ago
Descriptionplain2002-09-03 23:04:41
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.
dgpplain2002-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
dgpplain2002-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.
dgpplain2002-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?
msoferplain2002-09-04 19:24:34
Logged In: YES 
user_id=148712

Nojoy, the leak is still there :(
msoferplain2002-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?
msoferplain2002-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 ...
Log in (anonymous is fine) to add a comment.

Attachments: