delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/05/15/13:02:43

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE,RCVD_IN_SORBS_WEB,SPF_HELO_PASS
X-Spam-Check-By: sourceware.org
From: "James Johnston" <JamesJ AT motionview3d DOT com>
To: <cygwin AT cygwin DOT com>
References: <announce DOT 20120510062830 DOT GB11695 AT calimero DOT vinschen DOT de>
In-Reply-To: <announce.20120510062830.GB11695@calimero.vinschen.de>
Subject: RE: [ANNOUNCEMENT] Updated: Cygwin 1.7.15
Date: Tue, 15 May 2012 17:02:10 -0000
Message-ID: <05e901cd32bc$78dc8210$6a958630$@motionview3d.com>
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id q4FH2dvO004238

> - Add CYGWIN=pipe_byte option to force opening of pipes in byte mode
>   rather than message mode.

I can confirm that setting this fixes the test cases I was having problems with.  Thanks! :)

A suggestion: maybe modify the documentation to state why one would set this?  Current documentation has no clues for why this new pipe_byte option exists, and what problems it might solve.  For example, on http://cygwin.com/cygwin-ug-net/using-cygwinenv.html maybe adding something like:

"By default, Cygwin uses message mode pipes, which more closely emulates UNIX pipe behavior.  Byte mode is required when redirecting standard input for non-Cygwin programs that are not compatible with message mode pipes.  For example, Visual C++ runtime libraries and the .NET Framework are not compatible with message mode pipes."

Maybe add something in the FAQ too, although I'm not sure if this is a frequently asked question yet that is worthy of addition!  I would imagine it could be, given that other people use non-Cygwin programs from Cygwin and probably most of these are affected due to usage of Microsoft runtimes.  I know the FAQ is one of the places I look when troubleshooting.  I don't know if this is worthy to go in there, but perhaps an entry might look like:

"Q:  Why do some programs fail to fully process redirected standard input?

A:  By default, Cygwin uses message mode pipes when redirecting standard file handles, because this more closely emulates UNIX pipes.  Non-Cygwin programs sometimes use runtimes that are not compatible with message mode pipes, so they break under some conditions.  Example runtimes that break include Visual C++ runtime libraries and the .NET Framework.  To work around this issue, set the CYGWIN environment variable option 'pipe_byte'.

An example of a condition that breaks these runtimes is a null write.  For example, if a write of zero bytes is written to a message mode pipe, the receiving program will read zero bytes.  Many runtimes incorrectly assume this is end-of-file, and they no longer correctly read standard input as a result.  Byte mode pipes do not pass through these zero byte writes."

The one thing missing from all this discussion is why you'd want message mode pipes, other than that it more closely emulates UNIX.  For example, are there some packages that break when presented with byte mode pipes?  It could be useful to add some examples of negative real-world consequences to using byte mode pipes.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019