Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: ac2f7778507594a850b966cfce3e5a63d7cef307
Ticket: 2827000fffffffffffffffffffffffffffffffff
tcl incorrectly reports eof to application
User & Date: andreas_kupries on 2009-07-29 05:14:45
Changes

  1. icomment:
    More investigation ... Instrumented the core a bit (what are the arguments and results when calling a channel inputProc, tcl_eof flags), and compared traces for plain socket and IChan over socket.
    
    Sockets are not returning an 0-length read, but errno -11 EAGAIN to signal 'os buffers empty, but not at eof'. This is transformed into CHANNEL_BLOCKED instead of EOF. At the Tcl level this is seen as an empty string result of gets/read, no eof, and no fblocked actually.
    
    IChan then returns this empty string, which indicates becomes a successful (errno 0) 0-length read, which indicates EOF, boom.
    
    The bug is not in IChan, but in the core reflected channel. It never returns error conditions like EWOULDBLOCK or EAGAIN from ReflectInput(), only EINVAL for bad handler and such. And a limitation, the 'read method' has no way to signal this to ReflectInput() either.
    
    
    
  2. login: "andreas_kupries"
  3. mimetype: "text/plain"
  4. username: "andreas_kupries"