public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* Problems in dwfl_segment_report_module
@ 2017-05-22 22:57 Ulf Hermann
  0 siblings, 0 replies; only message in thread
From: Ulf Hermann @ 2017-05-22 22:57 UTC (permalink / raw)
  To: elfutils-devel

Hi,

In dwfl_segment_report_module.c:657ff we have this heuristic to determine if an elf is invalid:

      if ((module_end > module->start && module_start < module->end)
	    || dyn_vaddr == module->l_ld)
	  {
	    if (module->elf != NULL
	        && invalid_elf (module->elf, module->disk_file_has_build_id,
				build_id, build_id_len))
	      {
		elf_end (module->elf);
		close (module->fd);
		module->elf = NULL;
		[...]

As far as I understand, module_start, module_end, module->start and module->end are the runtime mmap'd positions of the loaded elf file. The problem with this is that multiple elfs can be mmap'd on top of one another. That frequently happens. For example ld.so is always overwritten at some point. If we retrieve the positions of the overwritten mmaps from e.g. a core file, then we can attribute them to the wrong elf file, find that the build ID is "wrong" and discard the elf. This makes the run-backtrace-native-core.sh test fail for me in sometimes. linux-vdso.so is apparently mapped underneath backtrace-child and consequently backtrace-child gets discarded. Then we cannot unwind anything.

regards,
Ulf

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-05-10 17:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-22 22:57 Problems in dwfl_segment_report_module Ulf Hermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).