Artifacts Associated With Ticket 2820349fffffffffffffffffffffffffffffffff
Ticket change [57ddd2c8ad] (rid 117705) by flatworm on 2009-07-12 12:15:44:
- assignee initialized to: "kennykb"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Tcl_ThreadQueueEvent() only calls QueueEvent() which actually adds the event to the specified notifier's queue if such notifier was found, that is, if there is a notifier bound to the thread specified in the call. As the specification states that after a call to Tcl_ThreadQueueEvent() the event's memory will be owned by the approptiate notifier, and the function does not return any information to the caller about whether the event was delivered or not, then if the target thread does not exist, the event memory will be lost. Since this function is a part of the public API (and therefore can be called with arbitrary arguments) the possibility of the non-existing target thread is possible. I think that turning if (tsdPtr) { QueueEvent(tsdPtr, evPtr, position); } into if (tsdPtr) { QueueEvent(tsdPtr, evPtr, position); } else { ckfree((char*) evPtr); } would fulfill the contract about the event's memory handling. - foundin initialized to: "obsolete: 8.6b1.1"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "flatworm"
- subsystem initialized to: "01. Notifier"
- title initialized to: "Tcl_ThreadQueueEvent can lead to memory leaks"
- type initialized to: "Bug"
Ticket change [af90303fd0] (rid 97834) by mistachkin on 2009-07-23 15:15:43:
- icomment:
Nice catch. The comments clearly state that the memory pointed to by evPtr "becomes the property of the event queue. It will be freed after the event has been handled" (i.e. currently, if the event is never handled then the memory is never freed). Upping priority.
- login: "mistachkin"
- mimetype: "text/plain"
- username: "mistachkin"
- icomment:
Ticket change [6216cbe21c] (rid 92358) by mistachkin on 2009-07-23 15:15:44:
- assignee changed to: "mistachkin"
- priority changed to: "9 Immediate"
Ticket change [043e2fd1b5] (rid 119962) by mistachkin on 2009-07-23 16:59:56:
- icomment:
This bug appears to exist as far back as 8.1. I plan to backport the fix to 8.4 and 8.5.
- login: "mistachkin"
- mimetype: "text/plain"
- username: "mistachkin"
- icomment:
Ticket change [f6d05905c0] (rid 130369) by mistachkin on 2009-07-23 17:23:20:
- closedate changed to: "2009-07-23T10:23:20"
- closer changed to: "mistachkin"
- icomment:
allow_comments - 1 Fix committed to HEAD and backported to the 8.4 and 8.5 branches.
- login: "mistachkin"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "mistachkin"