9bf7817dd2
When malloc debug is enabled, using libbacktrace to unwind can result in a deadlock. This happens when an unwind of a thread is occuring which triggers a signal to be sent to that thread. If that thread is interrupted while a malloc debug function is executing and owns a lock, that thread is then stuck in the signal handler. Then the original unwinding thread attempts to do an allocation and gets stuck waiting for the same malloc debug lock. This is not a complete deadlock since the unwinder has timeouts, but it results in truncated unwinds that take at least five seconds to complete. Only the backtrace signals needs to be blocked because it is the only known signal that will result in a thread being paused in a signal handler. Also, added a named signal in the reserved signal list for the special bionic backtrace signal. Bug: 150833265 Test: New unit tests pass with fix, fail without fix. Change-Id: If3e41f092ebd40ce62a59ef51d636a91bc31ed80 |
||
---|---|---|
.. | ||
backtrace_fake.cpp | ||
backtrace_fake.h | ||
libc_fake.cpp | ||
log_fake.cpp | ||
log_fake.h | ||
malloc_debug_config_tests.cpp | ||
malloc_debug_system_tests.cpp | ||
malloc_debug_unit_tests.cpp |