delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/04/19/10:35:10

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-100.4 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE,USER_IN_WHITELIST
X-Spam-Check-By: sourceware.org
X-Mail-Handler: MailHop Outbound by DynDNS
X-Report-Abuse-To: abuse AT dyndns DOT com (see http://www.dyndns.com/services/mailhop/outbound_abuse.html for abuse reporting information)
X-MHO-User: U2FsdGVkX1+Yvw6L+cEJSuO2WX5cbXfr
Resent-From: Christopher Faylor <me AT cgf DOT cx>
Resent-Date: Thu, 19 Apr 2012 10:34:18 -0400
Resent-Message-ID: <20120419143418 DOT GA9256 AT ednor DOT casa DOT cgf DOT cx>
Resent-To: cygwin AT cygwin DOT com
Date: Thu, 19 Apr 2012 10:14:26 -0400
From: Christopher Faylor <cgf-use-the-mailinglist-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: 1.7.10->1.7.13 : output from .NET programs does not get through pipeline to a visual c++ program
Message-ID: <20120419141426.GA9010@ednor.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <CAHxe11=J=cJnwWcRnA1Pi9CmezWw+z04-b5k4trVmE3mVbiH7A AT mail DOT gmail DOT com>
MIME-Version: 1.0
In-Reply-To: <CAHxe11=J=cJnwWcRnA1Pi9CmezWw+z04-b5k4trVmE3mVbiH7A@mail.gmail.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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

On Thu, Apr 19, 2012 at 12:56:33PM +0100, somebody wrote:
>Hi all,
>
>This started in 1.7.10 and I thought this may be fixed in 1.7.12 due
>to emails in the mailing list:
>http://sourceware.org/ml/cygwin/2012-03/msg00666.html
>
>But there still seems to be a problem piping from a .net console
>application to a visual c++ console application.
>
>Using the following simple C# program complied using "csc /optimize
>/target:exe /out:./consoleout.exe Program.cs"
>
>>>>> Begin Program.cs
>namespace consoleout
>{
>    using System;
>
>    internal static class Program
>    {
>        private static void Main(string[] args)
>        {
>            foreach (var arg in args) {
>                Console.Out.WriteLine(arg);
>            }
>        }
>    }
>}
><<<< End Program.cs
>
>I can use this to output to cygwin exes OK
>$ ./consoleout.exe Hello There | cat
>Hello
>There
>$ ./consoleout.exe Hello There | grep ll
>1:Hello
>$
>
>I also created a visual c++ executable like the simple one below
>compiled with "cl /EHs readin.cxx /link"
>
>>>>> Begin readin.cxx
>#include <string>
>#include <iostream>
>
>int
>main(int argc, char** argv)
>{
>    static_cast<void>(argc);
>    static_cast<void>(argv);
>    std::string buf;
>    buf.reserve(1024);
>    while (std::getline(std::cin, buf, '\n')) {
>        std::cout << buf << '\n';
>    }
>    return EXIT_SUCCESS;
>}
><<<< End readin.cxx
>
>I can use this to output anything read in
>$ echo Hello | ./readin.exe
>Hello
>$ cat 'readin.cxx' | ./readin.exe
>#include <string>
>#include <iostream>
>
>int
>main(int argc, char** argv)
>{
>    static_cast<void>(argc);
>    static_cast<void>(argv);
>    std::string buf;
>    buf.reserve(1024);
>    while (std::getline(std::cin, buf, '\n')) {
>        std::cout << buf << '\n';
>    }
>    return EXIT_SUCCESS;
>}
>$
>
>But when combining the two, nothing happens.
>$ ./consoleout.exe Hello There | ./readin.exe
>$
>
>It "seems" as though the console out from the .net is not being
>correctly piped through to a vc++ program. I know that is a strange
>defect given all the other combinations work.
>
>The reverse works i.e. output from a visual c++ console application is
>piped correctly to a .net console application.
>
>This worked prior to 1.7.10 (1.7.9 and before).
>
>I am sorry that I cannot point to an area in the Cygwin code or
>suggest a fix, but I am hoping this is enough of a description to help
>someone find out what the issue is.

Sorry but I'm not going to set up a .NET development environment to
figure out a problem.  If someone else wants to provide a clue as
to what's going on, I'd appreciate it.

--
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