Skip to content
Tcl Source Code History Of Ticket f1a25e8a50
Login

History Of Ticket f1a25e8a50

Artifacts Associated With Ticket f1a25e8a50

  1. Ticket change [3334849368] (rid 261679) by serhiy.storchaka on 2026-11-14 16:49:44:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-markdown"
    4. comment initialized to:
      ```
      close stdin
      set t [testthread create {testthread wait}]
      ```
      run in tcltest panics with
      ```
      Tcl_InitNotifier: could not create trigger eventfd
      ```
      Every new thread fails the same way. For example, `thread::create` or `tpool::post` from the Thread package after `close stdin`.
      
      With stdin closed, fd 0 is free, so `eventfd()` in the new thread's `PlatformEventsInit()` gets fd 0. `unix/tclEpollNotfy.c` treats that as an error (`if (tsdPtr->triggerEventFd <= 0)`) instead of checking for `< 0`.
      
      `TclpFinalizeNotifier()` makes the same assumption: it only closes the eventfd, trigger pipe and epoll/kqueue fds if they are non-zero, so a notifier fd that is 0 is never closed. `unix/tclKqueueNotfy.c` has the same check in finalize.
      
      Affects 9.0 and 9.1 on Linux, where epoll is the default notifier. 8.6 is not affected.
      
    5. foundin initialized to: "9.0.5, 9.1.0"
    6. is_private initialized to: "0"
    7. login: "serhiy.storchaka"
    8. priority initialized to: "5 Medium"
    9. resolution initialized to: "None"
    10. severity initialized to: "Important"
    11. status initialized to: "Open"
    12. submitter initialized to: "serhiy.storchaka"
    13. subsystem initialized to: "01. Notifier"
    14. title initialized to:
      New thread panics "Tcl_InitNotifier: could not create trigger eventfd" when stdin is closed
      
    15. type initialized to: "Bug"
  2. Ticket change [df3a0b5a61] (rid 261685) by serhiy.storchaka on 2026-11-14 17:51:58:

    1. icomment:
      Proposed fix in branch [/timeline?r=notifier-fd-zero|notifier-fd-zero]: the epoll notifier now accepts an eventfd of 0. The epoll and kqueue notifiers now also close their trigger and epoll/kqueue descriptors when one is 0; until now the kqueue notifier leaked fd 0. Test thread-9.2. Tested on Linux (epoll) and FreeBSD (kqueue).
      
    2. login: "serhiy.storchaka"
    3. mimetype: "text/x-fossil-wiki"
  3. Ticket change [5f03592f0b] (rid 261790) by jan.nijtmans on 2026-11-17 11:27:12:

    1. assignee changed to: "jan.nijtmans"
    2. comment changed to:
      ```
      close stdin
      set t [testthread create {testthread wait}]
      ```
      run in tcltest panics with
      ```
      Tcl_InitNotifier: could not create trigger eventfd
      ```
      Every new thread fails the same way. For example, `thread::create` or `tpool::post` from the Thread package after `close stdin`.
      
      With stdin closed, fd 0 is free, so `eventfd()` in the new thread's `PlatformEventsInit()` gets fd 0. `unix/tclEpollNotfy.c` treats that as an error (`if (tsdPtr->triggerEventFd <= 0)`) instead of checking for `< 0`.
      
      `TclpFinalizeNotifier()` makes the same assumption: it only closes the eventfd, trigger pipe and epoll/kqueue fds if they are non-zero, so a notifier fd that is 0 is never closed. `unix/tclKqueueNotfy.c` has the same check in finalize.
      
      Affects 9.0 and 9.1 on Linux, where epoll is the default notifier. 8.6 is not affected.
      
    3. icomment:
      Fixed in [64ce9de2a3|trunk]
      
      OK for backport to 9.0 (not done yet)
      
    4. login: "jan.nijtmans"
    5. mimetype: "text/x-fossil-wiki"
    6. resolution changed to: "Fixed"
    7. status changed to: "Pending"
  4. Ticket change [9b110b6bc0] (rid 261982) by jan.nijtmans on 2026-11-20 16:45:14:

    1. closedate changed to: "2461365.1980810994"
    2. closer changed to: "jan.nijtmans"
    3. icomment:
      Now also merged to core-9-0-branch
      
      Many thanks!
      
    4. login: "jan.nijtmans"
    5. mimetype: "text/x-fossil-wiki"
    6. status changed to: "Closed"