X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :content-type:content-transfer-encoding; q=dns; s=default; b=XMM FdSpkysgPWgLj4s1WAYHxgC1FLGSjjY5ehR7TS5fiLmPn50lYRDyp8B4YlNOIbnn 5nVswpC6RC3CaScxNSpbthvEF0+wFHpInJiy34LB5DtEQEEv32j+5873ovnOJ9LY G1jgGL4SpEW60l7AbX3MQ9h1Aos5ak5OsMrj44cw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :content-type:content-transfer-encoding; s=default; bh=U213lkV1L eQFSRer/2R25FN3fBU=; b=Tpp1Ju3QHENikYQp2YCE3IyDgJqsY1GzrVLcCQFIA JgT7xfPBZoQS3C/AJKxZwHU4Qgd+tz7khPzC6X9ObbdEYdOa5PlxXjcUQfhwiqp4 dryZliniwsy680VeWgXnjZQL92ihreBdSYywewhVWXJOoFbpuh1/I+f+ZKZJXUzz UY= 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 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: limerock04.mail.cornell.edu X-CornellRouted: This message has been Routed already. Message-ID: <54450835.3050602@cornell.edu> Date: Mon, 20 Oct 2014 09:03:49 -0400 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: cygwin Subject: Threads Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes When trying to debug emacs in gdb, I see several threads, but it's not always clear who created those threads and what they're doing. As an example, I attached gdb to an emacs-X11 process (running under X) shortly after starting it, and I obtained the backtrace appended at the end of this message. I assume Thread 12 was created by gdb. Thread 6 appears to be a timer thread and Thread 2 appears to be a signal thread; I assume both of these were created by the Cygwin DLL. And Thread 1 is the main thread. I don't have any idea where the other threads came from. Presumably at least one of them was created by Glib. The situation is similar with emacs-w32 and emacs-nox, but with fewer threads. In general, is there a way I can understand where all the threads come from? My reason for asking is that we're still getting emacs bug reports on 64-bit Cygwin, with random crashes or assertion violations that are "impossible" according to the gdb backtraces. [*] So I'm wondering whether they're caused by interference from other threads. Or is there some other plausible explanation for "impossible" crashes? This can't just be a result of a gdb bug, because in at least one case the assertion can be shown to be valid by using printf instead of gdb. Ken [*] By "impossible" I mean that examination of the relevant variables in gdb shows that the assertions are in fact true. Two ongoing examples are http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18438 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18769 =============thread apply all bt============================== Thread 12 (Thread 6288.0x554): #0 0x0000000077b50591 in ntdll!DbgBreakPoint () at /c/Windows/SYSTEM32/ntdll.dll #1 0x0000000077bf7f48 in ntdll!DbgUiRemoteBreakin () at /c/Windows/SYSTEM32/ntdll.dll #2 0x00000000779f59ed in KERNEL32!BaseThreadInitThunk () at /c/Windows/system32/kernel32.dll #3 0x0000000077b2c541 in ntdll!RtlUserThreadStart () at /c/Windows/SYSTEM32/ntdll.dll #4 0x0000000000000000 in () Thread 11 (Thread 6288.0x2280): #0 0x0000000077b52bba in ntdll!ZwWaitForWorkViaWorkerFactory () at /c/Windows/SYSTEM32/ntdll.dll #1 0x0000000077b1fe3b in ntdll!RtlValidateHeap () at /c/Windows/SYSTEM32/ntdll.dll #2 0x000000018004619b in _cygtls::call2(unsigned int (*)(void*, void*), void*, void*) (this=0x2000002, func=0x0, arg=0x5e82d0, buf=buf AT entry=0x47bcd50) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygtls.cc:100 #3 0x00000001800462f4 in _cygtls::call(unsigned int (*)(void*, void*), void*) (func=, arg=) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygtls.cc:30 #4 0x00000000779f59ed in KERNEL32!BaseThreadInitThunk () at /c/Windows/system32/kernel32.dll #5 0x0000000077b2c541 in ntdll!RtlUserThreadStart () at /c/Windows/SYSTEM32/ntdll.dll #6 0x0000000000000000 in () Thread 10 (Thread 6288.0x22c0): #0 0x0000000077b52bba in ntdll!ZwWaitForWorkViaWorkerFactory () at /c/Windows/SYSTEM32/ntdll.dll #1 0x0000000077b1fe3b in ntdll!RtlValidateHeap () at /c/Windows/SYSTEM32/ntdll.dll #2 0x000000018004619b in _cygtls::call2(unsigned int (*)(void*, void*), void*, void*) (this=0x2000002, func=0x29000029, arg=0x5e82d0, buf=buf AT entry=0x4bbcd50) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygtls.cc:100 #3 0x00000001800462f4 in _cygtls::call(unsigned int (*)(void*, void*), void*) (func=, arg=) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygtls.cc:30 #4 0x00000000779f59ed in KERNEL32!BaseThreadInitThunk () at /c/Windows/system32/kernel32.dll #5 0x0000000077b2c541 in ntdll!RtlUserThreadStart () at /c/Windows/SYSTEM32/ntdll.dll #6 0x0000000000000000 in () Thread 9 (Thread 6288.0x1e98): #0 0x0000000077b515fa in ntdll!ZwDelayExecution () at /c/Windows/SYSTEM32/ntdll.dll #1 0x000007fefda11203 in SleepEx () at /c/Windows/system32/KERNELBASE.dll #2 0x000000018010d970 in thread_pipe(void*) (arg=0x600d2bfe0) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/select.cc:690 #3 0x0000000180044fc5 in cygthread::callfunc(bool) (this=this AT entry=0x1801d0500 , issimplestub=issimplestub AT entry=false) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygthread.cc:51 #4 0x000000018004552a in cygthread::stub(void*) (arg=arg AT entry=0x1801d0500 ) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygthread.cc:93 #5 0x000000018004619b in _cygtls::call2(unsigned int (*)(void*, void*), void*, void*) (this=0x43bce00, func= 0x1800454d0 , arg=0x1801d0500 , buf=buf AT entry=0x43bcd50) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygtls.cc:100 #6 0x00000001800462f4 in _cygtls::call(unsigned int (*)(void*, void*), void*) (func=, arg=) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygtls.cc:30 #7 0x00000000779f59ed in KERNEL32!BaseThreadInitThunk () at /c/Windows/system32/kernel32.dll #8 0x0000000077b2c541 in ntdll!RtlUserThreadStart () at /c/Windows/SYSTEM32/ntdll.dll #9 0x0000000000000000 in () Thread 8 (Thread 6288.0x1ae4): #0 0x0000000077b5186a in ntdll!ZwWaitForMultipleObjects () at /c/Windows/SYSTEM32/ntdll.dll #1 0x000007fefda11430 in KERNELBASE!GetCurrentProcess () at /c/Windows/system32/KERNELBASE.dll #2 0x0000000000000000 in () Thread 7 (Thread 6288.0x1bac): #0 0x0000000077b5134a in ntdll!ZwRemoveIoCompletion () at /c/Windows/SYSTEM32/ntdll.dll #1 0x000007fefd095941 in () at /c/Windows/System32/mswsock.dll #2 0x0000000000000000 in () Thread 6 (Thread 6288.0xf40): #0 0x0000000077b512fa in ntdll!ZwWaitForSingleObject () at /c/Windows/SYSTEM32/ntdll.dll #1 0x000007fefda110dc in WaitForSingleObjectEx () at /c/Windows/system32/KERNELBASE.dll #2 0x000000018013db94 in timer_thread(void*) (x=0x37ba9d8) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/timer.cc:145 #3 0x0000000180044fc5 in cygthread::callfunc(bool) (this=this AT entry=0x1801d0450 , issimplestub=issimplestub AT entry=false) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygthread.cc:51 #4 0x000000018004552a in cygthread::stub(void*) (arg=arg AT entry=0x1801d0450 ) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygthread.cc:93 #5 0x000000018004619b in _cygtls::call2(unsigned int (*)(void*, void*), void*, void*) (this=0x37bce00, func= 0x1800454d0 , arg=0x1801d0450 , buf=buf AT entry=0x37bcd50) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygtls.cc:100 #6 0x00000001800462f4 in _cygtls::call(unsigned int (*)(void*, void*), void*) (func=, arg=) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygtls.cc:30 #7 0x00000000779f59ed in KERNEL32!BaseThreadInitThunk () at /c/Windows/system32/kernel32.dll #8 0x0000000077b2c541 in ntdll!RtlUserThreadStart () at /c/Windows/SYSTEM32/ntdll.dll #9 0x0000000000000000 in () Thread 5 (Thread 6288.0x1cc0): #0 0x0000000077b515fa in ntdll!ZwDelayExecution () at /c/Windows/SYSTEM32/ntdll.dll #1 0x000007fefda11203 in SleepEx () at /c/Windows/system32/KERNELBASE.dll #2 0x000000018010d970 in thread_pipe(void*) (arg=0x600045f20) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/select.cc:690 #3 0x0000000180044fc5 in cygthread::callfunc(bool) (this=this AT entry=0x1801d03f8 , issimplestub=issimplestub AT entry=false) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygthread.cc:51 #4 0x000000018004552a in cygthread::stub(void*) (arg=arg AT entry=0x1801d03f8 ) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygthread.cc:93 #5 0x000000018004619b in _cygtls::call2(unsigned int (*)(void*, void*), void*, void*) (this=0x33bce00, func= 0x1800454d0 , arg=0x1801d03f8 , buf=buf AT entry=0x33bcd50) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygtls.cc:100 #6 0x00000001800462f4 in _cygtls::call(unsigned int (*)(void*, void*), void*) (func=, arg=) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygtls.cc:30 #7 0x00000000779f59ed in KERNEL32!BaseThreadInitThunk () at /c/Windows/system32/kernel32.dll #8 0x0000000077b2c541 in ntdll!RtlUserThreadStart () at /c/Windows/SYSTEM32/ntdll.dll #9 0x0000000000000000 in () Thread 4 (Thread 6288.0x620): #0 0x0000000077b5186a in ntdll!ZwWaitForMultipleObjects () at /c/Windows/SYSTEM32/ntdll.dll #1 0x000007fefda11430 in KERNELBASE!GetCurrentProcess () at /c/Windows/system32/KERNELBASE.dll #2 0x0000000000000000 in () Thread 3 (Thread 6288.0x50c): #0 0x0000000077b5186a in ntdll!ZwWaitForMultipleObjects () at /c/Windows/SYSTEM32/ntdll.dll #1 0x0000000077b1b037 in ntdll!TpIsTimerSet () at /c/Windows/SYSTEM32/ntdll.dll #2 0x00000000779f59ed in KERNEL32!BaseThreadInitThunk () at /c/Windows/system32/kernel32.dll #3 0x0000000077b2c541 in ntdll!RtlUserThreadStart () at /c/Windows/SYSTEM32/ntdll.dll #4 0x0000000000000000 in () Thread 2 (Thread 6288.0x4ec): #0 0x0000000077b5131a in ntdll!ZwReadFile () at /c/Windows/SYSTEM32/ntdll.dll #1 0x000007fefda11a7a in ReadFile () at /c/Windows/system32/KERNELBASE.dll #2 0x00000000779f0a19 in ReadFile () at /c/Windows/system32/kernel32.dll #3 0x00000001801197c2 in wait_sig(void*) () at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/sigproc.cc:1239 #4 0x0000000180044fc5 in cygthread::callfunc(bool) (this=this AT entry=0x1801d03a0 , issimplestub=issimplestub AT entry=false) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygthread.cc:51 #5 0x000000018004552a in cygthread::stub(void*) (arg=arg AT entry=0x1801d03a0 ) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygthread.cc:93 #6 0x000000018004619b in _cygtls::call2(unsigned int (*)(void*, void*), void*, void*) (this=0x23ace00, func= 0x1800454d0 , arg=0x1801d03a0 , buf=buf AT entry=0x23acd50) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygtls.cc:100 #7 0x00000001800462f4 in _cygtls::call(unsigned int (*)(void*, void*), void*) (func=, arg=) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygtls.cc:30 #8 0x00000000779f59ed in KERNEL32!BaseThreadInitThunk () at /c/Windows/system32/kernel32.dll #9 0x0000000077b2c541 in ntdll!RtlUserThreadStart () at /c/Windows/SYSTEM32/ntdll.dll #10 0x0000000000000000 in () Thread 1 (Thread 6288.0x2304): #0 0x0000000077b5186a in ntdll!ZwWaitForMultipleObjects () at /c/Windows/SYSTEM32/ntdll.dll #1 0x000007fefda11430 in KERNELBASE!GetCurrentProcess () at /c/Windows/system32/KERNELBASE.dll #2 0x0000000000000001 in () Continuing. -- 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