Artifacts Associated With Ticket 055240025ab8553b
Ticket change [f5c449b2ca] (rid 169028) by resuna on 2019-02-06 13:48:32:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
When deleting the structures associated with a Tcl command (kafkatcl subscriber object) I needed to delete the Tcl event handler associated with it. Apparently if this is done done from a callback inside Tcl_DoOneEvent it later segfaults at tclnotify.c line 958 while it's walking the event check list that Tcl_DeleteEventSource removed the event from.
- foundin initialized to: "Tcl 8.6"
- is_private initialized to: "0"
- login: "resuna"
- priority initialized to: "5 Medium"
- private_contact initialized to: "5a82a009d637a4accf9639361b771982503e09a8"
- resolution initialized to: "None"
- severity initialized to: "Important"
- status initialized to: "Open"
- submitter initialized to: "resuna"
- subsystem initialized to: "04. Async Events"
- title initialized to:
Calling Tcl_DeleteEventSource from inside Tcl_DoOneEvent segfaults
- type initialized to: "Bug"
Ticket change [8582c7439b] (rid 169029) by sebres on 2019-02-06 14:46:28:
- icomment:
Hi Peter, although and of course the SF is always bad... But Tcl_DeleteEventSource does not removes the event, it removes the event source. Basically Tcl_CreateEventSource is used to register new source of events and Tcl_DeleteEventSource will used later to clean-up it (at end of thread/unload module/something similar). Both are normally not intended for usage like continuously create/delete. So what exactly is the case, resp. in which callback it exactly is at the moment as deletion occurs? Is it setupProc or checkProc (initially registered by Tcl_CreateEventSource) where you try to delete the source? Anyway I think I know what is may be, so will try to fix it (I believe I had already fixed this in my event-perf-branch'es).
- login: "sebres"
- mimetype: "text/plain"
- icomment:
Ticket change [bc03e05302] (rid 259061) by serhiy.storchaka on 2026-10-18 16:52:47:
- foundin changed to: "9.1.0"
- icomment:
Still present in 9.1 (9.0 and 8.6 have the same loops): <tt>Tcl_DeleteEventSource()</tt> frees the source at once, while <tt>Tcl_DoOneEvent()</tt> or <tt>Tcl_ServiceAll()</tt> continue the traversal through its <tt>nextPtr</tt>, and a deleted source may still have its procs called. Proposed fix in branch [/timeline?r=notifier-delete-source-in-loop|notifier-delete-source-in-loop]: during a traversal the source is only marked deleted, and the outermost traversal frees it. Tests notify-3.1 to 3.4, with a new <nowiki>[testevent deletesource]</nowiki>.
- login: "serhiy.storchaka"
- mimetype: "text/x-fossil-wiki"
Ticket change [3cb286f731] (rid 261424) by jan.nijtmans on 2026-11-11 14:14:26:
- assignee changed to: "jan.nijtmans"
- login: "jan.nijtmans"
- mimetype: "text/plain"