Skip to content

Profiler aborts on certain combination of mmap flags #125

@sn-suhailm

Description

@sn-suhailm

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions