-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Unhandled mmap for a region without protection flags (PROT_READ | PROT_WRITE
)
#8
Comments
I isolated that deeper a bit (a single rayon thread is sufficient) for the demonstration:
That's what I get if I add info message also for Let's compare it with strace:
(Note the output comes from 2 runs of the application, but the symptoms are the same). What happens: after the stack is created for the thread, mmap for 128MiB happens followed by unmmap of ~64MiB. The problem is MEVI can't get the mmap: Any idea what can happen? |
Got it! Oh, it's smart:
So it first calls |
PROT_READ | PROT_WRITE
)
glibc implementation proves my theory: https://github.com/bminor/glibc/blob/master/malloc/arena.c#L404-L441 |
That makes sense to me! Are you up for writing a PR for this? I don't have a lot of time to look at mevi right now but I'd happily review something. |
Newly created heap (alloc_new_heap) is created by glibc without any protection flags and they are adjusted by `mprotect` once the `mmap` succeeds: https://github.com/bminor/glibc/blob/master/malloc/arena.c#L404-L441 Fixes: fasterthanlime#8
Sure, I've just created a pull request for it. |
Hi! It's me again ;) Well, it's been a couple of weeks since I've been struggling with finding out why is my Rust debuginfod consuming an unexpected amount of resident memory (even after
malloc_trim
) and I thought your tool might help me. The project is not so complex, but it does a multithreaded inspection of RPM files.For my demo test-case I get to something like:
So my app consumes ~100MiB, while MEVI reports only < 1MiB which is my expected output:
Full MEVI log:
mevi-log.txt
Looking closer to
pmap
, there are really ranges where there are tens of mebibytes mapped:Again, I know the tool is just a hobby project, but if you are interested, I can debug the problem. But any hint would be appreciated.
Thanks!
The text was updated successfully, but these errors were encountered: