Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Resource leak in [pkgconfig] ?

Closed / Fixed983501ffffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 19 years ago
Descriptionplain2004-07-01 15:51:45
Tcl_RegisterConfig() creates a [pkgconfig]
command.  Configuration values are stored
in a dictionary, and the [pkgconfig] command
provides read access to the dictionary.

When the [pkgconfig] command is
deleted from the interp, the dictionary
of data remains, it is not freed until
the interp is deleted.  The elements
of the dictionary may be freed as they
are overwritten by a later call to 
Tcl_RegisterConfig() on the same interp.

Besides an unbalanced cleanup, this
also opens the possibility of having
[pkgconfig] return data values that
are a mixture of different Tcl_RegisterConfig()
calls (possibly from multiple versions of
the same package?).

I think we want QueryConfigDelete() to
clear the dictionary of data.
andreas_kupriesplain2004-07-17 02:33:49
Logged In: YES 
user_id=75003

Agree. But we have a problem here. QueryConfigDelete does
not get the interp, but the dictionary you ask it to delete
is found only through the assoc data of an interp. So we
can't find the dict right now.

This requires a change to the client data of the command.
Instead of the package name, as done right now we have to
use a struct which contains the package name, and a
reference to the relevant interp. the name is required
everywhere, the interp is relevant only for the cleanup.
dgp Ticket [983501ffff]: 1 change [History diff]2006-03-10 13:45:03
andreas_kupriesplain2006-03-28 01:11:57
Logged In: YES 
user_id=75003

This is not blocker for the a4 release IMHO.
dgpplain2007-11-28 00:53:47
Logged In: YES 
user_id=80530
Originator: YES


status?
andreas_kupriesplain2007-11-28 01:19:53
Logged In: YES 
user_id=75003
Originator: NO

Nothing was done :(

I have no objections to deletion via QueryConfigDelete() when the command goes away.
dgp Ticket [983501ffff]: 2 changes [History diff]2007-11-28 01:46:37
dgpplain2007-11-29 01:24:38
File Added - 256479: 983501.patch

Logged In: YES 
user_id=80530
Originator: YES


Here's a patch for review.
File Added: 983501.patch
andreas_kupriesplain2007-11-29 01:38:24
Logged In: YES 
user_id=75003
Originator: NO

Patch looks good.
dgpplain2007-11-29 02:23:11
Logged In: YES 
user_id=80530
Originator: YES

committed for 8.5.0
Log in (anonymous is fine) to add a comment.

Attachments: