Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2007-11-29
02:23 • Closed ticket [983501ffff]: Resource leak in pkgconfig ? plus 8 other chan... artifact: 624c89e5b1 user: dgp
01:38 • Ticket [983501ffff]: 4 changes artifact: 2b39abccf0 user: andreas_kupries
01:24 • Ticket [983501ffff]: 5 changes artifact: 1096a358f7 user: dgp
01:24 • Add attachment 983501.patch to ticket [983501ffff] artifact: 37643ef613 user: dgp
2007-11-28
01:46 • Ticket [983501ffff] Resource leak in pkgconfig ? status still Open with 2 ... artifact: 9e10874d83 user: dgp
01:19 • Ticket [983501ffff]: 4 changes artifact: 7e61509dad user: andreas_kupries
00:53 • Ticket [983501ffff]: 4 changes artifact: fc6437b16b user: dgp
2006-03-28
01:11 • Ticket [983501ffff]: 5 changes artifact: 9c3b0630c5 user: andreas_kupries
2006-03-10
13:45 • Ticket [983501ffff]: 1 change artifact: bc55d125d8 user: dgp
2004-07-17
02:33 • Ticket [983501ffff]: 4 changes artifact: a68e7f133e user: andreas_kupries
2004-07-01
15:51 • New ticket [983501ffff]. artifact: ccc8b4121c user: dgp

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: