Enable detect_stack_use_after_return for ASAN (#9714)

Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/9714

Reviewed By: ajkr

Differential Revision: D34983675

Pulled By: jay-zhuang

fbshipit-source-id: 0252ec6ee38a0b960df4c92791c7c2bcbfba5ad8
main
Jay Zhuang 3 years ago committed by Facebook GitHub Bot
parent 49a10feb21
commit 661e03294c
  1. 2
      .circleci/config.yml
  2. 14
      Makefile
  3. 5
      build_tools/rocksdb-lego-determinator

@ -306,7 +306,7 @@ jobs:
- pre-steps - pre-steps
- install-gflags - install-gflags
- install-clang-10 - install-clang-10
- run: COMPILE_WITH_ASAN=1 CC=clang-10 CXX=clang++-10 ROCKSDB_DISABLE_ALIGNED_NEW=1 USE_CLANG=1 make V=1 -j32 check # aligned new doesn't work for reason we haven't figured out - run: ASAN_OPTIONS=detect_stack_use_after_return=1 COMPILE_WITH_ASAN=1 CC=clang-10 CXX=clang++-10 ROCKSDB_DISABLE_ALIGNED_NEW=1 USE_CLANG=1 make V=1 -j32 check # aligned new doesn't work for reason we haven't figured out
- post-steps - post-steps
build-linux-clang10-mini-tsan: build-linux-clang10-mini-tsan:

@ -1032,31 +1032,31 @@ ldb_tests: ldb
include crash_test.mk include crash_test.mk
asan_check: clean asan_check: clean
COMPILE_WITH_ASAN=1 $(MAKE) check -j32 ASAN_OPTIONS=detect_stack_use_after_return=1 COMPILE_WITH_ASAN=1 $(MAKE) check -j32
$(MAKE) clean $(MAKE) clean
asan_crash_test: clean asan_crash_test: clean
COMPILE_WITH_ASAN=1 $(MAKE) crash_test ASAN_OPTIONS=detect_stack_use_after_return=1 COMPILE_WITH_ASAN=1 $(MAKE) crash_test
$(MAKE) clean $(MAKE) clean
whitebox_asan_crash_test: clean whitebox_asan_crash_test: clean
COMPILE_WITH_ASAN=1 $(MAKE) whitebox_crash_test ASAN_OPTIONS=detect_stack_use_after_return=1 COMPILE_WITH_ASAN=1 $(MAKE) whitebox_crash_test
$(MAKE) clean $(MAKE) clean
blackbox_asan_crash_test: clean blackbox_asan_crash_test: clean
COMPILE_WITH_ASAN=1 $(MAKE) blackbox_crash_test ASAN_OPTIONS=detect_stack_use_after_return=1 COMPILE_WITH_ASAN=1 $(MAKE) blackbox_crash_test
$(MAKE) clean $(MAKE) clean
asan_crash_test_with_atomic_flush: clean asan_crash_test_with_atomic_flush: clean
COMPILE_WITH_ASAN=1 $(MAKE) crash_test_with_atomic_flush ASAN_OPTIONS=detect_stack_use_after_return=1 COMPILE_WITH_ASAN=1 $(MAKE) crash_test_with_atomic_flush
$(MAKE) clean $(MAKE) clean
asan_crash_test_with_txn: clean asan_crash_test_with_txn: clean
COMPILE_WITH_ASAN=1 $(MAKE) crash_test_with_txn ASAN_OPTIONS=detect_stack_use_after_return=1 COMPILE_WITH_ASAN=1 $(MAKE) crash_test_with_txn
$(MAKE) clean $(MAKE) clean
asan_crash_test_with_best_efforts_recovery: clean asan_crash_test_with_best_efforts_recovery: clean
COMPILE_WITH_ASAN=1 $(MAKE) crash_test_with_best_efforts_recovery ASAN_OPTIONS=detect_stack_use_after_return=1 COMPILE_WITH_ASAN=1 $(MAKE) crash_test_with_best_efforts_recovery
$(MAKE) clean $(MAKE) clean
ubsan_check: clean ubsan_check: clean

@ -106,10 +106,11 @@ SHM="TEST_TMPDIR=/dev/shm/rocksdb"
NON_SHM="TMPD=/tmp/rocksdb_test_tmp" NON_SHM="TMPD=/tmp/rocksdb_test_tmp"
GCC_481="ROCKSDB_FBCODE_BUILD_WITH_481=1" GCC_481="ROCKSDB_FBCODE_BUILD_WITH_481=1"
ASAN="COMPILE_WITH_ASAN=1" ASAN="COMPILE_WITH_ASAN=1"
ASAN_TEST_OPTIONS="ASAN_OPTIONS=detect_stack_use_after_return=1"
CLANG="USE_CLANG=1" CLANG="USE_CLANG=1"
TSAN="COMPILE_WITH_TSAN=1" TSAN="COMPILE_WITH_TSAN=1"
UBSAN="COMPILE_WITH_UBSAN=1" UBSAN="COMPILE_WITH_UBSAN=1"
ASAN_CRASH="ASAN_OPTIONS=disable_coredump=0" ASAN_CRASH="ASAN_OPTIONS=disable_coredump=0:detect_stack_use_after_return=1"
TSAN_CRASH="TSAN_OPTIONS=disable_coredump=0 CRASH_TEST_EXT_ARGS=\\\"--compression_type=zstd --log2_keys_per_lock=22\\\"" TSAN_CRASH="TSAN_OPTIONS=disable_coredump=0 CRASH_TEST_EXT_ARGS=\\\"--compression_type=zstd --log2_keys_per_lock=22\\\""
NON_TSAN_CRASH="CRASH_TEST_EXT_ARGS=--compression_type=zstd" NON_TSAN_CRASH="CRASH_TEST_EXT_ARGS=--compression_type=zstd"
UBSAN_CRASH="UBSAN_OPTIONS=disable_coredump=0" UBSAN_CRASH="UBSAN_OPTIONS=disable_coredump=0"
@ -597,7 +598,7 @@ ASAN_TEST_COMMANDS="[
$CLEANUP_ENV, $CLEANUP_ENV,
{ {
\"name\":\"Test RocksDB debug under ASAN\", \"name\":\"Test RocksDB debug under ASAN\",
\"shell\":\"cd $WORKING_DIR; set -o pipefail && $SHM $ASAN $DEBUG $SKIP_FORMAT_CHECKS make $PARALLELISM asan_check || $CONTRUN_NAME=asan_check $TASK_CREATION_TOOL\", \"shell\":\"cd $WORKING_DIR; set -o pipefail && $SHM $ASAN $ASAN_TEST_OPTIONS $DEBUG $SKIP_FORMAT_CHECKS make $PARALLELISM asan_check || $CONTRUN_NAME=asan_check $TASK_CREATION_TOOL\",
\"user\":\"root\", \"user\":\"root\",
$PARSER $PARSER
} }

Loading…
Cancel
Save