From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: C backtraces for Emacs Date: Thu, 23 Aug 2012 19:55:10 +0300 Message-ID: <83a9xla6q9.fsf@gnu.org> References: <502EDAF3.6030005@cs.ucla.edu> <5034A54F.6020006@cs.ucla.edu> <83628ac3vd.fsf@gnu.org> <50357BE8.8040302@dancol.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1345740983 8382 80.91.229.3 (23 Aug 2012 16:56:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 23 Aug 2012 16:56:23 +0000 (UTC) Cc: lekktu@gmail.com, eggert@cs.ucla.edu, monnier@IRO.UMontreal.CA, emacs-devel@gnu.org To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 23 18:56:23 2012 Return-path: Envelope-to: ged-emacs-devel@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 1T4ahj-0006kr-49 for ged-emacs-devel@m.gmane.org; Thu, 23 Aug 2012 18:56:23 +0200 Original-Received: from localhost ([::1]:40613 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4ahh-0007EY-6i for ged-emacs-devel@m.gmane.org; Thu, 23 Aug 2012 12:56:21 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51400) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4ahe-0007EC-2t for emacs-devel@gnu.org; Thu, 23 Aug 2012 12:56:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T4ahc-0003mD-T0 for emacs-devel@gnu.org; Thu, 23 Aug 2012 12:56:18 -0400 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:62092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4ahc-0003lS-L5 for emacs-devel@gnu.org; Thu, 23 Aug 2012 12:56:16 -0400 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0M9700900W71JA00@a-mtaout23.012.net.il> for emacs-devel@gnu.org; Thu, 23 Aug 2012 19:55:02 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M970098HWBPDZ70@a-mtaout23.012.net.il>; Thu, 23 Aug 2012 19:55:02 +0300 (IDT) In-reply-to: <50357BE8.8040302@dancol.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.175 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:152777 Archived-At: > Date: Wed, 22 Aug 2012 17:40:08 -0700 > From: Daniel Colascione > CC: Paul Eggert , lekktu@gmail.com, > monnier@IRO.UMontreal.CA, emacs-devel@gnu.org > > You can use the StackWalk64 function from dbghelp.dll. Will that work with GCC-compiled programs and DLLs? Isn't dbghelp.dll VC-specific? If it doesn't produce addresses that can be plugged into GDB, then it's not good, because any meaningful debugging after the assertion violation will have to be with GDB. Also, dbghelp.dll seems to need to be installed separately, and MinGW doesn't provide its import library, so we cannot link against it by default. Did I miss something? Anyway, if this is workable, patches to use it are welcome. > By the way: when we assert, we should kill Emacs using RaiseFailFastException. > This function produces a nice WER (Windows Error Reporting) dialog and bypasses > a lot of layers of exception handling machinery that would ordinarily run in > userspace --- that is, with RaiseFailFastException, fewer things can go wrong. > abort() under Windows actually tried to run global destructors, send messages to > loaded DLLs about pending process termination, and a bunch of other things. RFFE > is much more reliable. On systems without RFFE, plain old RaiseException is fine > too, and RaiseException is present on all supported Windows versions. Emacs overrides 'abort' with a custom function that calls our own abort dialog. So I don't think the problems with the standard 'abort' function are relevant to Emacs.