From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18687 invoked by alias); 5 Jun 2014 13:01:53 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 18672 invoked by uid 89); 5 Jun 2014 13:01:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 05 Jun 2014 13:01:51 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s55D1ggo021880 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 5 Jun 2014 09:01:43 -0400 Received: from blade.nx (ovpn-116-110.ams2.redhat.com [10.36.116.110]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s55D1fUG010418; Thu, 5 Jun 2014 09:01:42 -0400 Received: by blade.nx (Postfix, from userid 1000) id 0FC7926243D; Thu, 5 Jun 2014 14:01:40 +0100 (BST) Date: Thu, 05 Jun 2014 13:01:00 -0000 From: Gary Benson To: gdb-patches@sourceware.org Cc: Andrew Burgess , Doug Evans , Eli Zaretskii , Florian Weimer , Mark Kettenis , Pedro Alves , Tom Tromey Subject: [PATCH 0/3 v4] Demangler crash handler Message-ID: <20140605130140.GA20572@blade.nx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-IsSubscribed: yes X-SW-Source: 2014-06/txt/msg00251.txt.bz2 Hi all, This patch is an updated version of the demangler crash handler I posted yesterday. The main changes from the previous version are: 1) All #ifdef SIGSEGV conditionals have been removed. 2) If the user set "ulimit -c 0" then no core file will be created and a warning will be printed. This mirrors what internal_error and internal_warning currently do. 3) A separate signal stack is created for the SIGSEGV handler to allow it to function correctly if the normal process stack overflows. This signal stack is currently only used by the SIGSEGV handler--all other signal handlers use the normal process stack as before. Doug requested that I change the patch to emit warnings for every demangler crash, not just the first. I've not done this, my reason being that subsequent failures could have been caused by the first, by memory corruption or some leftover state: they could be bogus, and could lead to us chasing bugs that don't exist. I prefer this way, but I'm not hung up on it and if it's a blocker for Doug or anyone else I will add the extra warnings. I've split the patches as follows: 1/3 - adds a new category of internal problem for demangler warnings. This patch is unchanged from the previous version (PATCH 1/2 v3): https://sourceware.org/ml/gdb-patches/2014-06/msg00142.html 2/3 - refactors and exposes the core-dumping functions in utils.c. This is a completely new patch. 3/3 - the crash catcher itself. This patch differs from the previous version by the removal of the #ifdef SIGSEGV conditionals, the addition of a check to see if a core dump should be performed, and the creation of a separate stack to allow the signal handler to function when the normal stack is exhausted. I would push all three patches as one commit. The news file entries for the commit would be: * New options maint set catch-demangler-crashes (on|off) maint show catch-demangler-crashes Control whether GDB should attempt to catch crashes in the symbol name demangler. maint set demangler-warning quit (yes|no|ask) maint show demangler-warning quit Control whether GDB should exit if it catches a crash in the symbol name demangler. * New commands maint demangler-warning Cause GDB to call the internal function demangler_warning and hence behave as though an internal error in the demangler has been detected. Is this ok to commit? Thanks, Gary -- http://gbenson.net/