From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29467 invoked by alias); 18 Jan 2013 16:09:15 -0000 Received: (qmail 29457 invoked by uid 22791); 18 Jan 2013 16:09:14 -0000 X-SWARE-Spam-Status: No, hits=-6.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 18 Jan 2013 16:09:04 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0IG90l9006833 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 18 Jan 2013 11:09:01 -0500 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r0IG8w37018921 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 18 Jan 2013 11:08:59 -0500 From: Tom Tromey To: Pedro Alves Cc: Pierre Muller , gdb-patches@sourceware.org Subject: Re: catch SIGSEGV in the demangler References: <87fw23o70u.fsf@fleche.redhat.com> <19236.9665638127$1358374641@news.gmane.org> <87622vd2vd.fsf@fleche.redhat.com> <50F93081.1090905@redhat.com> <87pq12a62h.fsf@fleche.redhat.com> <50F96D16.3030502@redhat.com> Date: Fri, 18 Jan 2013 16:09:00 -0000 In-Reply-To: <50F96D16.3030502@redhat.com> (Pedro Alves's message of "Fri, 18 Jan 2013 15:41:10 +0000") Message-ID: <87y5fq8odh.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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 X-SW-Source: 2013-01/txt/msg00438.txt.bz2 >>>>> "Pedro" == Pedro Alves writes: Tom> Well, ok, the stack trace is weird, since in this scenario we aren't Tom> actually calling longjmp. I'm not sure what is going on there. Pedro> Did you mean to catch the SIGSEGV caused by the raise? Pedro> That seems like what you'd get if !in_demangler (you got to Pedro> throw_exception)? You got SIGSEGV set to nopass by mistake Pedro> perhaps, caught the raise(SIGSEGV), and continued, which Pedro> suppressed the signal, and moved along into the throw? I started gdb and kill -SEGV'd it from another terminal. Then I made the stack trace from the core file. Ah. SEGV is blocked in the handler. So the raise queues it and then it falls through to throw_exception. Oops. The fix is to just return. Tom> If returning actually works everywhere, I am fine with doing that. Pedro> I think it does, but we can always do a raise where it doesn't work. Ok. I'm trying it out. I'm primarily interested in opinions on whether this is even a good idea. I'm on the fence about it myself. It's far from clear that it is safe to call throw_exception from a signal handler. Tom