Add build.sh flag support for build errsim_sanity and fix bug of compile errsim_asan

This commit is contained in:
Tsunaou 2023-11-03 03:43:29 +00:00 committed by ob-robot
parent 4f162cdcc5
commit 1b72a5a0e4
2 changed files with 8 additions and 1 deletions

View File

@ -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

View File

@ -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);