Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 X-Authentication-Warning: localhost.localdomain: ronald set sender to blytkerchan AT users DOT sourceforge DOT net using -f Date: Tue, 2 Dec 2003 13:14:52 +0100 From: Ronald Landheer-Cieslak To: Antoine Labour Cc: cygwin AT cygwin DOT com Subject: Re: Bash wait indefinitely Message-ID: <20031202121452.GA9651@linux_rln.harvest> Reply-To: cygwin AT cygwin DOT com References: <3FC7AC79 DOT 2010000 AT myrealbox DOT com> <20031129221554 DOT GA26957 AT ally DOT rlsystems> <3FCBA38F DOT 9050902 AT m4x DOT org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="17pEHd4RhPHOinZp" Content-Disposition: inline In-Reply-To: <3FCBA38F.9050902@m4x.org> User-Agent: Mutt/1.4i X-Disclaimer: I had nothing to do with it - I swear! X-loop: linux_rln.harvest --17pEHd4RhPHOinZp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Please use cygwin at cygwin dot com for cygwin-related mail. I have set the reply-to header for your convenience. On Mon, Dec 01, 2003 at 12:24:47PM -0800, Antoine Labour wrote: > Ronald Landheer-Cieslak wrote: > >Unfortunately, I don't have any system with more than one CPU, so there's > >no way I can test it on a system like that and I have not run into any > >similar problems on any of the systems I have.. (Cygwin or otherwise). > > > >I'm afraid someone else will have to debug this, as I don't see that I can > >do anything - especially if it's hard to debug, only happens on multi-CPU > >systems and only with complex Bash scripts.. > If it is the same problem as I am experiencing, it seems to happen on > mono-CPU systems as well. Try this simple script : > > #!/bin/bash > i=0 > while true > do > A=$(basename /bin/sh) > i=$(($i+1)) > echo $i; > done > OK, I've run the script on my Cygwin machine and it does hang. Attaching with strace gets me an access violation (trying to read from NULL). Killing strace doesn't kill bash, which tells me it hadn't really attached yet (AFAIK, detaching from a process kills the process in all Windows before XP) > It is true, it's hard to reproduce, like any other race. But if you have > any insight about the threading model for processes, and how pipes are > handled, regarding synchronisation, that'd be helpful. I'm new to the > code base, and the learning curve is kind of steep (especially without > having access to cygwin-dev archive). Last time I checked, I could download the mbox-format archives from the FTP site.. I'm not all that familiar with the Cygwin threading code either, but I'm kinda familiar with the Bash codebase (since I'm the Cygwin-Bash maintainer 'n all) Attaching with gdb to the hanged Bash process gives me the attached gdb.out. (HTH) rlc BTW: AFAICT this is not a Bash problem: my other Bashes (on Linux) are milling happily.. -- I'm having a tax-deductible experience! I need an energy crunch!! --17pEHd4RhPHOinZp Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="gdb.out" [Switching to thread 1568.0x6a4] (gdb) bt #0 0x78477705 in ntdll!DbgUiConnectToDbg () from /cygdrive/c/WINNT/System32/NTDLL.DLL #1 0x77e91982 in KERNEL32!GetThreadContext () from /cygdrive/c/WINNT/system32/KERNEL32.DLL #2 0x78462b95 in vsnprintf () from /cygdrive/c/WINNT/System32/NTDLL.DLL #3 0x77e787dd in KERNEL32!GetModuleFileNameA () from /cygdrive/c/WINNT/system32/KERNEL32.DLL (gdb) thread [Current thread is 3 (thread 1568.0x6a4)] (gdb) thread 1 [Switching to thread 1 (thread 1568.0x630)]#0 0x7846376e in ntdll!ZwClose () from /cygdrive/c/WINNT/System32/NTDLL.DLL (gdb) bt #0 0x7846376e in ntdll!ZwClose () from /cygdrive/c/WINNT/System32/NTDLL.DLL #1 0x77e77738 in KERNEL32!CloseHandle () from /cygdrive/c/WINNT/system32/KERNEL32.DLL #2 0x61014fa7 in cygwin_internal () from /usr/bin/cygwin1.dll #3 0x61056a77 in cygwin_winpid_to_pid () from /usr/bin/cygwin1.dll #4 0x61079f46 in cygwin1!close () from /usr/bin/cygwin1.dll #5 0x00425921 in ?? () #6 0x00000003 in ?? () #7 0x00000001 in ?? () #8 0x0022f96c in ?? () #9 0x00000001 in ?? () #10 0x00000001 in ?? () #11 0x00000002 in ?? () #12 0x00000001 in ?? () (gdb) thread 2 [Switching to thread 2 (thread 1568.0x4ec)]#0 0x784637b2 in ntdll!ZwWaitForMultipleObjects () from /cygdrive/c/WINNT/System32/NTDLL.DLL (gdb) bt #0 0x784637b2 in ntdll!ZwWaitForMultipleObjects () from /cygdrive/c/WINNT/System32/NTDLL.DLL #1 0x77e77ab7 in WaitForMultipleObjectsEx () from /cygdrive/c/WINNT/system32/KERNEL32.DLL #2 0x77e7a31d in WaitForMultipleObjects () from /cygdrive/c/WINNT/system32/KERNEL32.DLL #3 0x00adfe84 in ?? () #4 0x00000001 in ?? () (gdb) --17pEHd4RhPHOinZp Content-Type: text/plain; charset=us-ascii -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ --17pEHd4RhPHOinZp--