3e56442
http://sourceware.org/ml/gdb-patches/2014-02/msg00731.html
3e56442
Subject: [patch] gdb_assert -> complaint for weird DWARF
3e56442
3e56442
3e56442
--6TrnltStXW4iwmi0
3e56442
Content-Type: text/plain; charset=us-ascii
3e56442
Content-Disposition: inline
3e56442
3e56442
Hi,
3e56442
3e56442
PR 16581:
3e56442
	GDB crash on inherit_abstract_dies infinite recursion
3e56442
	https://sourceware.org/bugzilla/show_bug.cgi?id=16581
3e56442
3e56442
fixed crash from an infinite recursion.  But in rare cases the new code can
3e56442
now gdb_assert() due to weird DWARF file.
3e56442
3e56442
I do not yet fully understand why the DWARF is as it is but just GDB should
3e56442
never crash due to invalid DWARF anyway.  The "invalid" DWARF I see only in
3e56442
Fedora GCC build, not in FSF GCC build, more info at:
3e56442
	https://bugzilla.redhat.com/show_bug.cgi?id=1069382
3e56442
	http://people.redhat.com/jkratoch/gcc-debuginfo-4.8.2-7.fc20.x86_64-gnatbind.debug
3e56442
3e56442
3e56442
Thanks,
3e56442
Jan
3e56442
3e56442
--6TrnltStXW4iwmi0
3e56442
Content-Type: text/plain; charset=us-ascii
3e56442
Content-Disposition: inline; filename="complaint.patch"
3e56442
3e56442
gdb/
3e56442
2014-02-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
3e56442
3e56442
	* dwarf2read.c (process_die): Change gdb_assert to complaint.
3e56442
3e56442
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
3e56442
index 3eaa0b1..71f5d34 100644
3e56442
--- a/gdb/dwarf2read.c
3e56442
+++ b/gdb/dwarf2read.c
3e56442
@@ -8029,7 +8029,13 @@ process_die (struct die_info *die, struct dwarf2_cu *cu)
3e56442
   struct cleanup *in_process;
3e56442
 
3e56442
   /* We should only be processing those not already in process.  */
3e56442
-  gdb_assert (!die->in_process);
3e56442
+  if (die->in_process)
3e56442
+    {
3e56442
+      complaint (&symfile_complaints,
3e56442
+		 _("DIE at 0x%x attempted to be processed twice"),
3e56442
+		 die->offset.sect_off);
3e56442
+      return;
3e56442
+    }
3e56442
 
3e56442
   die->in_process = 1;
3e56442
   in_process = make_cleanup (reset_die_in_process,die);
3e56442
3e56442
--6TrnltStXW4iwmi0--
3e56442