summaryrefslogtreecommitdiff
path: root/libc/malloc_hooks/malloc_hooks.cpp
diff options
context:
space:
mode:
authorWei Li <sirius.liwei@huawei.com>2018-01-26 15:00:32 +0800
committerJinguang Dong <dongjinguang@huawei.com>2018-01-26 17:01:55 +0800
commit2cb5f7f578ec682c2bf628f29ffe21de8ccbc917 (patch)
tree9628aa10b187d7d6abc5be6688df9daa2c36df8a /libc/malloc_hooks/malloc_hooks.cpp
parent40517761dc7c69a704285e61a51bd3b76046fcdf (diff)
Move static variable out of should_trace().
Static variable initialization calls pthread_mutex_lock() and may lead to deadlock if should_trace() is called in pthread_mutex_lock context. Here is a stack of blocked init process: __cxa_guard_acquire -> should_trace -> bionic_trace_begin -> __pthread_mutex_lock_with_timeout -> __cxa_guard_release -> should_trace -> bionic_trace_begin -> __pthread_mutex_lock_with_timeout -> mutex::lock -> LogMessage::~LogMessage ...... So we need to move it out Test: 1 Compiled and booted. 2 Reboot pressure test for more than 30000 times. Change-Id: I8d97745161f1aa8942b63338208ea74830768ae1 Signed-off-by: Wei Li <sirius.liwei@huawei.com> Signed-off-by: Jinguang Dong <dongjinguang@huawei.com>
Diffstat (limited to 'libc/malloc_hooks/malloc_hooks.cpp')
0 files changed, 0 insertions, 0 deletions