Artifacts Associated With Ticket 913029ffffffffff
Ticket change [24086e7647] (rid 131038) by p_samson on 2004-03-09 21:01:39:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- 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. - foundin initialized to: "obsolete: 8.4.1"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "p_samson"
- subsystem initialized to: "None"
- title initialized to: "Mix between stdout and stderr"
- type initialized to: "Bug"
Ticket change [88a8e806db] (rid 131903) by dkf on 2004-03-10 04:45:23:
- assignee changed to: "andreas_kupries"
- 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.)
- login: "dkf"
- mimetype: "text/plain"
- priority changed to: "7 High"
- subsystem changed to: "27. Channel Types"
- username: "dkf"
Ticket change [13bd0f5c4a] (rid 124272) by andreas_kupries on 2005-10-06 06:16:46:
- closedate changed to: "2005-10-05T23:16:46"
- closer changed to: "andreas_kupries"
- 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.
- login: "andreas_kupries"
- mimetype: "text/plain"
- resolution changed to: "Wont Fix"
- status changed to: "Pending"
- username: "andreas_kupries"
Ticket change [e9796408fd] (rid 104821) by sf-robot on 2005-10-20 09:20:40:
- closedate changed to: "2005-10-20T02:20:40"
- closer changed to: "sf-robot"
- 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).
- login: "sf-robot"
- mimetype: "text/plain"
- status changed to: "Closed"
- username: "sf-robot"
Ticket change [7e543f10b5] (rid 97394) by dkf on 2005-10-20 15:44:34:
- 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...
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment: