From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14335 invoked by alias); 20 Jan 2013 22:09:14 -0000 Received: (qmail 14319 invoked by uid 22791); 20 Jan 2013 22:09:13 -0000 X-SWARE-Spam-Status: No, hits=-3.4 required=5.0 tests=AWL,BAYES_50,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_NO,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from va3ehsobe004.messaging.microsoft.com (HELO va3outboundpool.messaging.microsoft.com) (216.32.180.14) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 20 Jan 2013 22:09:05 +0000 Received: from mail203-va3-R.bigfish.com (10.7.14.250) by VA3EHSOBE008.bigfish.com (10.7.40.28) with Microsoft SMTP Server id 14.1.225.23; Sun, 20 Jan 2013 22:09:03 +0000 Received: from mail203-va3 (localhost [127.0.0.1]) by mail203-va3-R.bigfish.com (Postfix) with ESMTP id 6C5D77C0083 for ; Sun, 20 Jan 2013 22:09:03 +0000 (UTC) X-Forefront-Antispam-Report: CIP:157.56.242.197;KIP:(null);UIP:(null);IPV:NLI;H:BL2PRD0512HT003.namprd05.prod.outlook.com;RD:none;EFVD:NLI X-SpamScore: 2 X-BigFish: PS2(zzbb2dI98dI9371I1432Izz1ee6h1de0h1202h1e76h1d1ah1d2ahzzb412mz32i2a8h668h839h947hd25he5bhf0ah1288h12a5h12a9h12bdh137ah13b6h1441h1504h1537h153bh162dh1631h1758h1765h1155h) Received: from mail203-va3 (localhost.localdomain [127.0.0.1]) by mail203-va3 (MessageSwitch) id 1358719739640691_21970; Sun, 20 Jan 2013 22:08:59 +0000 (UTC) Received: from VA3EHSMHS006.bigfish.com (unknown [10.7.14.254]) by mail203-va3.bigfish.com (Postfix) with ESMTP id 8ABA76200BB for ; Sun, 20 Jan 2013 22:08:59 +0000 (UTC) Received: from BL2PRD0512HT003.namprd05.prod.outlook.com (157.56.242.197) by VA3EHSMHS006.bigfish.com (10.7.99.16) with Microsoft SMTP Server (TLS) id 14.1.225.23; Sun, 20 Jan 2013 22:08:54 +0000 Received: from CH1PRD0310HT001.namprd03.prod.outlook.com (157.56.244.37) by pod51010.outlook.com (10.255.233.36) with Microsoft SMTP Server (TLS) id 14.16.257.4; Sun, 20 Jan 2013 22:08:52 +0000 Message-ID: <50FC6AF2.7070501@coverity.com> Date: Sun, 20 Jan 2013 22:09:00 -0000 From: Tom Honermann User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Subject: Re: Intermittent failures with ctrl-c References: <20130116020420.GA13284@ednor.casa.cgf.cx> <50F6D757.3000005@coverity.com> <50F6DB0F.2020602@gmail.com> <50F6E695.20302@coverity.com> <50F6F69F.3040000@coverity.com> <20130116185908.GA17801@ednor.casa.cgf.cx> <50F70B27.8000904@coverity.com> <20130116222305.GA24529@ednor.casa.cgf.cx> <50F9AC57.5020309@coverity.com> <20130119055833.GA23653@ednor.casa.cgf.cx> In-Reply-To: <20130119055833.GA23653@ednor.casa.cgf.cx> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-OriginatorOrg: coverity.com X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2013-01/txt/msg00288.txt.bz2 On 01/19/2013 12:58 AM, Christopher Faylor wrote: > On Fri, Jan 18, 2013 at 03:11:03PM -0500, Tom Honermann wrote: >> On 01/16/2013 05:23 PM, Christopher Faylor wrote: >>> On Wed, Jan 16, 2013 at 03:18:47PM -0500, Tom Honermann wrote: >>> I managed to duplicate a hang by changing your .bat file to use "sleep >>> 2" rather than false. I'm investigating now. >> >> I noticed that you checked in some additional changes on the 16th that >> look related to this, so I tested again with today's snapshot (20130118). > > I thought I sent a "try a snapshot" but I must have been hallucinating > again. > >> I was still able to produce hangs using the same test case. The >> symptoms are slightly different than I had seen previously. bash hung 2 >> out of the ~60 times I interrupted the test. No error messages were >> displayed this time. Upon pressing ctrl-c, bash hung for 60 seconds. I >> was then greeted with the "Terminate batch job" prompt and responding >> 'Y' terminated the process tree as expected. Pressing ctrl-c while bash >> was hung for that 60 seconds appeared to have no affect. > > The hang should be fixed in the upcoming snapshot. Snapshot 20130119 appears to have addressed most of the cases I've witnessed. However, I was still able to reproduce another case. As before, one of the processes is being left running when the rest are terminated. The "abandoned" process appears to be in a live-lock state with two threads (threads 1 and 2) running at 100%. Of particular interest is that each time I press ctrl-c in the cmd.exe console this process was spawned from, a new thread appears in the process even though this program is no longer a foreground process and all other Cygwin processes have terminated. The new threads never exit. Same test case as before. However, since reproducing this may be challenging, I dug in to try and get some details that might help with reproducing it. It looks like thread 1 was interrupted while in a call to free(). Both thread 1 and 2 appear to be stuck looping on calls to yield(). Thread 3 appears to be stuck in a call to WriteFile. I suspect thread 3 was created by the initial ctrl-c event, but I'm not able to get an accurate stack trace for this thread to prove that. Threads 4 and up correspond to new threads created for new ctrl-c events. The following stack traces correspond to the above mentioned snapshot with cygwin1.dbg (from cygwin1-20130119.dbg.bz2) in place. (gdb) thread 1 [Switching to thread 1 (Thread 5344.0x1878)] #0 0x7767fbfa in ntdll!RtlUpdateClonedSRWLock () from /cygdrive/c/Windows/SysWOW64/ntdll.dll (gdb) bt #0 0x7767fbfa in ntdll!RtlUpdateClonedSRWLock () from /cygdrive/c/Windows/SysWOW64/ntdll.dll #1 0x7767fbfa in ntdll!RtlUpdateClonedSRWLock () from /cygdrive/c/Windows/SysWOW64/ntdll.dll #2 0x76792ed6 in KERNELBASE!GetThreadUILanguage () from /cygdrive/c/Windows/syswow64/KERNELBASE.dll #3 0x61087581 in yield () at /netrel/src/cygwin-snapshot-20130119-1/winsup/cygwin/miscfuncs.cc:243 #4 0x610d6d9c in _sigfe () from /home/thonermann/cygwin/snapshot/usr/bin/cygwin1.dll #5 0x61083180 in free () at /netrel/src/cygwin-snapshot-20130119-1/winsup/cygwin/malloc_wrapper.cc:43 #6 0x00000010 in ?? () #7 0x00000000 in ?? () (gdb) thread 2 [Switching to thread 2 (Thread 5344.0x1ac8)] #0 0x7767f99e in ntdll!RtlUpdateClonedSRWLock () from /cygdrive/c/Windows/SysWOW64/ntdll.dll (gdb) bt #0 0x7767f99e in ntdll!RtlUpdateClonedSRWLock () from /cygdrive/c/Windows/SysWOW64/ntdll.dll #1 0x7767f99e in ntdll!RtlUpdateClonedSRWLock () from /cygdrive/c/Windows/SysWOW64/ntdll.dll #2 0x76793a5e in SetThreadPriority () from /cygdrive/c/Windows/syswow64/KERNELBASE.dll #3 0x6108759b in yield () at /netrel/src/cygwin-snapshot-20130119-1/winsup/cygwin/miscfuncs.cc:244 #4 0x610d6eb4 in _cygtls::lock() () from /home/thonermann/cygwin/snapshot/usr/bin/cygwin1.dll #5 0x610302ee in sigpacket::setup_handler (this=0x95ac04, handler=0x6102fdc0 , siga=..., tls=0x28ce64) at /netrel/src/cygwin-snapshot-20130119-1/winsup/cygwin/exceptions.cc:796 #6 0x610319d8 in sigpacket::process (this=0x95ac04) at /netrel/src/cygwin-snapshot-20130119-1/winsup/cygwin/exceptions.cc:1266 #7 0x610dd2ac in wait_sig () at /netrel/src/cygwin-snapshot-20130119-1/winsup/cygwin/sigproc.cc:1389 #8 0x61003ea5 in cygthread::callfunc (this=0x6118b400, issimplestub=) at /netrel/src/cygwin-snapshot-20130119-1/winsup/cygwin/cygthread.cc:51 #9 0x6100442f in cygthread::stub (arg=0x6118b400) at /netrel/src/cygwin-snapshot-20130119-1/winsup/cygwin/cygthread.cc:93 #10 0x6100538d in _cygtls::call2 (this=, func=0x610043e0 , arg=0x6118b400, buf=0x6100551b <_cygtls::call(unsigned long (*)(void*, void*), void*)+91>) at /netrel/src/cygwin-snapshot-20130119-1/winsup/cygwin/cygtls.cc:99 #11 0x0095ff88 in ?? () #12 0x76a8339a in KERNEL32!BaseCleanupAppcompatCacheSupport () from /cygdrive/c/Windows/syswow64/kernel32.dll #13 0x6118b400 in cygthread::exiting () from /home/thonermann/cygwin/snapshot/usr/bin/cygwin1.dll #14 0x0095ffd4 in ?? () #15 0x77699ef2 in ntdll!RtlpNtSetValueKey () from /cygdrive/c/Windows/SysWOW64/ntdll.dll #16 0x6118b400 in cygthread::exiting () from /home/thonermann/cygwin/snapshot/usr/bin/cygwin1.dll #17 0x4449ca2d in ?? () #18 0x00000000 in ?? () (gdb) thread 3 [Switching to thread 3 (Thread 5344.0x1c2c)] #0 0x7767f91d in ntdll!RtlUpdateClonedSRWLock () from /cygdrive/c/Windows/SysWOW64/ntdll.dll (gdb) bt #0 0x7767f91d in ntdll!RtlUpdateClonedSRWLock () from /cygdrive/c/Windows/SysWOW64/ntdll.dll #1 0x7767f91d in ntdll!RtlUpdateClonedSRWLock () from /cygdrive/c/Windows/SysWOW64/ntdll.dll #2 0x7678d4b5 in WriteFile () from /cygdrive/c/Windows/syswow64/KERNELBASE.dll #3 0x0000009c in ?? () #4 0x00000000 in ?? () (gdb) thread 4 [Switching to thread 4 (Thread 5344.0x718)] #0 0x7767f8b1 in ntdll!RtlUpdateClonedSRWLock () from /cygdrive/c/Windows/SysWOW64/ntdll.dll (gdb) bt #0 0x7767f8b1 in ntdll!RtlUpdateClonedSRWLock () from /cygdrive/c/Windows/SysWOW64/ntdll.dll #1 0x7767f8b1 in ntdll!RtlUpdateClonedSRWLock () from /cygdrive/c/Windows/SysWOW64/ntdll.dll #2 0x76790a91 in WaitForSingleObjectEx () from /cygdrive/c/Windows/syswow64/KERNELBASE.dll #3 0x00000034 in ?? () #4 0x00000000 in ?? () Tom. -- 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