This is the mail archive of the gdb-patches@sourceware.org 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]

Re: valgrind warnings current mainline


>>>>> "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


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