From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#12544: -r110296..110297 causes random crashes in optimized build on Windows Date: Mon, 01 Oct 2012 11:34:35 +0200 Message-ID: <83fw5ycz84.fsf@gnu.org> References: <83ipaud30i.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1349084151 4554 80.91.229.3 (1 Oct 2012 09:35:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Oct 2012 09:35:51 +0000 (UTC) Cc: lekktu@gmail.com, 12544@debbugs.gnu.org To: fabrice.popineau@supelec.fr Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 01 11:35:57 2012 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 1TIcPs-0001Fk-8G for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Oct 2012 11:35:56 +0200 Original-Received: from localhost ([::1]:37617 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TIcPm-0001l9-LP for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Oct 2012 05:35:50 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56004) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TIcPg-0001kB-Fy for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2012 05:35:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TIcPY-0004Yp-OQ for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2012 05:35:44 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54372) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TIcPY-0004Yh-BP for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2012 05:35:36 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TIcPx-0001VO-Pv for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2012 05:36:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Oct 2012 09:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12544 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12544-submit@debbugs.gnu.org id=B12544.13490841455764 (code B ref 12544); Mon, 01 Oct 2012 09:36:01 +0000 Original-Received: (at 12544) by debbugs.gnu.org; 1 Oct 2012 09:35:45 +0000 Original-Received: from localhost ([127.0.0.1]:35685 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TIcPg-0001Uu-Ct for submit@debbugs.gnu.org; Mon, 01 Oct 2012 05:35:44 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:48899) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TIcPe-0001Um-OV for 12544@debbugs.gnu.org; Mon, 01 Oct 2012 05:35:43 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MB700D00JL1YK00@a-mtaout22.012.net.il> for 12544@debbugs.gnu.org; Mon, 01 Oct 2012 11:34:32 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MB700DUIJXG9JA0@a-mtaout22.012.net.il>; Mon, 01 Oct 2012 11:34:29 +0200 (IST) In-reply-to: <83ipaud30i.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:65065 Archived-At: > Date: Mon, 01 Oct 2012 10:12:45 +0200 > From: Eli Zaretskii > Cc: lekktu@gmail.com, 12544@debbugs.gnu.org > > > From: Fabrice Popineau > > Date: Mon, 1 Oct 2012 09:31:14 +0200 > > Cc: 12544@debbugs.gnu.org > > > > I don't know if it is related or not, but I get a few crashes too when > > doing a bootstrap and > > while compiling some .el files. An example of a backtrace is : > > And the crash occurs after a > > > > EnterCriticalSection(crit) > > > > instruction. > > I have the same behaviour with both 32bits and 64bits exe. > > The backtrace looks completely different from what Juanma shows in his > crashes, FWIW. > > > ntdll.dll!RtlDeNormalizeProcessParams() + 0x5a4 bytes > > [Frames below may be incorrect and/or missing, no symbols loaded for > > ntdll.dll] > > ntdll.dll!RtlDeNormalizeProcessParams() + 0x4cb bytes > > > emacs.exe!setitimer(int which, itimerval * value, itimerval * ovalue) > > Line 642 C > > emacs.exe!set_alarm() Line 326 C > > emacs.exe!do_pending_atimers() Line 397 C > > emacs.exe!totally_unblock_input() Line 7168 C > > emacs.exe!terminate_due_to_signal(int sig, int backtrace_limit) Line 297 > > C > > emacs.exe!deliver_fatal_thread_signal(int sig) Line 1570 + 0x12 bytes C > > msvcr100.dll!_XcptFilter() + 0x1ad bytes > > emacs.exe!__tmainCRTStartup$filt$0() Line 572 + 0x16 bytes C > > msvcr100.dll!__C_specific_handler() + 0x97 bytes > > ntdll.dll!RtlDecodePointer() + 0xbd bytes > > ntdll.dll!RtlUnwindEx() + 0xbbf bytes > > ntdll.dll!KiUserExceptionDispatcher() + 0x2e bytes > > ntdll.dll!RtlDeNormalizeProcessParams() + 0x5a4 bytes > > ntdll.dll!RtlDeNormalizeProcessParams() + 0x4cb bytes > > emacs.exe!setitimer(int which, itimerval * value, itimerval * ovalue) > > Line 642 C > > emacs.exe!set_alarm() Line 326 C > > IIUC, setitimer is being called recursively here, is that right? It > looks like some exception happened on line 642 of w32proc.c, that > exception got caught by the (SIGSEGV, I presume) signal handler, and > terminate_due_to_signal was called, which again called setitimer > through totally_unblock_input. setitimer is certainly not ready to be > called recursively, and that recursion happens inside a critical > section, which is even worse. > > Fabrice, can you see what is wrong with the first call to setitimer? > What kind of exception is that, and why does it happen? > > Anyway, this all happens when Emacs exits: > > > emacs.exe!do_pending_atimers() Line 397 C > > emacs.exe!unblock_input() Line 7159 C > > emacs.exe!check_glyph_memory() Line 2335 C > > emacs.exe!Fkill_emacs(__int64 arg) Line 1832 + 0x8a bytes C > > emacs.exe!Ffuncall(__int64 nargs, __int64 * args) Line 2773 C > > So it's probably some problem with shutting down Emacs, I guess some > cleanup code I added needs some work. Fabrice, can you see if the > problem goes away if you comment out the 3 lines in term_timers that > delete the critical sections? I think I fixed this in trunk revision 110318. The problem was that the call to term_ntproc, as part of shutting down Emacs, deleted the critical sections used by the timer threads and by setitimer, so any call to setitimer after that would use an invalid critical section object. I now make sure any calls to setitimer after deleting the critical sections will return immediately without doing anything. Juanma, please see if your crashes still persist. I don't expect them to disappear, but who knows...