Overview
| Artifact ID: | 33348493683b2b2a6c4e7c09c1a68dfac45f4cea06ae8baa9c3752cd9449db7e |
|---|---|
| Ticket: | f1a25e8a5090333da9c02de51f04f2914fea7bfa
New thread panics "Tcl_InitNotifier: could not create trigger eventfd" when stdin is closed |
| User & Date: | serhiy.storchaka on 2026-11-14 16:49:44 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-markdown"
- 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. - foundin changed to: "9.0.5, 9.1.0"
- is_private changed to: "0"
- login: "serhiy.storchaka"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- severity changed to: "Important"
- status changed to: "Open"
- submitter changed to: "serhiy.storchaka"
- subsystem changed to: "01. Notifier"
- title changed to:
New thread panics "Tcl_InitNotifier: could not create trigger eventfd" when stdin is closed
- type changed to: "Bug"