Overview
| Artifact ID: | f2c9debfc00919099f9749f01ce2d0fead08cc78 |
|---|---|
| Ticket: | 2939073fffffffffffffffffffffffffffffffff
Unset PATTERN unsafe with trace-originated secondary unsets |
| User & Date: | ferrieux on 2010-02-02 20:00:15 |
Changes
- icomment:
allow_comments - 0 Beware, there is a leak in the non-error case now. This is due to only decrementing refcounts without ever calling CleanupVar. Not sure why you removed this call from my initial patch. Proof of leak: array set x {e 1 i 1} trace add variable x unset rem proc rem args { puts REM:$args if {![info exists ::already]} { set ::already 1 unset ::x(e) } } array unset x i* array stat x => number of buckets with 0 entries: 3 number of buckets with 1 entries: 1 array size x => 0 What happens is that the secondary unset is delayed because "e" is in the protected state, but since the overall pattern "i*" doesn't include "e", it doesn't get directly deleted from the main iteration either. Having noticed that VarHashRefCount(x)-- doesn't take the actual final step, we must call CleanupVar independently from the match outcome; this is exactly what my patch was doing. - login: "ferrieux"
- mimetype: "text/plain"
- status changed to: "Open"
- username: "ferrieux"