summaryrefslogtreecommitdiff
path: root/tests/stdio_test.cpp
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2020-05-20 15:37:30 -0700
committerChristopher Ferris <cferris@google.com>2020-05-20 18:18:54 -0700
commit9bf7817dd29d15ea49c88436db4067d87fc7e6c4 (patch)
tree83df3be7fc9aa5b879d22b9db6361baf7c83c17f /tests/stdio_test.cpp
parentba198d508497ffeb146d61c5ec5fb66d84e864f3 (diff)
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
Diffstat (limited to 'tests/stdio_test.cpp')
0 files changed, 0 insertions, 0 deletions