Hi Andrew,
>
> I do not see that buffering behaviour when running an IOC in a Cygwin
> OpenSSH session either.
>
Thanks for doing that - it prompted me to do a bit more investigating. On my Cygwin installation there are several ways to create a terminal - mintty, bash, and xterm. If I run a native windows compiled softIoc.exe in the bash terminal window, all works fine. If I run it in a mintty terminal window, I don't see any standard error output until I exit the IOC - then it all appears on screen. A Cygwin xterm window behaves the same - no stderr until the IOC is exited. If I type "tty" in the respective Cygwin windows, I see that mintty and xterm are both pseudo terminals whereas bash is a console session - I believe procServ uses forkpty(). So I think it boils down to Windows treating a Cygwin pty as non-interactive and thus buffering both stdout and stderr - I don't know whether it is possible to convince Windows to treat a Cygwin pty as a real terminal session? As you mentioned, the C99 standard mandates stderr to always be unbuffered so Windows is certainly not conforming her!
e
Regards,
Freddie
> -----Original Message-----
> From: Andrew Johnson [mailto:[email protected]]
> Sent: 05 February 2014 19:13
> To: [email protected]
> Subject: Re: stdout/stderr buffering on Windows
>
> Hi Freddie,
>
> On 02/05/2014 11:59 AM, [email protected] wrote:
> > just posting a note on an issue we have come across in case it is
> > helpful to anybody else. We are using Cygwin procServ on Windows to
> > start IOCs (Windows 7 / EPICS BASE 3.14.12.2) and, although stdout
> > was appearing when we typed commands in the telnet window, stderr was
> > not. When the IOC exited, however, the stderr output appeared so it
> > seems that stderr was being buffered.
>
> > A "google" on the subject returned some
> > references to this sort of behaviour when the Windows runtime does
> > not recognize the connection as a "terminal" - running the IOC
> > directly in a console windows certainly work OK
>
> I do not see that buffering behaviour when running an IOC in a Cygwin
> OpenSSH session either.
>
> The Linux manpage for setvbuf(3) says "The standard error stream stderr
> is always unbuffered by default" which is apparently required by both
> the C89 and C99 standards. I would be reluctant to add code to the IOC
> to turn buffering off when it should never be necessary to do that.
>
> Might this be indicative of a bug in procServ, or would it make sense/be
> possible for procServ to fix the Windows bug (rather than having to
> change the programs running under it)?
>
> - Andrew
> --
> Advertising may be described as the science of arresting the human
> intelligence long enough to get money from it. -- Stephen Leacock
--
Scanned by iCritical.
- Replies:
- Re: stdout/stderr buffering on Windows J. Lewis Muir
- References:
- stdout/stderr buffering on Windows freddie.akeroyd
- Re: stdout/stderr buffering on Windows Andrew Johnson
- Navigate by Date:
- Prev:
Re: CSS 3.2.14 Cannot get PyDev installed Kasemir, Kay
- Next:
RE: CSS 3.2.14 Cannot get PyDev installed Emmanuel Mayssat
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
<2014>
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: stdout/stderr buffering on Windows Andrew Johnson
- Next:
Re: stdout/stderr buffering on Windows J. Lewis Muir
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
<2014>
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|