From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8710 invoked by alias); 23 Apr 2010 19:51:04 -0000 Received: (qmail 8689 invoked by uid 22791); 23 Apr 2010 19:51:02 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD 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, 23 Apr 2010 19:50:58 +0000 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3NJou5b027398 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 23 Apr 2010 15:50:56 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o3NJoumq010760; Fri, 23 Apr 2010 15:50:56 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o3NJotWZ026531; Fri, 23 Apr 2010 15:50:55 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id CC03737849C; Fri, 23 Apr 2010 13:50:54 -0600 (MDT) From: Tom Tromey To: Jan Kratochvil Cc: gdb-patches@sourceware.org Subject: Re: [patch] Fix dwarf2read to crash again References: <20100421091303.GA19378@host0.dyn.jankratochvil.net> Reply-To: tromey@redhat.com Date: Fri, 23 Apr 2010 19:51:00 -0000 In-Reply-To: <20100421091303.GA19378@host0.dyn.jankratochvil.net> (Jan Kratochvil's message of "Wed, 21 Apr 2010 11:13:03 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2010-04/txt/msg00812.txt.bz2 >>>>> "Jan" == Jan Kratochvil writes: Jan> Therefore the patch of mine [readerror] turned CRASH->FAIL in some Jan> cases. The FAIL case is difficult to understand and occurs only in Jan> very rare C++ cases (one can -readnow libwebkit.so) so it could Jan> hide for a long time the [delay] bug confusing C++ debugging. It took me a while to really understand this rationale, but I get it now. For us as gdb developers, a crash is preferable because it is simpler to notice. I think, however, that the opposite is true for users. I was talking with Graydon recently about a different GDB dwarf reader bug he had run into: if tag_type_to_type fails, then an entire objfile's worth of debuginfo can be dropped, leading to weird behavior. This is pretty unfriendly when the type DIE in question is in the vendor range. My conclusion from these cases is that gdb ought to fail gracefully. I suspect we should even go so far as to wrap process_die (or possibly some more appropriate function) in a TRY_CATCH and skip DIEs that confuse gdb. For the testing case, I think the best thing would be to add a complaint anywhere we encounter invalid DWARF. Then, we can enable complaints when testing -- either in the GDB test suite or whatever other QA anybody does. On the QA topic: the particular bug in question was found in a deployed Fedora system. We've been discussing an automated debuginfo smoke test, consisting of running "gdb -readnow" on all the debuginfo in the distro. The above is why I think this patch should no go in as-is. I am interested in reactions to the above. Tom