Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 21e71b39bff0eeac48516f4f5265aef2b3ff32b0
Ticket: 689835ffffffffffffffffffffffffffffffffff
macosx: reading from write-only pipe hangs
User & Date: das on 2003-02-20 05:19:39
Changes

  1. assignee changed to: "das"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    on Mac OS X, trying to read e.g. from stdout when it is a 
    pipe will not fail as on other platforms but block forever in 
    the recv() in TcpInputProc().
    
    this has been a long standing very annoying bug that 
    among others things interferes with the workings of 'make 
    test', e.g. "test io-32.1" will hang when it tries to [read 
    stdout] because stdout is a pipe when io.test is run from 
    tests/all.tcl
    
    I have now found an effective & simple workaround that 
    AFAICT does not have any negative implications on other 
    unices:
    
    when creating a socket channel in Tcl_MakeFileChannel(), 
    the mode argument cannot be passed to 
    Tcl_MakeTcpClientChannel() as noted in the comments.
    I've now added a static MakeTcpClientChannelMode() 
    taking a mode argument and use this from 
    Tcl_MakeFileChannel().
    Tcl_MakeTcpClientChannel() simply calls through to 
    MakeTcpClientChannelMode() with the default mode.
    
    so for writeonly files like stdout, the channel will now be 
    marked as writeonly even when it is based on a socket fd, 
    and thus reading from the channel will fail before the recv() 
    is ever attempted, thus working around the macosx 
    problem.
    
    c.f. attached patch for implementation.
    
  4. foundin changed to: "obsolete: 8.4.1"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "das"
  9. subsystem changed to: "27. Channel Types"
  10. title changed to: "macosx: reading from write-only pipe hangs"
  11. type changed to: "Bug"