malloc: New test to check malloc alternate path using memory obstruction
The test aims to ensure that malloc uses the alternate path to allocate memory when sbrk() or brk() fails.To achieve this, the test first creates an obstruction at current program break, tests that obstruction with a failing sbrk(), then checks if malloc is still returning a valid ptr thus inferring that malloc() used mmap() instead of brk() or sbrk() to allocate the memory. Reviewed-by:Arjun Shankar <arjun@redhat.com> Reviewed-by:
Zack Weinberg <zack@owlfolio.org>
Loading