From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23235 invoked by alias); 9 May 2014 11:20:42 -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 23215 invoked by uid 89); 9 May 2014 11:20:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: glazunov.sibelius.xs4all.nl Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 09 May 2014 11:20:40 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3) with ESMTP id s49BKPSk007294; Fri, 9 May 2014 13:20:25 +0200 (CEST) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3/Submit) id s49BKO1f010622; Fri, 9 May 2014 13:20:24 +0200 (CEST) Date: Fri, 09 May 2014 11:20:00 -0000 Message-Id: <201405091120.s49BKO1f010622@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: gbenson@redhat.com CC: gdb-patches@sourceware.org In-reply-to: <20140509100656.GA4760@blade.nx> (message from Gary Benson on Fri, 9 May 2014 11:06:57 +0100) Subject: Re: [PATCH 0/2] Demangler crash handler References: <20140509100656.GA4760@blade.nx> X-SW-Source: 2014-05/txt/msg00111.txt.bz2 > Date: Fri, 9 May 2014 11:06:57 +0100 > From: Gary Benson > > Hi all, > > A number of bugs have been filed recently because of segmentation > faults in the demangler. While such crashes are a problem for all > demangler consumers, they are particularly nasty for GDB because they > prevent the user from debugging their program at all. > > This patch series arranges for GDB to catch segmentation faults in the > demangler and recover from them gracefully. A warning is printed the > first time a fault occurs. Example sessions with and without these > patches are included below. > > None of the wrapped code uses cleanups, so each caught failure will > leak a small amount of memory. This is undesirable but I think the > benefits here outweigh this drawback. > > Ok to commit? No. It's this skind of duct-tape that will make sure that bugs in the demangler won't get fixed. Apart from removing the incentive to fix the bugs, these SIGSEGV signal handlers make actually fixing the bugs harder as you won't have core dumps. Besides, any signal handler that does more than just setting a flag is probably broken. Did you verify that you only call async-signal-safe functions in the signal handler code path?