On Wed, Jan 24, 2018 at 11:07 AM, Rick Payne <ri...@rossfell.co.uk> wrote:

> Hi,
>
> On 23/01/18 20:16, Nadav Har'El wrote:
>
>> I don't have any bright ideas, but just a few small comments below,
>> hopefully (?) they will help something...
>>
>
> Appreciated...
>
> This writes in "addr", which seems a reasonable address (doesn't seem like
>> junk).
>> In object::resolve_pltgot() you can see the addr is _base + slot.r_offset
>> maybe you
>> can print them and see with "nm"/"readelf" of the object being loaded if
>> this offset
>> address makes sense (in the PLT section)?
>>
>
> So that made sense as far as I can see:
>
> (gdb)
> #9  0x0000000000492c7b in elf::object::arch_relocate_jump_slot (
>     this=0xffffa0010327b400, sym=1, addr=0x10000aa0fe28, addend=0)
>     at arch/x64/arch-elf.cc:109
> 109         *static_cast<void**>(addr) = symsym.relocated_addr();
> (gdb) p symsym.obj._base
> $1 = (void *) 0x0
> (gdb) up
> #10 0x00000000003fdfd7 in elf::object::resolve_pltgot (
>     this=0xffffa0010327b400, index=0) at core/elf.cc:692
> 692         if (!arch_relocate_jump_slot(sym, addr, slot.r_addend)) {
> (gdb) p slot.r_offset
> $2 = 2162216
> (gdb) p/x slot.r_offset
> $3 = 0x20fe28
> (gdb)
>
> $ readelf -a _build/default/rel/dbgp_webapi/erts-9.0.5/bin/erlexec | grep
> 20fe28
> 00000020fe28  000100000007 R_X86_64_JUMP_SLO 0000000000000000
> getenv@GLIBC_2.2.5 + 0
>

This all seems reasonable.
Maybe we somehow got the PLT becoming read-only, so we are getting a
pagefault trying to write to it?
Can you please try in gdb "osv mmap" and look at the mapping which includes
the faulting address (0x10000aa0fe28), is it read-write or read-only?

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to