<i>New thread panics "Tcl_InitNotifier: could not create trigger eventfd" when stdin is closed</i>.
by
.
D 2026-11-14T16:49:44.677
J assignee nobody
J closer nobody
J cmimetype text/x-markdown
J comment ```\nclose\sstdin\nset\st\s[testthread\screate\s{testthread\swait}]\n```\nrun\sin\stcltest\spanics\swith\n```\nTcl_InitNotifier:\scould\snot\screate\strigger\seventfd\n```\nEvery\snew\sthread\sfails\sthe\ssame\sway.\sFor\sexample,\s`thread::create`\sor\s`tpool::post`\sfrom\sthe\sThread\spackage\safter\s`close\sstdin`.\n\nWith\sstdin\sclosed,\sfd\s0\sis\sfree,\sso\s`eventfd()`\sin\sthe\snew\sthread's\s`PlatformEventsInit()`\sgets\sfd\s0.\s`unix/tclEpollNotfy.c`\streats\sthat\sas\san\serror\s(`if\s(tsdPtr->triggerEventFd\s<=\s0)`)\sinstead\sof\schecking\sfor\s`<\s0`.\n\n`TclpFinalizeNotifier()`\smakes\sthe\ssame\sassumption:\sit\sonly\scloses\sthe\seventfd,\strigger\spipe\sand\sepoll/kqueue\sfds\sif\sthey\sare\snon-zero,\sso\sa\snotifier\sfd\sthat\sis\s0\sis\snever\sclosed.\s`unix/tclKqueueNotfy.c`\shas\sthe\ssame\scheck\sin\sfinalize.\n\nAffects\s9.0\sand\s9.1\son\sLinux,\swhere\sepoll\sis\sthe\sdefault\snotifier.\s8.6\sis\snot\saffected.
J foundin 9.0.5,\s9.1.0
J is_private 0
J login serhiy.storchaka
J priority 5\sMedium
J resolution None
J severity Important
J status Open
J submitter serhiy.storchaka
J subsystem 01.\sNotifier
J title New\sthread\spanics\s"Tcl_InitNotifier:\scould\snot\screate\strigger\seventfd"\swhen\sstdin\sis\sclosed
J type Bug
K f1a25e8a5090333da9c02de51f04f2914fea7bfa
U serhiy.storchaka
Z f930e34c23e38777a9a987af6c11d554