kovidgoyal/kitty · warning
Failed to write to %s wakeup fd with error: %s
Error message
Failed to write to %s wakeup fd with error: %s
What it means
Writing a wakeup byte to the loop's wakeup pipe/eventfd failed; this fd is how other threads and signal handlers rouse the select/epoll io loop, so a lost wakeup may delay processing until the next timeout. Suppressed when called from a signal handler.
Source
Thrown at kitty/loop-utils.c:132
safe_close(ld->wakeup_read_fd, __FILE__, __LINE__);
#endif
ld->wakeup_read_fd = -1;
remove_signal_handlers(ld);
}
void
wakeup_loop(LoopData *ld, bool in_signal_handler, const char *loop_name) {
while (true) {
#ifdef HAS_EVENT_FD
static const int64_t value = 1;
ssize_t ret = write(ld->wakeup_read_fd, &value, sizeof value);
#else
ssize_t ret = write(ld->wakeup_fds[1], "w", 1);
#endif
if (ret < 0) {
if (errno == EINTR) continue;
if (!in_signal_handler) log_error("Failed to write to %s wakeup fd with error: %s", loop_name, strerror(errno));
}
break;
}
}
void
read_signals(int fd, handle_signal_func callback, void *data) {
#ifdef HAS_SIGNAL_FD
static struct signalfd_siginfo fdsi[32];
siginfo_t si;
while (true) {
ssize_t s = read(fd, &fdsi, sizeof(fdsi));
if (s < 0) {
if (errno == EINTR) continue;
if (errno == EAGAIN) break;
log_error("Call to read() from read_signals() failed with error: %s", strerror(errno));
break;View on GitHub (pinned to 6d5d0c4406)
Solutions
- Ignore if it appears only during shutdown - benign
- Upgrade kitty; wakeup race handling improves over time
- Check for fd leaks (EMFILE) by comparing with ulimit -n
- Report upstream with a reproducer if it recurs during normal use
Defensive patterns
Strategy: retry
Prevention
- Treat as benign during shutdown
- Report recurring cases with fd-usage info
When it happens
Trigger: wakeup_io_loop / wakeup_talk_loop / wakeup_write_loop writing to the wakeup fd when it is closed (EBADF), full (EAGAIN on a non-blocking pipe), or under fd exhaustion (EMFILE).
Common situations: Shutdown races where the io loop closes while another thread signals it; fd leaks from other software.
Related errors
- Trying to send data when to pipe is nil
- Too few arguments to pipe function
- Call to read() from read_signals() failed with error: %s
- This must be run as kitten ask
- This should be run as kitten broadcast
AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27).
Data as JSON: /api/errors/02a2a92c0514f227.
Report an issue: GitHub.