]> git.ipfire.org Git - thirdparty/glibc.git/commit
malloc: New test to check malloc alternate path using memory obstruction
authorsayan paul <saypaul@redhat.com>
Wed, 29 May 2024 10:01:04 +0000 (15:31 +0530)
committerArjun Shankar <arjun@redhat.com>
Tue, 4 Jun 2024 16:00:29 +0000 (18:00 +0200)
commit127fc56152347d73cb7c1c283e60e1cb1f15e9f9
tree4b131058040f3a582c83c05fdb7eda4cf5ddb296
parent2a9943b4a03b6bce7c2b1b047592eee38ab74fab
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>
malloc/Makefile
malloc/tst-malloc-alternate-path.c [new file with mode: 0644]