Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2004-01-14
16:38 • Add attachment dict.patch to ticket [876170ffff] artifact: 3aef9d91e3 user: dkf
16:38 • Closed ticket [876170ffff]: ref count mismanagement in dict plus 8 other cha... artifact: b4045c86bc user: dkf
04:19 • Ticket [876170ffff]: 4 changes artifact: bc64775065 user: pspjuth
03:34 • Ticket [876170ffff]: 4 changes artifact: 30156444ca user: pspjuth
2004-01-13
23:45 • Ticket [876170ffff]: 4 changes artifact: cb365f1cfd user: kennykb
23:45 • Add attachment trace to ticket [876170ffff] artifact: 8202361e29 user: kennykb
23:12 • Ticket [876170ffff] ref count mismanagement in dict status still Open with 1... artifact: 62b9fbfcc3 user: kennykb
23:11 • Add attachment uniqpfx.tcl to ticket [876170ffff] artifact: 93613c6cee user: kennykb
23:11 • Ticket [876170ffff] ref count mismnagement in dict status still Open with 4 ... artifact: 350f41416d user: kennykb
16:11 • New ticket [876170ffff]. artifact: f6e20843a9 user: kennykb

ref count mismanagement in dict

Closed / Fixed876170ffffffffffffffffffffffffffffffffffCreated 23 years agoUpdated 23 years ago
Descriptionplain2004-01-13 16:11:42
The attached file causes Tcl to crash with a
corrupted free object list.  I haven't had time
yet to try to distill it to an irreducible minimum,
but I observe that the program doesn't fail if
the empty dictionaries are created with
[dict create] instead of using the canonical
null object.
kennykbplain2004-01-13 23:11:42
File Added - 73274: uniqpfx.tcl
kennykb Ticket [876170ffff]: 1 change [History diff]2004-01-13 23:12:02
kennykbplain2004-01-13 23:45:06
File Added - 73286: trace
pspjuthplain2004-01-14 03:34:29
Logged In: YES 
user_id=98900

The bug is in tclDictObj.c line 596.
There is a Tcl_DuplicateObj that should
be followed by a Tcl_IncrRefCount.
pspjuthplain2004-01-14 04:19:31
Logged In: YES 
user_id=98900

Test case that triggers the bug if memdebug is on:

proc test {} {
    set successors [dict create x {c d}]
    dict set successors x a b
    dict get $successors x
}
test
dkfplain2004-01-14 16:38:33
File Added - 73390: dict.patch

Logged In: YES 
user_id=79902

I attach the patch Peter sent to me by email which fixes
this and which I applied to the core with a few minor mods.
 Thanks very much, Peter!
Log in (anonymous is fine) to add a comment.

Attachments: