public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Tom Honermann <thonermann@coverity.com>
To: <cygwin@cygwin.com>
Subject: Re: Intermittent failures with ctrl-c
Date: Sun, 20 Jan 2013 22:09:00 -0000	[thread overview]
Message-ID: <50FC6AF2.7070501@coverity.com> (raw)
In-Reply-To: <20130119055833.GA23653@ednor.casa.cgf.cx>

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 <signal_exit(int, siginfo_t*)>, 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=<optimized out>)
     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=<optimized out>,
     func=0x610043e0 <cygthread::stub(void*)>, 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

  reply	other threads:[~2013-01-20 22:09 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-07 19:55 Intermittent failures retrieving process exit codes Tom Honermann
2012-12-07 21:54 ` Tom Honermann
2012-12-07 23:07 ` bartels
2012-12-21  6:30   ` Tom Honermann
2012-12-21 10:33     ` Corinna Vinschen
2012-12-21 12:15       ` Nick Lowe
2012-12-21 19:45         ` Tom Honermann
2012-12-22  3:09           ` Nick Lowe
2012-12-21 16:10       ` Christopher Faylor
2012-12-21 17:02         ` Corinna Vinschen
2012-12-21 19:36           ` Intermittent failures retrieving process exit codes - snapshot test requested Christopher Faylor
2012-12-21 20:37             ` Daniel Colascione
2012-12-21 22:23             ` marco atzeri
2012-12-21 23:09               ` Tom Honermann
2012-12-22  2:53                 ` Christopher Faylor
2012-12-22  2:57                   ` Tom Honermann
2012-12-22  2:49               ` Christopher Faylor
2012-12-22  3:14                 ` Christopher Faylor
2012-12-22  9:06                   ` marco atzeri
2012-12-22 17:50                     ` Christopher Faylor
2012-12-23 16:56                       ` Christopher Faylor
2012-12-23 18:54                         ` marco atzeri
2012-12-27 20:50                         ` Tom Honermann
2012-12-29 21:57                           ` Christopher Faylor
2013-01-01  1:45                             ` Tom Honermann
2013-01-01  5:36                               ` Christopher Faylor
2013-01-02 19:15                                 ` Tom Honermann
2013-01-02 20:48                                   ` Christopher Faylor
2013-01-02 20:53                                     ` Daniel Colascione
2013-01-02 21:41                                       ` Christopher Faylor
2013-01-02 21:25                                     ` Tom Honermann
2013-01-15 22:17                                       ` Intermittent failures with ctrl-c (was: retrieving process exit codes) Tom Honermann
2013-01-16  2:04                                         ` Christopher Faylor
2013-01-16 16:38                                           ` Intermittent failures with ctrl-c Tom Honermann
2013-01-16 16:53                                             ` marco atzeri
2013-01-16 17:42                                               ` Tom Honermann
2013-01-16 18:05                                                 ` Earnie Boyd
2013-01-16 18:51                                                   ` Tom Honermann
2013-01-16 18:59                                                     ` Christopher Faylor
2013-01-16 20:19                                                       ` Tom Honermann
2013-01-16 22:23                                                         ` Christopher Faylor
2013-01-18 20:12                                                           ` Tom Honermann
2013-01-19  5:58                                                             ` Christopher Faylor
2013-01-20 22:09                                                               ` Tom Honermann [this message]
2013-01-23  3:20                                                                 ` Tom Honermann
2013-01-23  5:27                                                                   ` Christopher Faylor
2013-01-23 18:18                                                                     ` Tom Honermann
2013-01-23 18:35                                                                       ` Christopher Faylor
2013-01-24  4:12                                                                         ` Tom Honermann
2013-01-16 19:14                                             ` Christopher Faylor
2013-01-16 20:24                                               ` Tom Honermann
2012-12-21 20:01     ` Intermittent failures retrieving process exit codes Tom Honermann
2013-11-14  4:02     ` Tom Honermann
2013-11-14  9:20       ` Corinna Vinschen
2013-11-14 15:21         ` Tom Honermann
2013-11-15 18:53       ` Denis Excoffier
2013-11-15 19:21         ` Christopher Faylor
2013-11-17 13:30           ` Denis Excoffier
2013-11-15 22:15         ` Tom Honermann
2013-11-25 19:59         ` Lasse Collin
2013-11-25 23:12           ` Antivirus strikes back (probably) (Was: Intermittent failures retrieving process exit codes) Denis Excoffier
2013-11-26 21:09             ` Denis Excoffier
2013-11-26 23:36               ` Christopher Faylor
2013-11-26 21:09             ` Denis Excoffier
2013-12-01 13:24             ` Lasse Collin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50FC6AF2.7070501@coverity.com \
    --to=thonermann@coverity.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).