This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
fix for crash in dwarf2read.c
- From: Peter Niemayer <niemayer at isg dot de>
- To: gdb-patches at sources dot redhat dot com
- Date: Sat, 23 Oct 2004 02:05:43 +0200
- Subject: fix for crash in dwarf2read.c
Hi,
today gdb 6.2.1 crashed when I tried to debug a 32GB core file
on a x86_64 box.
I could fix the problem by applying the following patch - but since
I don't know why "file" exceeded the number of filename-entries
in "lh", somebody with more knowledge of gdb internals should
have a look at this...
Regards,
Peter Niemayer
--- dwarf2read.c 2004-07-06 21:29:30.000000000 +0200
+++ dwarf2read.c.new 2004-10-22 15:54:07.000000000 +0200
@@ -8581,10 +8581,17 @@
mac_ptr += bytes_read;
file = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
mac_ptr += bytes_read;
+
+ if (file > lh->num_file_names) {
+ complaint (&symfile_complaints,
+ "file number in DW_MACINFO_start_file too big");
+ } else {
+ current_file = macro_start_file (file, line,
+ current_file, comp_dir,
+ lh, cu->objfile);
+ }
+
- current_file = macro_start_file (file, line,
- current_file, comp_dir,
- lh, cu->objfile);
}
break;