Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* RFC: fix latent bug in syms_from_objfile_1
@ 2013-03-20 18:23 Tom Tromey
  2013-03-20 19:06 ` Jan Kratochvil
  0 siblings, 1 reply; 7+ messages in thread
From: Tom Tromey @ 2013-03-20 18:23 UTC (permalink / raw)
  To: gdb-patches

I recently upgraded to Fedora 18.  I randomly see this from gdb:

    warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffd000

I tracked this warning down to a buglet in syms_from_objfile_1, which
references addrs->other[0] without first checking addrs->num_sections.

This patch fixes the problem.

Built and regtested on x86-64 Fedora 18.
This actually improves the test results for me by removing a number of
bogus FAILs caused when the warning is emitted.

Any comments?

Tom

2013-03-20  Tom Tromey  <tromey@redhat.com>

	* symfile.c (syms_from_objfile_1): Check num_sections before
	calling addr_info_make_relative.

Index: symfile.c
===================================================================
RCS file: /cvs/src/src/gdb/symfile.c,v
retrieving revision 1.367
diff -u -r1.367 symfile.c
--- symfile.c	14 Mar 2013 20:26:19 -0000	1.367
+++ symfile.c	20 Mar 2013 18:19:42 -0000
@@ -997,7 +997,7 @@
 
      We no longer warn if the lowest section is not a text segment (as
      happens for the PA64 port.  */
-  if (addrs && addrs->other[0].name)
+  if (addrs && addrs->num_sections > 0 && addrs->other[0].name)
     addr_info_make_relative (addrs, objfile->obfd);
 
   /* Initialize symbol reading routines for this objfile, allow complaints to


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

end of thread, other threads:[~2013-03-21 16:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-20 18:23 RFC: fix latent bug in syms_from_objfile_1 Tom Tromey
2013-03-20 19:06 ` Jan Kratochvil
2013-03-20 19:53   ` Tom Tromey
2013-03-21 14:41     ` Jan Kratochvil
2013-03-21 15:36       ` Tom Tromey
2013-03-21 16:08         ` Jan Kratochvil
2013-03-21 17:39           ` Tom Tromey

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