summaryrefslogtreecommitdiff
path: root/libc/malloc_debug/tests/malloc_debug_system_tests.cpp
diff options
context:
space:
mode:
authorMitch Phillips <mitchp@google.com>2020-02-28 07:37:19 -0800
committerMitch Phillips <mitchp@google.com>2020-02-28 08:33:27 -0800
commit449c26a47de28aa59a33137dade311d09719caf3 (patch)
tree73c96c2195d4d62dc068a68047b527371b72bd07 /libc/malloc_debug/tests/malloc_debug_system_tests.cpp
parent6cf75230d9feae269a823c7dd43433baf1b71465 (diff)
[GWP-ASan] [heapprofd] Fix infinite recursion between malloc-racing threads.
When the heapprofd lazy-initialization dispatch table is installed, two threads can call malloc() at the same time. One will do the lazy-initialization, the other will fail the atomic_exchange of gHeapprofdInitHookInstalled and go to system malloc. The system malloc still contains the lazy-init malloc, and will recurse. Fix it so the second thread goes directly to the previous dispatch table, or to the system allocator directly (instead of through libc malloc()). Bug: 150085813 Test: atest perfetto_integrationtests Test: TracedPerfCtsTest.SystemWideDebuggableApp on cuttlefish x86. Change-Id: Ia85ad619a0d5e3f558136d84c34dbada4e8b845d
Diffstat (limited to 'libc/malloc_debug/tests/malloc_debug_system_tests.cpp')
0 files changed, 0 insertions, 0 deletions