Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2002-09-04
22:20 • Closed ticket [604239ffff]: leak in linked variables plus 7 other changes artifact: 1009342bca user: msofer
20:29 • Add attachment varleak2.patch to ticket [604239ffff] artifact: 2686d6d334 user: msofer
20:29 • Ticket [604239ffff] leak in linked variables status still Open with 4 other ... artifact: d6167fb44c user: msofer
19:24 • Ticket [604239ffff]: 4 changes artifact: 2cf2153a3b user: msofer
10:04 • Add attachment varleak.patch to ticket [604239ffff] artifact: eec7542876 user: dgp
10:04 • Ticket [604239ffff] leak in linked variables status still Open with 4 other ... artifact: a266a44683 user: dgp
09:01 • Ticket [604239ffff]: 4 changes artifact: 659898b6d6 user: dgp
06:53 • Ticket [604239ffff]: 4 changes artifact: 7ef436726c user: dgp
2002-09-03
23:04 • New ticket [604239ffff]. artifact: 6f8ab6caa1 user: msofer

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: