Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch] Fix gdb crash on some missing ELF debug info
@ 2006-06-23 10:37 Jan Kratochvil
  2006-06-23 12:39 ` Daniel Jacobowitz
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Kratochvil @ 2006-06-23 10:37 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 610 bytes --]

Hi,

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=196439

On Fedora Core 5:
	gdb /usr/lib/valgrind/x86-linux/memcheck
	break _start_in_C
	run
segfaults as the file's debug info references location list while no
".debug_loc" section exists there.
	eu-readelf -w /usr/lib/valgrind/x86-linux/memcheck
		DWARF section '.debug_info' at offset 0x14759c:
		...
		 [ 176d4]    subprogram
		...
		             name		  "_start_in_C"
		...
		             frame_base 	  location list [ 116d7]

Trivia complaint on the file coherency, no frame_info debugging available for
such functions.


Regards,
Jan Kratochvil

[-- Attachment #2: gdb-cvs20060623-debug_loc.patch --]
[-- Type: text/plain, Size: 1195 bytes --]

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=196439

Fedora Core 5:
	gdb /usr/lib/valgrind/x86-linux/memcheck
	break _start_in_C
	run
segfault

eu-readelf -w /usr/lib/valgrind/x86-linux/memcheck
	DWARF section '.debug_info' at offset 0x14759c:
	...
	 [ 176d4]    subprogram
	...
	             name                 "_start_in_C"
	...
	             frame_base           location list [ 116d7]
corrupted as no location lists (.debug_loc) exist there at all.


Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.199
diff -u -p -r1.199 dwarf2read.c
--- dwarf2read.c	14 Jun 2006 15:06:35 -0000	1.199
+++ dwarf2read.c	23 Jun 2006 10:28:44 -0000
@@ -9324,7 +9324,9 @@ static void
 dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym,
 			     struct dwarf2_cu *cu)
 {
-  if (attr->form == DW_FORM_data4 || attr->form == DW_FORM_data8)
+  if ((attr->form == DW_FORM_data4 || attr->form == DW_FORM_data8)
+      /* DW_UNSND (attr) != 0 would produce non-zero bogus ->size & ->data */
+      && dwarf2_per_objfile->loc_size)
     {
       struct dwarf2_loclist_baton *baton;
 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-08-26 11:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-23 10:37 [patch] Fix gdb crash on some missing ELF debug info Jan Kratochvil
2006-06-23 12:39 ` Daniel Jacobowitz
2006-06-23 13:08   ` Jan Kratochvil
2006-06-23 13:13     ` Daniel Jacobowitz
2006-07-12 21:15     ` Daniel Jacobowitz
2006-07-20 16:17       ` Joel Brobecker
2006-08-28 20:48       ` [patch] Testcase for missing ELF debug info [Re: [patch] Fix gdb crash on some missing ELF debug info] Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox