summaryrefslogtreecommitdiff
path: root/tests/android_unsafe_frame_pointer_chase_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-21 09:42:45 -0700
commit73ca781f435ff45d85cc8daa3bb79d81c42bdc28 (patch)
tree936cf492400fea213549c28e1357f86e869f002f /tests/android_unsafe_frame_pointer_chase_test.cpp
parent53a9db72cc93bb1857882d7a4400801610757a8f (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 (cherry picked from commit 9bf7817dd29d15ea49c88436db4067d87fc7e6c4)
Diffstat (limited to 'tests/android_unsafe_frame_pointer_chase_test.cpp')
0 files changed, 0 insertions, 0 deletions