diff options
author | Florian Mayer <fmayer@google.com> | 2020-03-02 18:25:46 -0800 |
---|---|---|
committer | Florian Mayer <fmayer@google.com> | 2020-03-11 10:21:27 -0700 |
commit | fdd5eb1977712ee8a3bacde25a6d16efa7e6b452 (patch) | |
tree | 4b64b0847b0474d71effc5457a06aa3b5a36af70 /libc/malloc_debug/tests/malloc_debug_system_tests.cpp | |
parent | 93517d1a27db3414e6f3b0b3fc91144903837329 (diff) |
Add explicit state for heapprofd hooking.
The double hooking is currently controlled by two separate atomic
booleans. In this state, it is very hard to guard against very subtle
race conditions. Adding an explicit enum to encode the state makes it
easier to reason about the behaviour of the program.
Also introduce a MaybeModifyGlobals to consistently guard accesses to
globals. We would sometimes modify them without swapping the
gGlobalsMutating, introducing a window for race with
HandleHeapprofdSignal.
Test: while true; do atest HeapprofdCtsTest; done
Test: flash blueline and manually test profile
Bug: 150741354
Change-Id: I77102b0bd906b8ec2d6806bd43ba6cbf7191e37c
Diffstat (limited to 'libc/malloc_debug/tests/malloc_debug_system_tests.cpp')
0 files changed, 0 insertions, 0 deletions