Loading the profiler with LD_PRELOAD causes one of our tests to abort.
gdb points to this being the line at which we abort:
Seems like the profiler replaces actual mmap syscalls with multiple for the purpose of assigning a name to the VMA? I'm not sure why this is done but it seems like it doesn't play well with the combinations of flags we're passing in.
Here's the actual mmap syscalls invoked within that function just before it aborts, as captured by strace (i.e the mmap syscalls issued with the profiler enabled):
[pid 700682] mmap(NULL, 1073750016, PROT_NONE, MAP_PRIVATE, 3, 0) = 0x7f4c77c6d000
[pid 700682] mmap(0x7f4c77c6e000, 1073741824, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_FIXED|MAP_ANONYMOUS|MAP_HUGETLB, -1, 0) = -1 EINVAL (Invalid argument)
I think the reason is that the address in the second mmap is not hugepage aligned and so it fails.
Loading the profiler with LD_PRELOAD causes one of our tests to abort.
gdb points to this being the line at which we abort:
bytehound/preload/src/api.rs
Line 884 in f8397e7
Seems like the profiler replaces actual mmap syscalls with multiple for the purpose of assigning a name to the VMA? I'm not sure why this is done but it seems like it doesn't play well with the combinations of flags we're passing in.
Here's the actual mmap syscalls invoked within that function just before it aborts, as captured by strace (i.e the mmap syscalls issued with the profiler enabled):
I think the reason is that the address in the second mmap is not hugepage aligned and so it fails.