X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.4 required=5.0	tests=AWL,BAYES_20,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,TW_RX,TW_YG
X-Spam-Check-By: sourceware.org
From: Barry Kelly <bkelly.ie@gmail.com>
To: Cygwin Mailing List <cygwin@cygwin.com>
Subject: stderr output from .NET apps causes shell hangs when cygwin is not running in Windows console
Date: Fri, 08 Jun 2012 04:59:47 +0100
Message-ID: <lps2t7d4u704jkumepjd5232pe2fv89cab@4ax.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id q5840Dbo004606

This C# app:

class err
{
  static void Main()
  {
    System.Console.Error.WriteLine("err");
  }
}

compiled with any csc.exe:

$(cygpath -u $WINDIR)/Microsoft.net/framework/*/csc.exe

This app (call it err.exe) when run, hangs for me when Cygwin is running
in anything other than a Windows console.

In a Windows console running bash, it works fine and "err" shows up on
the console.

In an rxvt console running bash or dash, err.exe exits without any
output showing, and the shell hangs with rxvt using 100% of a core,
looks like 75% main thread and 25% cygwin thread bouncing off one
another on a mutex. If I kill the shell (bash.exe or dash.exe), then
rxvt also exits.

In a mintty console running bash or dash, err.exe exits without any
output showing, and the shell hangs in an apparent deadlock.

In all cases, it looks like the shell is deadlocked, via a path through
cygwin1.dll, on a WaitForMultipleObjects call, judging by the thread
stack in process explorer.

This has been happening for me on two machines since I recently updated
a fairly old 1.7 Cygwin installation to the latest.

Running Windows 7 x64; cygcheck reports cygwin ver 1.7.15-1.

-- Barry

-- 
http://blog.barrkel.com/

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


