This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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;



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]