From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Brown Newsgroups: gmane.emacs.bugs Subject: bug#17753: Cygwin emacs-X11 core dump Date: Wed, 17 Sep 2014 11:17:24 -0400 Message-ID: <5419A604.8060201@cornell.edu> References: " <21431.6898.745604.392984@wombat.mininet>" <53B805C7.8030209@cornell.edu> <21435.4511.658539.666411@wombat.mininet> <53BD4A64.8000003@cornell.edu> <457212308be445a70279d3ece6e28207@mhoenicka.de> <993b66d09d7bfc46fc7433de63fde3be@mhoenicka.de> <83sijq362c.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1410967119 31853 80.91.229.3 (17 Sep 2014 15:18:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Sep 2014 15:18:39 +0000 (UTC) Cc: 17753@debbugs.gnu.org To: Eli Zaretskii , Markus Hoenicka Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Sep 17 17:18:32 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XUH04-0003JP-5j for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Sep 2014 17:18:32 +0200 Original-Received: from localhost ([::1]:45645 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUH03-0002ts-Nh for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Sep 2014 11:18:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54379) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUGzm-0002bs-K4 for bug-gnu-emacs@gnu.org; Wed, 17 Sep 2014 11:18:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUGze-0004Mi-EA for bug-gnu-emacs@gnu.org; Wed, 17 Sep 2014 11:18:14 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51985) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUGze-0004Lw-B4 for bug-gnu-emacs@gnu.org; Wed, 17 Sep 2014 11:18:06 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XUGza-00081c-M4 for bug-gnu-emacs@gnu.org; Wed, 17 Sep 2014 11:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ken Brown Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Sep 2014 15:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17753 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 17753-submit@debbugs.gnu.org id=B17753.141096705630812 (code B ref 17753); Wed, 17 Sep 2014 15:18:02 +0000 Original-Received: (at 17753) by debbugs.gnu.org; 17 Sep 2014 15:17:36 +0000 Original-Received: from localhost ([127.0.0.1]:43549 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUGz8-00080t-8O for submit@debbugs.gnu.org; Wed, 17 Sep 2014 11:17:35 -0400 Original-Received: from limerock03.mail.cornell.edu ([128.84.13.243]:48726) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUGz4-00080i-J1 for 17753@debbugs.gnu.org; Wed, 17 Sep 2014 11:17:31 -0400 X-CornellRouted: This message has been Routed already. Original-Received: from authusersmtp.mail.cornell.edu (granite3.serverfarm.cornell.edu [10.16.197.8]) by limerock03.mail.cornell.edu (8.14.4/8.14.4_cu) with ESMTP id s8HFHTGK029914; Wed, 17 Sep 2014 11:17:29 -0400 Original-Received: from [192.168.1.8] (cpe-67-249-176-226.twcny.res.rr.com [67.249.176.226]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id s8HFHSWe021315 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 17 Sep 2014 11:17:28 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: <83sijq362c.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:93426 Archived-At: On 9/17/2014 6:16 AM, Eli Zaretskii wrote: > Anyway, one thing that strikes me (and is consistent across all your > reports until now) is that atimer.c functions are run from a separate > thread, not the main thread (which is Thread 1). Ken, is this normal > in the Cygwin-w32 build? Timer functions in general are run in the main thread. I don't think the backtrace of Thread 2 can be trusted. Something weird is going on in Thread 2 in both the Cygwin-w32 build and the Cygwin-X11 build. And it happens only on 64-bit Cygwin (which is where we've been seeing these strange crashes). Here's a sample gdb session using the Cygwin-w32 build on 64-bit Cygwin (but I see the same thing with the Cygwin-X11 build): $ gdb /usr/bin/emacs-w32.exe GNU gdb (GDB) 7.6.50.20130728-cvs (cygwin-special) [...] (gdb) b run_timers Breakpoint 1 at 0x10064785c: file /usr/src/debug/emacs-24.3.93-4/src/atimer.c, line 342. (gdb) r -Q Starting program: /usr/bin/emacs-w32.exe -Q [New Thread 2072.0x1140] [New Thread 2072.0x25ec] [New Thread 2072.0x764] [New Thread 2072.0x22d4] [New Thread 2072.0x1c08] Breakpoint 1, run_timers () at /usr/src/debug/emacs-24.3.93-4/src/atimer.c:342 342 { (gdb) thread apply all bt Thread 5 (Thread 2072.0x1c08): #0 0x0000000076eb9e6a in USER32!SfmDxSetSwapChainStats () from /c/Windows/system32/USER32.dll #1 0x0000000076eb9e9e in USER32!GetMessageW () from /c/Windows/system32/USER32.dll #2 0x0000000000000000 in ?? () Thread 4 (Thread 2072.0x22d4): #0 0x0000000076ff12fa in ntdll!ZwWaitForSingleObject () from /c/Windows/system32/ntdll.dll #1 0x000007fefce510dc in WaitForSingleObjectEx () from /c/Windows/system32/KERNELBASE.dll #2 0x0000000000000000 in ?? () Thread 3 (Thread 2072.0x764): #0 0x0000000076ff186a in ntdll!ZwWaitForMultipleObjects () from /c/Windows/system32/ntdll.dll #1 0x0000000076fbb037 in ntdll!TpIsTimerSet () from /c/Windows/system32/ntdll.dll #2 0x0000000000000000 in ?? () Thread 2 (Thread 2072.0x25ec): #0 0x0000000076ff131a in ntdll!ZwReadFile () from /c/Windows/system32/ntdll.dll #1 0x000007fefce51a7a in ReadFile () from /c/Windows/system32/KERNELBASE.dll #2 0x000000000042ce00 in ?? () #3 0x0000000100647983 in run_timers () at /usr/src/debug/emacs-24.3.93-4/src/atimer.c:364 Backtrace stopped: previous frame inner to this frame (corrupt stack?) Thread 1 (Thread 2072.0x1140): #0 run_timers () at /usr/src/debug/emacs-24.3.93-4/src/atimer.c:342 #1 0x00000001006479b4 in do_pending_atimers () at /usr/src/debug/emacs-24.3.93-4/src/atimer.c:385 #2 0x000000010053fb87 in process_pending_signals () at /usr/src/debug/emacs-24.3.93-4/src/keyboard.c:7105 #3 0x00000001005b3c53 in Fmake_list (length=0, init=4306501682) at /usr/src/debug/emacs-24.3.93-4/src/alloc.c:2644 #4 0x00000001005e4e85 in concat (nargs=1, args=0x429650, target_type=Lisp_Cons, last_special=false) at /usr/src/debug/emacs-24.3.93-4/src/fns.c:588 #5 0x00000001005e4868 in Fcopy_sequence (arg=25770952502) at /usr/src/debug/emacs-24.3.93-4/src/fns.c:456 #6 0x000000010053a111 in timer_check () at /usr/src/debug/emacs-24.3.93-4/src/keyboard.c:4568 [...] You can see the expected timer functions running in the main thread, but I have no idea what's going on in Thread 2. Is run_timers really being called there, or is that just an artifact of a corrupt stack? Repeating the same steps in 32-bit Cygwin, gives the following: $ gdb /usr/bin/emacs-w32.exe GNU gdb (GDB) 7.6.50.20130728-cvs (cygwin-special) [...] (gdb) b run_timers Breakpoint 1 at 0x5e625e: file /usr/src/debug/emacs-24.3.93-4/src/atimer.c, line 343. (gdb) r -Q Starting program: /usr/bin/emacs-w32.exe -Q [New Thread 3284.0x25d0] [New Thread 3284.0x2088] [New Thread 3284.0x27a0] [New Thread 3284.0x216c] [New Thread 3284.0x9d0] Breakpoint 1, run_timers () at /usr/src/debug/emacs-24.3.93-4/src/atimer.c:343 343 struct timespec now = current_timespec (); (gdb) thread apply all bt Thread 5 (Thread 3284.0x9d0): #0 0x769778d7 in USER32!DispatchMessageW () from /c/Windows/syswow64/USER32.dll #1 0x005ffd9c in w32_msg_pump (msg_buf=0x3c0acd8) at /usr/src/debug/emacs-24.3.93-4/src/w32fns.c:2450 #2 0x005fffdf in w32_msg_worker@4 (arg=0x0) at /usr/src/debug/emacs-24.3.93-4/src/w32fns.c:2676 #3 0x61005eb4 in _cygtls::call2(unsigned long (*)(void*, void*), void*, void*)@16 (this=, func=func@entry=0x5fff3f , arg=0x3c0ac70, arg@entry=0x0, buf=buf@entry=0x3c0cdc4) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygtls.cc:100 #4 0x61006026 in _cygtls::call (func=0x5fff3f , arg=0x0) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/cygtls.cc:30 #5 0x6107d6c8 in threadfunc_fe (arg=) at /usr/src/debug/cygwin-1.7.32-1/winsup/cygwin/init.cc:30 #6 0x76bf338a in KERNEL32!BaseThreadInitThunk () from /c/Windows/syswow64/kernel32.dll #7 0x771b9f72 in ntdll!RtlInitializeExceptionChain () from /c/Windows/system32/ntdll.dll #8 0x771b9f45 in ntdll!RtlInitializeExceptionChain () from /c/Windows/system32/ntdll.dll #9 0x00000000 in ?? () Thread 4 (Thread 3284.0x216c): #0 0x7719f8d1 in ntdll!ZwWaitForSingleObject () from /c/Windows/system32/ntdll.dll #1 0x7719f8d1 in ntdll!ZwWaitForSingleObject () from /c/Windows/system32/ntdll.dll #2 0x756814ab in WaitForSingleObjectEx () from /c/Windows/syswow64/KERNELBASE.dll #3 0x00000318 in ?? () #4 0x00000000 in ?? () Thread 3 (Thread 3284.0x27a0): #0 0x771a015d in ntdll!ZwWaitForMultipleObjects () from /c/Windows/system32/ntdll.dll #1 0x771a015d in ntdll!ZwWaitForMultipleObjects () from /c/Windows/system32/ntdll.dll #2 0x771d2f91 in ntdll!RtlMoveMemory () from /c/Windows/system32/ntdll.dll #3 0x00000001 in ?? () #4 0x00000001 in ?? () #5 0x00000000 in ?? () Thread 2 (Thread 3284.0x2088): #0 0x7719f905 in ntdll!ZwReadFile () from /c/Windows/system32/ntdll.dll #1 0x7719f905 in ntdll!ZwReadFile () from /c/Windows/system32/ntdll.dll #2 0x7567dd62 in ReadFile () from /c/Windows/syswow64/KERNELBASE.dll #3 0x00000094 in ?? () #4 0x00000000 in ?? () Thread 1 (Thread 3284.0x25d0): #0 run_timers () at /usr/src/debug/emacs-24.3.93-4/src/atimer.c:343 #1 0x005e634c in do_pending_atimers () at /usr/src/debug/emacs-24.3.93-4/src/atimer.c:385 #2 0x0050d946 in process_pending_signals () at /usr/src/debug/emacs-24.3.93-4/src/keyboard.c:7105 #3 0x0056c13e in Fmake_list (length=0, init=9555994) at /usr/src/debug/emacs-24.3.93-4/src/alloc.c:2644 #4 0x00594cba in concat (nargs=1, args=0x28a030, target_type=Lisp_Cons, last_special=false) at /usr/src/debug/emacs-24.3.93-4/src/fns.c:588 #5 0x005947cf in Fcopy_sequence (arg=-2146299490) at /usr/src/debug/emacs-24.3.93-4/src/fns.c:456 #6 0x00508e9f in timer_check () at /usr/src/debug/emacs-24.3.93-4/src/keyboard.c:4571 Notice that Thread 2 doesn't look much different than Threads 3 and 4; in particular, it doesn't show that strange call to run_timers. I think I should take this to the Cygwin list, unless you have other suggestions of things to look at. Ken