This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Intermittent failures with ctrl-c


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]