vppinfra: prevent dlmalloc from allocating memory via mmap_alloc() 86/16186/2
authorAndrew Yourtchenko <ayourtch@gmail.com>
Mon, 26 Nov 2018 14:40:20 +0000 (15:40 +0100)
committerDave Barach <openvpp@barachs.net>
Mon, 26 Nov 2018 17:09:01 +0000 (17:09 +0000)
commit37f44563637d2fa2fe454fd8c100958ec9b7a754
tree4173b7d133a0477efb583eb0e846e938f1ab816c
parent2af0e3a74c40e5df946813324574ccc18feb4761
vppinfra: prevent dlmalloc from allocating memory via mmap_alloc()

If the heap does not have enough space to satisfy allocation
request, the allocator calls sys_alloc(). There, if the request
is bigger than mparams.mmap_threshold, the mmap_alloc() is called
to allocate memory via a direct mmap call.
The resulting allocated memory is properly recognized by
clib_mem_is_heap_object() only for the first such request.
Subsequent requests overwrite the tracking data, resulting
in previously "valid" addresses become invalid, as seen
by clib_mem_is_heap_object(). The result is a misleading
behavior which masks other issues.

This is a temporary change to avoid the affected codepath
until there is a proper fix to track the directly mmap-allocated
memory.

Change-Id: I4137f91b5196d4503c40cf8ecc2f71554bc8f858
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
src/vppinfra/dlmalloc.h