Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profiler aborts on certain combination of mmap flags #125

Open
sn-suhailm opened this issue Oct 5, 2024 · 0 comments
Open

Profiler aborts on certain combination of mmap flags #125

sn-suhailm opened this issue Oct 5, 2024 · 0 comments

Comments

@sn-suhailm
Copy link

sn-suhailm commented Oct 5, 2024

Loading the profiler with LD_PRELOAD causes one of our tests to abort.

gdb points to this being the line at which we abort:

libc::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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant