fix lightbacktrace deadloak when 4013

This commit is contained in:
tushicheng
2024-04-15 02:54:53 +00:00
committed by ob-robot
parent 1ced1950f9
commit 8b461d5c8b

View File

@ -12,6 +12,7 @@
#define USING_LOG_PREFIX COMMON
#include "common/ob_common_utility.h"
#include "lib/alloc/malloc_hook.h"
#include "lib/string/ob_string.h"
#include "lib/utility/ob_print_utils.h"
using namespace oceanbase::lib;
@ -108,6 +109,9 @@ int get_stackattr(void *&stackaddr, size_t &stacksize)
stackaddr = g_stackaddr;
stacksize = g_stacksize;
} else {
bool in_hook_bak = in_hook();
in_hook() = true;
DEFER(in_hook() = in_hook_bak);
pthread_attr_t attr;
if (OB_UNLIKELY(0 != pthread_getattr_np(pthread_self(), &attr))) {
ret = OB_ERR_UNEXPECTED;