Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: e54f23497f7b36e3517823fcb53d22647c8a6a73
Ticket: 2647951fffffffffffffffffffffffffffffffff
Error in exec ends stdin
User & Date: eugene_cdn on 2009-02-28 06:56:26
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    Tcl version: 8.4+
    OS: Linux Red Hat 4, 5
    Maybe, it is a Linux bug, but it appeared in Tcl's stdin handling. I got the problem in C, but I created a Tcl script that fails the same way.
    If you execute a certain command though system()/exec which fails, stdin stream does not provide any more input except already buffered in C code. My Tcl script is more that 8K long because I initially got the problem on the very next byte after 8K, but attached test fails a bit earlier.
    Important: file must be redirected to stdin:
    > tclsh <xxx.tcl
    Read(0) just returns 0 as if it is the end of pipe/socket. If you specify file name as an argument, the script works.
    I cannot classify the problem. Just weird. Stdin stays open, /proc/pid/fd shows it, but 0 handle is damaged. Fork/clone is doing something bad to to the parent's stdin.
    Any help is appreciated. I cannot depend on any developer who can call system() and break stdin. Yes, I know that such redirection seem to make no sense, but it does; it is just a simplified version.
    
  4. foundin changed to: "None"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "eugene_cdn"
  10. subsystem changed to: "None"
  11. title changed to: "Error in exec ends stdin"
  12. type changed to: "Bug"