platform_bionic/libc/malloc_debug
Christopher Ferris d0919623a2 Fix race in malloc debug option free_track.
The free track mechanism could fail if, at the same time a free occurs,
another thread is trying to free and verify the same allocation. This
doesn't work if the freed allocation is added to the list and we still
do work on it. The fix is to only add to the free list when we are done
with the allocation.

Also fix a problem where the usable size is computed incorrectly because
two of the arguments where reversed.

In addition, add a check that the allocation being verified has the correct
tag before trying to check the body of the allocation.

Add a test to catch the original failure.

Add a test for the tag being different.

Bug: 27601650
Change-Id: Ie9200677d066255b8e668a48422f23f909f4ddee
2016-03-16 17:38:08 -07:00
..
tests Fix race in malloc debug option free_track. 2016-03-16 17:38:08 -07:00
Android.mk Fix incorrect size of array. 2016-02-19 18:13:29 -08:00
backtrace.cpp malloc_debug: reread /proc/pid/maps when entry is missing 2016-02-18 16:09:17 -08:00
backtrace.h Add backtrace_string and export to libmemunreachable 2016-02-18 16:09:17 -08:00
BacktraceData.cpp Fix the default alignment of the allocations. 2016-02-12 17:30:30 -08:00
BacktraceData.h Add better free tracking. 2016-01-29 15:19:22 -08:00
Config.cpp Fix problem where unknown option is not an error. 2016-03-14 15:34:22 -07:00
Config.h Fix the default alignment of the allocations. 2016-02-12 17:30:30 -08:00
debug_disable.cpp Malloc debug rewrite. 2016-01-25 10:54:21 -08:00
debug_disable.h Malloc debug rewrite. 2016-01-25 10:54:21 -08:00
debug_log.h Add backtrace_string and export to libmemunreachable 2016-02-18 16:09:17 -08:00
DebugData.cpp Merge "malloc_debug: reset TrackData mutex after fork" 2016-02-17 20:38:02 +00:00
DebugData.h malloc_debug: reset TrackData mutex after fork 2016-02-12 16:41:14 -08:00
exported32.map Export malloc_backtrace 2016-02-18 16:09:16 -08:00
exported64.map Export malloc_backtrace 2016-02-18 16:09:16 -08:00
FreeTrackData.cpp Fix race in malloc debug option free_track. 2016-03-16 17:38:08 -07:00
FreeTrackData.h Add better free tracking. 2016-01-29 15:19:22 -08:00
GuardData.cpp Fix the default alignment of the allocations. 2016-02-12 17:30:30 -08:00
GuardData.h Malloc debug rewrite. 2016-01-25 10:54:21 -08:00
malloc_debug.cpp Fix race in malloc debug option free_track. 2016-03-16 17:38:08 -07:00
malloc_debug.h Fix the default alignment of the allocations. 2016-02-12 17:30:30 -08:00
MapData.cpp Fix incorrect size of array. 2016-02-19 18:13:29 -08:00
MapData.h malloc_debug: reread /proc/pid/maps when entry is missing 2016-02-18 16:09:17 -08:00
TrackData.cpp Export malloc_iterate and friends 2016-02-18 15:05:38 -08:00
TrackData.h Export malloc_iterate and friends 2016-02-18 15:05:38 -08:00