Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 8c833ee4e9dd8b668b51fc2ab02b531f3670ebe2efbad979aea6f9fd6cdcdcf9
Ticket: 7aa8fd34c4e8ed00e73e06aef189fae1b092d1c4
epoll notifier spins and never reports writable after EPOLLERR
User & Date: serhiy.storchaka on 2026-10-16 21:46:10
Changes

  1. cmimetype changed to: "text/x-fossil-wiki"
  2. comment changed to:
    On Linux (epoll notifier, 8.7 and later), a writable handler on a pipe whose reader has exited never fires: EPOLLERR is translated only to TCL_EXCEPTION, and the level-triggered event wakes epoll_wait() again at once, so the process spins at 100% CPU. A background flush to such a pipe never ends, and <nowiki>[close]</nowiki> reports no error although the data was lost.
    
    <verbatim>
    set f [open |[list [info nameofexecutable] exit.tcl] w]   ;# child exits at once
    fconfigure $f -blocking 0
    puts -nonewline $f [string repeat x 300000]
    catch {flush $f}
    chan event $f writable {set w writable}
    after 3000 {set w timeout}
    vwait w   ;# 8.6: writable at once, close gives "broken pipe"; 9.x: timeout, close gives no error
    </verbatim>
    
    select() reports such a descriptor as writable. The code is from [858569fb04].
    
  3. foundin changed to: "9.0.5, 9.1.0"
  4. login: "serhiy.storchaka"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. severity changed to: "Minor"
  8. status changed to: "Open"
  9. submitter changed to: "serhiy.storchaka"
  10. subsystem changed to: "01. Notifier"
  11. title changed to:
    epoll notifier spins and never reports writable after EPOLLERR
    
  12. type changed to: "Bug"