This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Fix gdb/15827 (crash w/corrupt DWARF)
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: "gdb-patches at sourceware dot org ml" <gdb-patches at sourceware dot org>
- Date: Fri, 21 Mar 2014 10:14:53 -0700
- Subject: Re: [RFA] Fix gdb/15827 (crash w/corrupt DWARF)
- Authentication-results: sourceware.org; auth=none
- References: <532C6D4D dot 2050705 at redhat dot com>
Hi Keith,
> ChangeLog
> 2014-03-20 Keith Seitz <keiths@redhat.com>
>
> 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 <keiths@redhat.com>
>
> 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