From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7662 invoked by alias); 21 Mar 2014 17:14:56 -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 7652 invoked by uid 89); 21 Mar 2014 17:14:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 21 Mar 2014 17:14:55 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 8EF0111649A; Fri, 21 Mar 2014 13:14:53 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id e1OXe040CbDy; Fri, 21 Mar 2014 13:14:53 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 663BB11648E; Fri, 21 Mar 2014 13:14:53 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id CC239E09E3; Fri, 21 Mar 2014 10:14:53 -0700 (PDT) Date: Fri, 21 Mar 2014 17:14:00 -0000 From: Joel Brobecker To: Keith Seitz Cc: "gdb-patches@sourceware.org ml" Subject: Re: [RFA] Fix gdb/15827 (crash w/corrupt DWARF) Message-ID: <20140321171453.GJ4282@adacore.com> References: <532C6D4D.2050705@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <532C6D4D.2050705@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2014-03/txt/msg00533.txt.bz2 Hi Keith, > ChangeLog > 2014-03-20 Keith Seitz > > PR gdb/15827 > * dwarf2read.c (skip_one_die): Check that all relative-offset > sibling DIEs fall within range of the current reader's buffer. > (read_partial_die): Likewise. > > testsuite/ChangeLog > 2014-03-20 Keith Seitz > > PR gdb/15827 > * gdb.dwarf2/corrupt.c: New file. > * gdb.dwarf2/corrupt.exp: New file. LGTM! Just one tiny nit... > +/* Dummy main function. */ > + > +int > +main() Use "(void)" instead of "()". There was a recent policy clarification regarding the CS to be using with testcases, and basically we decided to try to follow the GCS as much as we reasonably could. > +} > + > +# If we get here and gdb hasn't crashed, the tests pass. > +pass "corrupt DWARF" That's just me but I usually do a "print 1" test, just to make sure that even if the testing framework did not detect the GDB process dying, the "print 1" test definitely will. Not important on most, if not all platforms, but ISTR some odd platforms where this helped. That's just a suggestion, you don't have to follow it. -- Joel