This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: valgrind warnings current mainline
- From: Tom Tromey <tromey at redhat dot com>
- To: Pedro Alves <pedro at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 20 May 2011 11:50:42 -0600
- Subject: Re: valgrind warnings current mainline
- References: <201105201603.58064.pedro@codesourcery.com>
>>>>> "Pedro" == Pedro Alves <pedro@codesourcery.com> writes:
Pedro> I'm seeing a bunch of valgrind warnings on current mainline,
Pedro> around symbols names. Known issue?
I don't know if it is known or not but I looked.
Pedro> ==11498== at 0x56A522: symbol_set_names (symtab.c:626)
Pedro> ==11498== by 0x459624: prim_record_minimal_symbol_full (minsyms.c:904)
Pedro> ==11498== by 0x51668C: record_minimal_symbol (elfread.c:204)
Pedro> ==11498== by 0x517459: elf_rel_plt_read (elfread.c:679)
Basically, this code in symbol_set_names is bogus:
else if (linkage_name[len] != '\0')
... because linkage_name[len] might be uninitialized.
This is probably harmless; maybe you could construct a test case where
this crashes gdb, but I guess it would be hard.
Maybe changing the code to read `else if (copy_name)' is the right thing
to do.
Alternatively, fixing elf_rel_plt_read to \0-terminate the string would
fix this as well, but I guess by papering over the bug in symbol_set_names.
Tom