platform_bionic/libc/malloc_debug/tests
Christopher Ferris 9bf7817dd2 Fix deadlock/timeout in thread unwinding.
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
2020-05-20 18:18:54 -07:00
..
backtrace_fake.cpp Add support for using the new unwinder. 2018-05-24 08:44:53 -07:00
backtrace_fake.h Add support for using the new unwinder. 2018-05-24 08:44:53 -07:00
libc_fake.cpp Malloc debug rewrite. 2016-01-25 10:54:21 -08:00
log_fake.cpp Add support for using the new unwinder. 2018-05-24 08:44:53 -07:00
log_fake.h Malloc debug rewrite. 2016-01-25 10:54:21 -08:00
malloc_debug_config_tests.cpp Disable info messages by default for malloc debug. 2019-04-02 10:55:21 -07:00
malloc_debug_system_tests.cpp Fix deadlock/timeout in thread unwinding. 2020-05-20 18:18:54 -07:00
malloc_debug_unit_tests.cpp Update for change MapInfo constructor. 2020-01-22 23:29:43 -08:00