Add asan and ubsan to WAMR CI (#2161)

Add nightly (UTC time) checks with asan and ubsan, and also put gcc-4.8 build
to nightly run since we don't need to run it with every PR.

Co-authored-by: Maksim Litskevich <makslit@amazon.co.uk>
This commit is contained in:
Zzzabiyaka
2023-05-26 02:45:37 +01:00
committed by GitHub
parent f10563dfb4
commit 27239723a9
9 changed files with 690 additions and 110 deletions

View File

@ -4212,6 +4212,12 @@ static V128FuncPtr invokeNative_V128 = (V128FuncPtr)(uintptr_t)invokeNative;
|| defined(BUILD_TARGET_RISCV64_LP64) */
#endif /* end of defined(_WIN32) || defined(_WIN32_) */
/* ASAN is not designed to work with custom stack unwind or other low-level \
things. > Ignore a function that does some low-level magic. (e.g. walking \
through the thread's stack bypassing the frame boundaries) */
#if defined(__GNUC__)
__attribute__((no_sanitize_address))
#endif
bool
wasm_runtime_invoke_native(WASMExecEnv *exec_env, void *func_ptr,
const WASMType *func_type, const char *signature,

View File

@ -3986,6 +3986,12 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
}
#if WASM_ENABLE_FAST_JIT != 0
/* ASAN is not designed to work with custom stack unwind or other low-level \
things. > Ignore a function that does some low-level magic. (e.g. walking \
through the thread's stack bypassing the frame boundaries) */
#if defined(__GNUC__)
__attribute__((no_sanitize_address))
#endif
static void
fast_jit_call_func_bytecode(WASMModuleInstance *module_inst,
WASMExecEnv *exec_env,

View File

@ -492,6 +492,12 @@ destroy_stack_guard_pages()
}
#endif /* end of WASM_DISABLE_STACK_HW_BOUND_CHECK == 0 */
/* ASAN is not designed to work with custom stack unwind or other low-level \
things. > Ignore a function that does some low-level magic. (e.g. walking \
through the thread's stack bypassing the frame boundaries) */
#if defined(__GNUC__)
__attribute__((no_sanitize_address))
#endif
static void
mask_signals(int how)
{
@ -506,6 +512,12 @@ mask_signals(int how)
static os_thread_local_attribute struct sigaction prev_sig_act_SIGSEGV;
static os_thread_local_attribute struct sigaction prev_sig_act_SIGBUS;
/* ASAN is not designed to work with custom stack unwind or other low-level \
things. > Ignore a function that does some low-level magic. (e.g. walking \
through the thread's stack bypassing the frame boundaries) */
#if defined(__GNUC__)
__attribute__((no_sanitize_address))
#endif
static void
signal_callback(int sig_num, siginfo_t *sig_info, void *sig_ucontext)
{