You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by as...@apache.org on 2023/03/10 16:35:02 UTC

[impala] 02/02: IMPALA-11935: Generate core dumps if ASAN/TSAN/UBSAN built be tests crash

This is an automated email from the ASF dual-hosted git repository.

asherman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit b5524e95a1f8ddc920287b9092558a86c987d037
Author: Gergely Fürnstáhl <gf...@cloudera.com>
AuthorDate: Tue Mar 7 14:52:17 2023 +0100

    IMPALA-11935: Generate core dumps if ASAN/TSAN/UBSAN built be tests crash
    
    By default, on 64-bit systems, programs built with sanitizers do not
    produce minidumps nor coredumps due to the shadow memory - which is used
    for house keeping - being huge and the generated dumps would be too
    big (~16TB).
    
    https://gcc.gnu.org/bugzilla//show_bug.cgi?id=89868
    
    The shadow memory can be stripped on exit and the core
    dumps can be generated by setting the (T|A|UB)SAN_OPTIONS environment
    variable before running the program.
    
    https://stackoverflow.com/questions/42851670/how-to-generate-core-dump-on-addresssanitizer-error
    
    This can help investigating crashes in sanitized builds.
    
    Testing:
     - Locally injected an std::abort() to a test case, built it with TSAN
    and verified the creation of the core dump and gdb showed the correct
    stack frame.
    
    Change-Id: Idd868fe0f666d683084a24808dd0dcd7766b837c
    Reviewed-on: http://gerrit.cloudera.org:8080/19598
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 bin/run-backend-tests.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/bin/run-backend-tests.sh b/bin/run-backend-tests.sh
index 4be9b1788..9952496f1 100755
--- a/bin/run-backend-tests.sh
+++ b/bin/run-backend-tests.sh
@@ -39,5 +39,9 @@ cd ..
 
 export CTEST_OUTPUT_ON_FAILURE=1
 
+export TSAN_OPTIONS="disable_coredump=0:unmap_shadow_on_exit=1"
+export ASAN_OPTIONS="disable_coredump=0:unmap_shadow_on_exit=1"
+export UBSAN_OPTIONS="disable_coredump=0:unmap_shadow_on_exit=1"
+
 export PATH="${IMPALA_TOOLCHAIN_PACKAGES_HOME}/llvm-${IMPALA_LLVM_VERSION}/bin:${PATH}"
-"${MAKE_CMD:-make}" test ARGS="${BE_TEST_ARGS}"
+"${MAKE_CMD:-make}" test ARGS="${BE_TEST_ARGS}"
\ No newline at end of file