|
2005-11-08
| ||
| 21:56 | • Ticket [1348775fff] varTraces leak when variable is unset status still Close... artifact: 5dba0fe7e0 user: dkf | |
| 21:56 | • Add attachment trace-8.5.diff to ticket [1348775fff] artifact: eed28afbab user: dkf | |
| 21:56 | • Ticket [1348775fff] varTraces leak when variable is unset status still Close... artifact: 27406c4e9e user: dkf | |
| 21:56 | • Ticket [1348775fff]: 4 changes artifact: a64bbbc603 user: dkf | |
| 21:56 | • Ticket [1348775fff]: 1 change artifact: c350aa5298 user: dkf | |
| 21:56 | • Closed ticket [1348775fff]. artifact: 8053acba11 user: dkf | |
| 17:44 | • Ticket [1348775fff]: 4 changes artifact: 503a566399 user: dkf | |
| 04:32 | • Add attachment trace-8.4.patch to ticket [1348775fff] artifact: f869efd702 user: msofer | |
| 04:32 | • Ticket [1348775fff] varTraces leak when variable is unset status still Open ... artifact: 12334e0559 user: msofer | |
| 04:29 | • Ticket [1348775fff]: 4 changes artifact: b974547187 user: msofer | |
| 03:25 | • Ticket [1348775fff]: 1 change artifact: ec1e5c9e84 user: msofer | |
| 03:24 | • Ticket [1348775fff]: 4 changes artifact: 0d5b6e5213 user: msofer | |
| 03:24 | • Ticket [1348775fff]: 4 changes artifact: b3bf8fc06d user: msofer | |
|
2005-11-07
| ||
| 19:34 | • Ticket [1348775fff]: 5 changes artifact: 772787e6fb user: msofer | |
| 17:46 | • Ticket [1348775fff]: 7 changes artifact: 4482a1962c user: msofer | |
|
2005-11-05
| ||
| 02:07 | • New ticket [1348775fff]. artifact: db60d47f08 user: msofer | |
varTraces leak when variable is unset
Closed / Fixed1348775fffffffffffffffffffffffffffffffffCreated 21 years agoUpdated 21 years ago
Descriptionplain2005-11-05 02:07:54
The new test trace-8.9 shows an 18-byte leak:
set end [getbytes]
for {set i 0} {$i < 5} {incr i} {
set apa {a 1 b 2}
set bepa [lrange $apa 0 end]
trace add variable bepa write {error hej}
catch {set bepa a}
unset bepa
set tmp $end
set end [getbytes]
}
expr {$end - $tmp}
This supercedes #1342858, which detected the same leak
but blamed it on [dict].
msoferplain2005-11-07 17:46:36
Logged In: YES user_id=148712 Test trace-8.9 deleted, trace-13.2-4 added to HEAD and 8-4-branch. When a traced variable is unset, the TraceVarInfo (clientData in the VarTrace struct) is leaked. This should be fixed directly in 8.4, and possibly together with #1056134 in HEAD.
msoferplain2005-11-07 19:34:21
Logged In: YES user_id=148712 Specifically: the code for [unset] does Tcl_EventuallyFree the VarTrace, but does not free the contents of its clientData field. Look for a q&d solution in 8-4, and a redesign for 8.5 (see also #1056134) maybe involving api changes: Tcl_TraceVar should take also a deletion callback as argument.
msoferplain2005-11-08 03:24:26
Logged In: YES user_id=148712 The attached patch solves the issue for 8.4, in an inelegant but effective and safe (?) way - assigning to dkf for a second opinion on this.
msoferplain2005-11-08 03:24:27
File Added - 155347: trace-8.4.patch
msofer Ticket [1348775fff]: 1 change
[History diff]2005-11-08 03:25:08
msoferplain2005-11-08 04:29:34
File Deleted - 155347: File Added - 155356: trace-8.4.patch Logged In: YES user_id=148712 Patch replaced with a slightly-less-icky one (thanks kevin and joe).
msoferplain2005-11-08 04:32:58
File Deleted - 155356: File Added - 155357: trace-8.4.patch
dkfplain2005-11-08 17:44:05
Logged In: YES user_id=79902 Might be cleaner to introduce a new private function (perhaps called TclTraceVarEx) that lets the caller supply the VarTrace with the traceProc, clientData and flags fields already filled in. That would, in turn, allow the lookup code to be handled far more neatly (i.e. by not inlining it all in the [trace * variable] subcommand implementation). The general strategy (using a single alloc instead of a pair) should work well though, given that we cannot change the API. Still thinking about this...
dkf Closed ticket [1348775fff].
[History diff]2005-11-08 21:56:18
dkf Ticket [1348775fff]: 1 change
[History diff]2005-11-08 21:56:19
dkfplain2005-11-08 21:56:20
Logged In: YES user_id=79902 fixed 8.4 branch with your patch and HEAD with attached patch.
dkf Ticket [1348775fff]: 2 changes
[History diff]2005-11-08 21:56:22
dkfplain2005-11-08 21:56:27
File Added - 155453: trace-8.5.diff
Log in (anonymous is fine) to add a comment.
Attachments:
- trace-8.5.diff [download] added by dkf on 2005-11-08 21:56:26. [details]
- trace-8.4.patch [download] added by msofer on 2005-11-08 04:32:58. [details]