summaryrefslogtreecommitdiff
path: root/libc/malloc_debug/malloc_debug.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 15:18:53 -0800
commit8768694da7188b50f16f61ad7049eedcb91271e4 (patch)
treeafd36eb2bacf12ba8f5d083ef1cd306a483ac8e9 /libc/malloc_debug/malloc_debug.cpp
parent43dc5784ca9658dc7181bed4ad9385b6844e7968 (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 Merged-In: Ia85ad619a0d5e3f558136d84c34dbada4e8b845d
Diffstat (limited to 'libc/malloc_debug/malloc_debug.cpp')
0 files changed, 0 insertions, 0 deletions