This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils 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: eu-unstrip -n fails to process a coredump


12.11.2009 22:37, Roland McGrath wrote:
>> The bug is in read-ahead logic of dwfl_elf_phdr_memory_callback.  It
>> reads ahead as much of offset-contiguous data as it can, but doesn't
>> take into account whether the data is vaddr-contiguous too.
>> report_r_debug assumes it is.
>
> I am confused.  What's the concrete example where "vaddr-contiguous" means
> something different from "offset-contiguous"?

The following case is in the coredump that I got from Denys Vlasenko:

Headers:
  Type Offset    VirtAddr       PhysAddr FileSiz  MemSiz   Flg Align
  [...]
  LOAD 0x2108000 0x7fa077a00000 0x0      0x300000 0x300000 RW  0x1000
  LOAD 0x2408000 0x7fa077e00000 0x0      0x100000 0x100000 RW  0x1000

These two segments are contiguous wrt. offset:
 >>> hex(0x2108000+0x300000)
'0x2408000'

But not wrt. vaddr:
 >>> hex(0x7fa077a00000+0x300000)
'0x7fa077d00000'

The logic in dwfl_elf_phdr_memory_callback yields a buffer that covers 
several sections with above property.  report_r_debug then does vaddr - 
base_vaddr + buf to get to the point in the buffer that matches given 
vaddr, assuming that vaddrs are contiguous in the buffer.

> When you are working on a temporary branch that didn't get merged,
> it's better not to pollute the permanent history with reverts.
> So just start a fresh branch or use git rebase.

Done.

PM

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