android_bionic/libc/malloc_debug/tests
Christopher Ferris ff88fb0d3a Fix allocations escaping malloc debug.
When using a FILE object for some malloc debug functions, calling
fprintf will trigger an allocation to be put in the object. The problem
is that these allocations were not allocated by the malloc debug
wrapper and they get freed during the fclose as if they are malloc
debug allocation. In most cases, the code will detect the bad pointer
and leak the memory, but it might also cause a crash.

The fix is to avoid using fprintf so that no allocations are made
in the object that survive and need to be freed in the fclose call.

Change the MallocXmlElem.h to use a file decsriptor not a FILE object.

Add new unit and system tests to detect this case.

Bug: 143742907

Test: Ran unit and system tests.
Test: Ran bionic unit tests.
Change-Id: I524392de822a29483aa5be8f14c680e70033eba2
2019-11-06 10:42:42 -08:00
..
backtrace_fake.cpp Add support for using the new unwinder. 2018-05-24 08:44:53 -07:00
backtrace_fake.h Add support for using the new unwinder. 2018-05-24 08:44:53 -07:00
libc_fake.cpp Malloc debug rewrite. 2016-01-25 10:54:21 -08:00
log_fake.cpp Add support for using the new unwinder. 2018-05-24 08:44:53 -07:00
log_fake.h Malloc debug rewrite. 2016-01-25 10:54:21 -08:00
malloc_debug_config_tests.cpp Disable info messages by default for malloc debug. 2019-04-02 10:55:21 -07:00
malloc_debug_system_tests.cpp Fix allocations escaping malloc debug. 2019-11-06 10:42:42 -08:00
malloc_debug_unit_tests.cpp Fix allocations escaping malloc debug. 2019-11-06 10:42:42 -08:00