From 87d08095451d8d34030ddc62df093394f247740f Mon Sep 17 00:00:00 2001 From: bfredl Date: Wed, 18 Jan 2023 15:42:30 +0100 Subject: [PATCH] build(ci): let ASAN print tracebacks for more errors (SIGABORT, SIGILL) --- .github/workflows/env.sh | 2 +- CONTRIBUTING.md | 2 +- src/nvim/README.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/env.sh b/.github/workflows/env.sh index 7be26e1a72..b4cdb3a8d9 100755 --- a/.github/workflows/env.sh +++ b/.github/workflows/env.sh @@ -23,7 +23,7 @@ TSAN_OPTIONS= case "$FLAVOR" in asan) CLANG_SANITIZER=ASAN_UBSAN - ASAN_OPTIONS="detect_leaks=1:check_initialization_order=1:log_path=$LOG_DIR/asan:intercept_tls_get_addr=0" + ASAN_OPTIONS="detect_leaks=1:check_initialization_order=1:handle_abort=1:handle_sigill=1:log_path=$LOG_DIR/asan:intercept_tls_get_addr=0" UBSAN_OPTIONS="print_stacktrace=1 log_path=$LOG_DIR/ubsan" ;; tsan) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 98c823ea9c..fe2cdb8a36 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -187,7 +187,7 @@ master build. To view the defects, just request access; you will be approved. ``` - When running Neovim, use ``` - UBSAN_OPTIONS=print_stacktrace=1 ASAN_OPTIONS=log_path=/tmp/nvim_asan nvim args... + UBSAN_OPTIONS=print_stacktrace=1 ASAN_OPTIONS=log_path=/tmp/nvim_asan,handle_abort=1,handle_sigill=1 nvim args... ``` - If Neovim exits unexpectedly, check `/tmp/nvim_asan.{PID}` (or your preferred `log_path`) for log files with error messages. diff --git a/src/nvim/README.md b/src/nvim/README.md index 6876227e48..712fda87ba 100644 --- a/src/nvim/README.md +++ b/src/nvim/README.md @@ -70,8 +70,8 @@ Create a directory to store logs: Configure the sanitizer(s) via these environment variables: - # Change to detect_leaks=1 to detect memory leaks (slower). - export ASAN_OPTIONS="detect_leaks=0:log_path=$HOME/logs/asan" + # Change to detect_leaks=1 to detect memory leaks (slower, noisier). + export ASAN_OPTIONS="detect_leaks=0:log_path=$HOME/logs/asan,handle_abort=1,handle_sigill=1" # Show backtraces in the logs. export UBSAN_OPTIONS=print_stacktrace=1 export MSAN_OPTIONS="log_path=${HOME}/logs/msan"