Skip to content
Tcl Source Code History Of Ticket 913029ffffffffff
Login

History Of Ticket 913029ffffffffff

Artifacts Associated With Ticket 913029ffffffffff

  1. Ticket change [24086e7647] (rid 131038) by p_samson on 2004-03-09 21:01:39:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OS: Windows with Cygwin
      
      If stdout and stderr are redirected to the same
      file,  they overwrite each other.
      
      Test case:
      
      Consider the script:
      $ cat service.sh
      #!/bin/bash
      # the next line restart using tclsh \
      exec tclsh "$9" "$@"
      
      puts stderr "Write stderr"
      puts "Starting service"
      while {true} {
        # wait 1 sec
        after 1000
        puts stderr "STDERR"
        puts "STDOUT"
      }
      
      I use a Windows service manager which
      does internally something like:
      $ ./service.sh >>service.log 2>>service.log
      
      So it gives:
      Starting serviSTDESTDOSTDESTDOSTDESTDOUT
      
      It looks like the overwriting of these two lines:
      (cr lf are replaced by space):
      Write stderr  STDERR  STDERR  STDERR
      Starting service  STDOUT  STDOUT  STDOUT
      
      In comparison, a pure shell script like:
      $ cat serviceSH.sh
      #!/bin/bash
      echo "Starting service" >&2
      while true; do
         sleep 10
         echo "STDERR" >&2
         echo "STDOUT" >&1
      done
      
      run as:
      $ ./serviceSH.sh >>service.log 2>>service.log
      
      Gives an expected result:
      Starting service
      STDERR
      STDOUT
      STDERR
      STDOUT
      STDERR
      STDOUT
      
      Note:
      adding: fconfigure stdout -buffering none
      didn't change anything.
      
      
      
    4. foundin initialized to: "obsolete: 8.4.1"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "p_samson"
    9. subsystem initialized to: "None"
    10. title initialized to: "Mix between stdout and stderr"
    11. type initialized to: "Bug"
  2. Ticket change [88a8e806db] (rid 131903) by dkf on 2004-03-10 04:45:23:

    1. assignee changed to: "andreas_kupries"
    2. icomment:
      Logged In: YES 
      user_id=79902
      
      Stuff like this is why O_APPEND isn't the same as seeking to
      the end yourself.  (Told you so, but can't remember the
      tracker item ID when I did it.)
      
      
    3. login: "dkf"
    4. mimetype: "text/plain"
    5. priority changed to: "7 High"
    6. subsystem changed to: "27. Channel Types"
    7. username: "dkf"
  3. Ticket change [13bd0f5c4a] (rid 124272) by andreas_kupries on 2005-10-06 06:16:46:

    1. closedate changed to: "2005-10-05T23:16:46"
    2. closer changed to: "andreas_kupries"
    3. icomment:
      Logged In: YES 
      user_id=75003
      
      Jun 28, 2005 dkf fixed this for unix, adding the O_APPEND
      flag to the appropriate places in the pipeline mgmt. He also
      noted that this is unfixable for Windows. However as Cygwin
      is involved, i.e. a unix emuklation layer, his change may
      have fixed the described situation.
      
      Given the date above this might just have slipped into
      8.4.11. If not, then the CVS head of the 8.4 branch has to
      be used for checking this.
      
      
    4. login: "andreas_kupries"
    5. mimetype: "text/plain"
    6. resolution changed to: "Wont Fix"
    7. status changed to: "Pending"
    8. username: "andreas_kupries"
  4. Ticket change [e9796408fd] (rid 104821) by sf-robot on 2005-10-20 09:20:40:

    1. closedate changed to: "2005-10-20T02:20:40"
    2. closer changed to: "sf-robot"
    3. icomment:
      Logged In: YES 
      user_id=1312539
      
      This Tracker item was closed automatically by the system. It was
      previously set to a Pending status, and the original submitter
      did not respond within 14 days (the time period specified by
      the administrator of this Tracker).
      
      
    4. login: "sf-robot"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"
    7. username: "sf-robot"
  5. Ticket change [7e543f10b5] (rid 97394) by dkf on 2005-10-20 15:44:34:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      Note that if the channel does not have an
      O_APPEND-equivalent tag on it at the OS level (whatever that
      means!) there is no way to get rid of the race condition
      because seek+read isn't an atomic operation.
      
      Not that this would matter except basic Windows file handles
      don't have such a flag (I don't know cygwin enough to
      comment on whether they've managed to add it.) You might be
      able to achieve something by adding locking to the mix, but
      that's horrific. If anyone wants to fix this for cygwin
      (it's not fixable for straight win32) they should start by
      writing a patch that allows them to pass a test like
      exec-19.1...
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"