Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: ebed174ca5e536d16a39d49022204e82109898bd
Ticket: 772288ffffffffffffffffffffffffffffffffff
Crash when std channels not open
User & Date: dkf on 2003-07-16 13:18:15
Changes

  1. assignee changed to: "andreas_kupries"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    The following script crashes both the HEAD and the 8.4
    branch:
      open /dev/null
    when run like this (from BASH, but there are other
    equivalent situations):
      tclsh bug.tcl <&-
    
    The effect of the invokation is to make tclsh run
    without stdin opened (the same also happens with stdout
    and stderr.)  This is caused by leaving the
    initialisation of the channel table until the call to
    Tcl_RegisterChannel() as part of the closing stages of
    the [open] implementation, which ensures that fd0 (or 1
    or 2) is put in the table twice, once for stdin/out/err
    and once for the newly created channel for [open], with
    the second time being the crash.
    
    The attached patch fixes this, but causes test
    encoding-24.3 to fail, and will break any script that
    depends on setting [encoding system] early so as to
    alter the encodings of the std channels.
    
    This problem was discovered by rmax
    
  4. foundin changed to: "obsolete: 8.4.3"
  5. priority changed to: "9 Immediate"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "dkf"
  9. subsystem changed to: "25. Channel System"
  10. title changed to: "Crash when std channels not open"
  11. type changed to: "Bug"