From 1b72a5a0e4d9687a55e3230e7c5e36692ca10dd7 Mon Sep 17 00:00:00 2001 From: Tsunaou <895254752@qq.com> Date: Fri, 3 Nov 2023 03:43:29 +0000 Subject: [PATCH] Add build.sh flag support for build errsim_sanity and fix bug of compile errsim_asan --- build.sh | 3 +++ deps/oblib/src/lib/thread/thread.cpp | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index df0a13d26..ec8f632b0 100755 --- a/build.sh +++ b/build.sh @@ -215,6 +215,9 @@ function build xsanity) do_build "$@" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOB_USE_LLD=$LLD_OPTION -DENABLE_SANITY=ON ;; + xerrsim_sanity) + do_build "$@" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOB_ERRSIM=ON -DOB_USE_LLD=$LLD_OPTION -DENABLE_SANITY=ON + ;; *) BUILD_ARGS=(debug "${BUILD_ARGS[@]}") build diff --git a/deps/oblib/src/lib/thread/thread.cpp b/deps/oblib/src/lib/thread/thread.cpp index d2326a121..5b9f29d5b 100644 --- a/deps/oblib/src/lib/thread/thread.cpp +++ b/deps/oblib/src/lib/thread/thread.cpp @@ -120,9 +120,13 @@ int Thread::start() void Thread::stop() { + bool stack_addr_flag = true; +#ifndef OB_USE_ASAN + stack_addr_flag = (stack_addr_ != NULL); +#endif #ifdef ERRSIM if (!stop_ - && stack_addr_ != NULL + && stack_addr_flag && 0 != (OB_E(EventTable::EN_THREAD_HANG) 0)) { int tid_offset = 720; int tid = *(pid_t*)((char*)pth_ + tid_offset);