This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug malloc/15321] malloc/free can't give the memory back to kernel when main_arena is discontinous
- From: "fweimer at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Thu, 27 Apr 2017 14:03:10 +0000
- Subject: [Bug malloc/15321] malloc/free can't give the memory back to kernel when main_arena is discontinous
- Auto-submitted: auto-generated
- References: <bug-15321-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=15321
--- Comment #10 from Florian Weimer <fweimer at redhat dot com> ---
(In reply to Carlos O'Donell from comment #9)
> (In reply to ma.jiang from comment #8)
> > void *tt = mmap(mem[i-1]+1024*1024, 1024*213, PROT_READ |
> > PROT_WRITE,MAP_SHARED | MAP_ANONYMOUS, -1, 0);
>
> This corrupts the arena and the chunk metadata by writing zero (if the
> kernel honours the address hint).
If it does, it's a kernel bug. If the break point overlaps with the mapping,
the mmap call must fail because MAP_FIXED hasn't been specified.
Even without the hint, something like that could happen under virtual address
space pressure.
I think this needs further analysis.
--
You are receiving this mail because:
You are on the CC list for the bug.