From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13874 invoked by alias); 4 Jun 2014 15:57:09 -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 13863 invoked by uid 89); 4 Jun 2014 15:57:08 -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; Wed, 04 Jun 2014 15:57:07 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s54Fv0a1015899 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 4 Jun 2014 11:57:01 -0400 Received: from blade.nx (ovpn-116-110.ams2.redhat.com [10.36.116.110]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s54FuxMI018488; Wed, 4 Jun 2014 11:57:00 -0400 Received: by blade.nx (Postfix, from userid 1000) id 075A026243C; Wed, 4 Jun 2014 16:56:58 +0100 (BST) Date: Wed, 04 Jun 2014 15:57:00 -0000 From: Gary Benson To: Andrew Burgess Cc: Mark Kettenis , gdb-patches@sourceware.org, xdje42@gmail.com, eliz@gnu.org, fw@deneb.enyo.de, palves@redhat.com, tromey@redhat.com Subject: Re: [PATCH 0/2 v3] Demangler crash handler Message-ID: <20140604155658.GA12651@blade.nx> References: <20140604100755.GA7570@blade.nx> <201406041027.s54ARXYL017073@glazunov.sibelius.xs4all.nl> <20140604133413.GA10121@blade.nx> <538F3300.6010700@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <538F3300.6010700@broadcom.com> X-IsSubscribed: yes X-SW-Source: 2014-06/txt/msg00173.txt.bz2 Andrew Burgess wrote: > On 04/06/2014 2:34 PM, Gary Benson wrote: > > Mark Kettenis wrote: > > > I still very much agree with Pedro; this should not be necessary. > > > > "Should" is the operative word here. It *should* not be necessary > > because the demangler *should* never crash. But this isn't utopia. > > The demangler is code, and code has bugs. People make mistakes. > > Things are valid now that may not be valid in the future. And GDB > > should not just crash if some symbol in the inferior isn't handled > > or doesn't make sense or whatever. > > By this logic should / would we not extend the SIGSEGV handler to > cover all gdb code? I'm not suggesting this. > I'm just not sure why the demangler should get special treatment. It's a combination of the severity of the impact (bugs cause GDB to dump core on startup, with no reasonable workaround) and the fact that the demangler is unusually recoverable (it allocates no heap, uses no resources, and has no global state: you can peel back the stack and carry on*). A lesser issue is that bugs are easily reproducible when you have the offending symbol. I see no reason why users should be inconvenienced (by not being able to use GDB) and why developers should do extra work (digging symbols out of core dumps) when a small piece of code can mitigate the impact on the user and do the legwork for the developer, all without losing performance or consuming resources. Thanks, Gary -- * I'm aware that memory can be corrupted before the segmentation fault is triggered, meaning GDB *might* subsequently crash. My position is that "might crash later" is better than "definitely crashing now".