From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20861 invoked by alias); 20 May 2014 17:05:32 -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 20849 invoked by uid 89); 20 May 2014 17:05:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 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; Tue, 20 May 2014 17:05:31 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s4KH5RTh026661 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 20 May 2014 13:05:27 -0400 Received: from barimba (ovpn-113-182.phx2.redhat.com [10.3.113.182]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s4KH5PXJ015586 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Tue, 20 May 2014 13:05:26 -0400 From: Tom Tromey To: Pedro Alves Cc: Florian Weimer , Mark Kettenis , gbenson@redhat.com, gdb-patches@sourceware.org Subject: Re: [PATCH 0/2] Demangler crash handler References: <20140509100656.GA4760@blade.nx> <201405091120.s49BKO1f010622@glazunov.sibelius.xs4all.nl> <87fvkhjqvs.fsf@mid.deneb.enyo.de> <53737737.2030901@redhat.com> Date: Tue, 20 May 2014 17:05:00 -0000 In-Reply-To: <53737737.2030901@redhat.com> (Pedro Alves's message of "Wed, 14 May 2014 15:01:27 +0100") Message-ID: <87ppj8s7my.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2014-05/txt/msg00436.txt.bz2 >>>>> "Pedro" == Pedro Alves writes: Pedro> I have to admit I'm not super keen on using signals for this either. Pedro> For one, not all bugs trigger segmentation faults. That is true, but the goal of the patch is to cheaply improve gdb's behavior in some failure modes, not to solve every problem. I think this is warranted due to known properties of the demangler. First, it is complicated. Second, it is hard to test well. Third, there's been a history of new demangler features being rolled out with insufficient testing, and we can reasonably expect that to continue. Fourth, the bugs in question have a very severe effect on gdb users -- you simply cannot debug -- whereas the effect on other users of the demangler is slight (this is why I think we can expect to see more demangler bugs of a similar nature). Pedro> Then stealing a signal handler always has multi-threading Pedro> considerations. E.g., gdb Python code could well spawn a thread Pedro> that happens to call something that wants its own SIGSEGV Pedro> handler... Signal handlers are per-process, not per-thread. That is true in theory but I think it is unlikely in practice. And, should it happen -- well, the onus is on folks writing extensions not to mess things up. That's the nature of the beast. And, sure, it is messy, particularly if we ever upstream "import gdb", but even so, signals are just fraught and this is not an ordinary enough usage to justify preventing gdb from doing it. Pedro> Then we'd add a demangle_assert macro to the demangler, similar to Pedro> gdb_assert, that calls that hook if the assertion fails. And then Pedro> we could sprinkle the demangler with assertions. Pedro> I think that'd be easy to do, and I'd think it's much cleaner Pedro> and robust. This would be an improvement but it isn't really under consideration. The demangler isn't the most important thing we're working on, and nobody is going to spend the time adding assertions to it. And, even if they did, the crash handler would still useful, just hopefully used somewhat less. This is because bugs happen even when there are many assertions in place. The choice is really between SEGV catching and "somebody else down the road fixes more demangler bugs". Tom