c531ed6648
A race condition occurs when one thread takes more than a second to get scheduled to handle the signal we send to ask it to dump its stack. When this happens, the main thread will continue on, close the fd, and then ask the next thread to dump, but the slow thread will then wake up and try to write to the new thread's fd, or trigger an assertion in __linker_enable_fallback_allocator. Do a few things to make this less bad: - encode both target tid and fd in the shared atomic, so that we know who each fd is for - switch __linker_enable_fallback_allocator to return success instead of aborting, and bail out if it's already in use - write to the output fd right when we get to it, instead of doing it whenever the dumping code decides to, to reduce the likelihood that the timeout expires Test: debuggerd_test Change-Id: Ife0f6dae388b601e7f991605f14d7a0274013f6b |
||
---|---|---|
.. | ||
client | ||
common/include | ||
crasher | ||
handler | ||
include/debuggerd | ||
libdebuggerd | ||
seccomp_policy | ||
tombstoned | ||
.clang-format | ||
Android.bp | ||
Android.mk | ||
crash_dump.cpp | ||
debuggerd.cpp | ||
debuggerd_benchmark.cpp | ||
debuggerd_test.cpp | ||
MODULE_LICENSE_APACHE2 | ||
OWNERS | ||
protocol.h | ||
util.cpp | ||
util.h |