From 849eb18532fe8921bb32362d5e346fd1378ad737 Mon Sep 17 00:00:00 2001 From: "auto-revert-app[bot]" <166078896+auto-revert-app[bot]@users.noreply.github.com> Date: Thu, 19 Dec 2024 06:44:08 +0000 Subject: [PATCH] Revert "SERVER-93803 enable detect_stack_use_after_return in ASAN builds (#30429)" (#30516) GitOrigin-RevId: bda0b261d73e489559855b59e8ef232449cf69b1 --- SConstruct | 2 -- etc/asan.denylist | 11 ----------- .../variants/sanitizer/test_dev.yml | 2 +- .../sanitizer/test_dev_master_branch_only.yml | 4 ++-- .../ubuntu/test_dev_master_and_lts_branches_only.yml | 2 +- 5 files changed, 4 insertions(+), 17 deletions(-) diff --git a/SConstruct b/SConstruct index 63ac550e91a..5e626159f6f 100644 --- a/SConstruct +++ b/SConstruct @@ -4514,8 +4514,6 @@ def doConfigure(myenv): "handle_abort=1", "strict_string_checks=true", "detect_invalid_pointer_pairs=1", - "detect_stack_use_after_return=1", - "max_uar_stack_size_log=16", ] asan_options = ":".join(asan_options_clear) lsan_options = ( diff --git a/etc/asan.denylist b/etc/asan.denylist index 1fce34f9c22..2586438f555 100644 --- a/etc/asan.denylist +++ b/etc/asan.denylist @@ -5,14 +5,3 @@ src:src/third_party/IntelRDFPMathLib20U1/TESTS/readtest.c # gRPC only supports sanitizers in the native Bazel build (https://github.com/grpc/grpc/issues/19224#issuecomment-610363882) # This file has a static init order fiasco. src:src/third_party/grpc/dist/src/cpp/util/status.cc - -# The following sources rely on a local variable being located on the stack, which is -# not compatible with the implementation of detect_stack_use_after_return. ASAN does -# not report a use-after-return, but breaks the correctness of the stack locator. -# *MozRuntime* -> MozJSImplScope::MozRuntime::MozRuntime -fun:*MozRuntime* -src:src/mongo/platform/stack_locator_test.cpp -src:src/mongo/stdx/sigaltstack_location_test.cpp - -# A stack use-after-return is reported by ASAN when running kafka_resolve_callback_test, SERVER-98554 -src:src/mongo/db/modules/enterprise/src/streams/exec/kafka_resolve_callback.cpp diff --git a/etc/evergreen_yml_components/variants/sanitizer/test_dev.yml b/etc/evergreen_yml_components/variants/sanitizer/test_dev.yml index 6a2c5900174..f38da621e15 100644 --- a/etc/evergreen_yml_components/variants/sanitizer/test_dev.yml +++ b/etc/evergreen_yml_components/variants/sanitizer/test_dev.yml @@ -131,7 +131,7 @@ variables: - aubsan_options: &aubsan_options >- UBSAN_OPTIONS="print_stacktrace=1:external_symbolizer_path=/opt/mongodbtoolchain/v4/bin/llvm-symbolizer" LSAN_OPTIONS="suppressions=etc/lsan.suppressions:report_objects=1" - ASAN_OPTIONS="detect_leaks=1:check_initialization_order=true:strict_init_order=true:abort_on_error=1:disable_coredump=0:handle_abort=1:strict_string_checks=true:detect_invalid_pointer_pairs=1:detect_stack_use_after_return=1:max_uar_stack_size_log=16:external_symbolizer_path=/opt/mongodbtoolchain/v4/bin/llvm-symbolizer" + ASAN_OPTIONS="detect_leaks=1:check_initialization_order=true:strict_init_order=true:abort_on_error=1:disable_coredump=0:handle_abort=1:strict_string_checks=true:detect_invalid_pointer_pairs=1:external_symbolizer_path=/opt/mongodbtoolchain/v4/bin/llvm-symbolizer" # THIS HAS COPIES IN: # - etc/evergreen_yml_components/variants/sanitizer/test_dev_master_branch_only.yml diff --git a/etc/evergreen_yml_components/variants/sanitizer/test_dev_master_branch_only.yml b/etc/evergreen_yml_components/variants/sanitizer/test_dev_master_branch_only.yml index 8233847c481..f78d29fcc7b 100644 --- a/etc/evergreen_yml_components/variants/sanitizer/test_dev_master_branch_only.yml +++ b/etc/evergreen_yml_components/variants/sanitizer/test_dev_master_branch_only.yml @@ -88,13 +88,13 @@ variables: - aubsan_options: &aubsan_options >- UBSAN_OPTIONS="print_stacktrace=1:external_symbolizer_path=/opt/mongodbtoolchain/v4/bin/llvm-symbolizer" LSAN_OPTIONS="suppressions=etc/lsan.suppressions:report_objects=1" - ASAN_OPTIONS="detect_leaks=1:check_initialization_order=true:strict_init_order=true:abort_on_error=1:disable_coredump=0:handle_abort=1:strict_string_checks=true:detect_invalid_pointer_pairs=1:detect_stack_use_after_return=1:max_uar_stack_size_log=16:external_symbolizer_path=/opt/mongodbtoolchain/v4/bin/llvm-symbolizer" + ASAN_OPTIONS="detect_leaks=1:check_initialization_order=true:strict_init_order=true:abort_on_error=1:disable_coredump=0:handle_abort=1:strict_string_checks=true:detect_invalid_pointer_pairs=1:external_symbolizer_path=/opt/mongodbtoolchain/v4/bin/llvm-symbolizer" # https://github.com/grpc/grpc/issues/21537 -- have to disable checking odr violations on gRPC if it is not in native Bazel build. - grpc_aubsan_options: &grpc_aubsan_options >- UBSAN_OPTIONS="print_stacktrace=1:external_symbolizer_path=/opt/mongodbtoolchain/v4/bin/llvm-symbolizer" LSAN_OPTIONS="suppressions=etc/lsan.suppressions:report_objects=1" - ASAN_OPTIONS="detect_odr_violation=0:detect_leaks=1:check_initialization_order=true:strict_init_order=true:abort_on_error=1:disable_coredump=0:handle_abort=1:strict_string_checks=true:detect_invalid_pointer_pairs=1:detect_stack_use_after_return=1:max_uar_stack_size_log=16:external_symbolizer_path=/opt/mongodbtoolchain/v4/bin/llvm-symbolizer" + ASAN_OPTIONS="detect_odr_violation=0:detect_leaks=1:check_initialization_order=true:strict_init_order=true:abort_on_error=1:disable_coredump=0:handle_abort=1:strict_string_checks=true:detect_invalid_pointer_pairs=1:external_symbolizer_path=/opt/mongodbtoolchain/v4/bin/llvm-symbolizer" - ubsan_options: &ubsan_options UBSAN_OPTIONS="print_stacktrace=1:external_symbolizer_path=/opt/mongodbtoolchain/v4/bin/llvm-symbolizer" diff --git a/etc/evergreen_yml_components/variants/ubuntu/test_dev_master_and_lts_branches_only.yml b/etc/evergreen_yml_components/variants/ubuntu/test_dev_master_and_lts_branches_only.yml index 85e3d7761c0..1eab697fac7 100644 --- a/etc/evergreen_yml_components/variants/ubuntu/test_dev_master_and_lts_branches_only.yml +++ b/etc/evergreen_yml_components/variants/ubuntu/test_dev_master_and_lts_branches_only.yml @@ -64,7 +64,7 @@ buildvariants: LIBS="voidstar" san_options: >- UBSAN_OPTIONS="print_stacktrace=1:external_symbolizer_path=/usr/lib/llvm-12/bin/llvm-symbolizer" - ASAN_OPTIONS="detect_leaks=1:check_initialization_order=true:strict_init_order=true:abort_on_error=1:disable_coredump=0:handle_abort=1:strict_string_checks=true:detect_invalid_pointer_pairs=1:detect_stack_use_after_return=1:max_uar_stack_size_log=16:verify_asan_link_order=0" + ASAN_OPTIONS="detect_leaks=1:check_initialization_order=true:strict_init_order=true:abort_on_error=1:disable_coredump=0:handle_abort=1:strict_string_checks=true:detect_invalid_pointer_pairs=1:verify_asan_link_order=0" test_flags: >- --excludeWithAnyTags=incompatible_aubsan # The v4 toolchain doesn't support the -shared-libsan option with TSAN, which is necessary for