Artifacts Associated With Ticket 48150cdad2
Ticket change [289c40752f] (rid 238726) by sebres on 2025-03-27 13:04:53:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
The way how command gets (re)created is affected by drastic mem-leak, due to prevention against endless loop by its recreation via trace. The responsible place of code in [./info?udc=1&ln=on&name=4cbbfb800129c37a075b6165c9cfa6bb9d9c005f2a9583c9008c0869e0ed7d62&ln=2426-2434|TclCreateObjCommandInNs], the same is valid for other functions like Tcl_CreateCommand etc. PoC: <code><pre> namespace eval A { proc test {} {puts test}; namespace export test } proc recreate {args} { namespace eval ::B { namespace import ::A::test }; trace add command ::B::test delete recreate } timerate { recreate; proc ::B::test {} {}; rename ::B::test {} } 10000 </pre></code> (and lets grow the mem-usage) By regular deletion it'd restore everything back, but not by overwrite, that wins and this prevention causes that the new command overwrites the old at any cost without proper clean-up, no traces but also no deletion callback, no release for internal members, nothing excepting ckfree for cmdPtr. I'd rather expects that 2nd run of trace is avoided and the command gets deleted and overwritten properly (and surely without the leak). Also if command gets restored again now via deletion callback, it shall win and attempt overwrite must cause something like "cannot create - existing command restored after deletion, avoid endless loop". - foundin initialized to: "any"
- is_private initialized to: "0"
- login: "sebres"
- priority initialized to: "5 Medium"
- private_contact initialized to: "50e9528765c18296566374b3fde2df942c394efd"
- resolution initialized to: "None"
- severity initialized to: "Important"
- status initialized to: "Open"
- submitter initialized to: "sebres"
- subsystem initialized to: "46. Traces"
- title initialized to:
Command creation with overwrite (prevention against endless loop by its recreation via trace) is affected by drastic mem-leak
- type initialized to: "Bug"
Ticket change [85f1232fbf] (rid 238727) by sebres on 2025-03-27 13:06:25:
- assignee changed to: "sebres"
- login: "sebres"
- mimetype: "text/plain"