X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE,RCVD_IN_SORBS_WEB,SPF_HELO_PASS,TW_RX X-Spam-Check-By: sourceware.org From: "James Johnston" To: References: In-Reply-To: Subject: RE: rxvt loses output connection with non cygwin console processes Date: Tue, 15 May 2012 17:26:07 -0000 Message-ID: <05f101cd32bf$d16a9d60$743fd820$@motionview3d.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com I can reproduce this, although I did not try rolling back my Cygwin version. The issue seems specific to .NET programs because they always do null writes. However the following straight Win32 program written in C will also reproduce the problem (basically the same program I've sent earlier on this mailing list). So it is not specific to .NET. #include int main() { char * test = "Hello world!\n"; DWORD written; HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE); Sleep(1000); WriteFile(h, test, 0, &written, NULL); /* causes problems */ Sleep(1000); WriteFile(h, test, lstrlenA(test), &written, NULL); return 0; } As the OP notes, I also only have this problem when running the test program from a "GUI" terminal. It seems that any program doing a null write to standard output (and probably standard error?) will trigger the problem. From Windows command prompt / standard Windows console window: Running Cygwin.bat to start Cygwin and then running ./Test.exe works fine. From mintty.exe: Running ./Test.exe causes bash to hang. Test.exe runs to completion and terminates, but bash doesn't get the hint. CPU usage is at 0%. If I use Windows Task Manager to kill bash.exe, then mintty.exe correctly terminates. From rxvt.exe: Running ./Test.exe causes bash to hang like with mintty. Test.exe runs to completion and terminates but bash is hung. For some reason, a thread in rxvt spins in an infinite loop, sucking 100% of a single CPU core. The hung bash.exe doesn't use any CPU. If I use Windows Task Manager to kill bash.exe, then rxvt.exe correctly exits its loop and terminates. > i have discovered something peculiar. > I run my rxvt with the usual: > > C:\cygwin\bin\rxvt.exe -bg wheat -fg black -sl 5000 -e /bin/bash -ls > > now I try inside to run some *non* cygwin console program rxvt shows > nothing, and reports 30% cpu consumption > > The actual program is executed, completes and control comes back to bash, > but the output is not there. > I can issue blindly other commands and see them in process list (e.g. ls -lR /) I > can also terminate the session with Ctrl-D or exit As long as rxvt is running > procexplorer reports 30% cpu usage. > > This started to happen today after I did update (setup.exe) The cygwin.dll > version is 1.7.15-1 Now if I roll back cygwin.dll to 1.7.14-2 problem is gone. > > The programs which triggers the problem are .net console applications > (2.0 or 4.0). > All cygwin binaries + java.exe work ok. > > The trigger program runs ok in cmd.exe with bash. > And as a bonus, mintty has also similar problem. Cpu doesn't go as high and > input channel with bash is lost. -- 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