On 12/09/2016 10:51 AM, Jessica Hamilton wrote:
So, finally figured out why the page faults are happening...
In my debugging, I've found that gRuntimeLoader->test_executable ends
up pointing to the function from another process/address space. This
is all from debug output I've added in src/system/libroot/os/image.cpp
(and some other debug output in
src/system/runtime_loader/elf.cpp:inject_runtime_loader_api).
Essentially, what happens is we have launch_daemon with the following addresses:
__gRuntimeLoader @ 0x00000210f0eafa60
__gRuntimeLoader->test_executable @ 0x00000210f0ca39d0
Then later on, another process (probably bash in this example):
__gRuntimeLoader @ 0x000000b72af67a60
__gRuntimeLoader->test_executable @ 0x000000b72ad5b9d0
Not sure which process this is at this point, but we have in
__test_executable():
__gRuntimeLoader @ 0x210f0eafa60
__gRuntimeLoader->test_executable @ 0xb72ad5b9d0
And then we get a page fault...
At this point, I'm stumped as to how this is even happening. I don't
know what to even look at; it's not like test_executable (and other
pointers) get explicitly set anywhere; so pretty damn stumped :(