Skip to content

Commit

Permalink
ci: correct Valgrind and buildspec setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Boquan Fang committed Sep 27, 2024
1 parent 8ebb050 commit e7ab1ff
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 37 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -500,23 +500,23 @@ if (BUILD_TESTING)
--leak-check=full \
--leak-resolution=high \
--trace-children=yes \
--run-libc-freeres=no \
-q --error-exitcode=123 \
--error-limit=no \
--num-callers=40 \
--undef-value-errors=no \
--log-fd=2 \
--suppressions=valgrind.suppressions")

# "pedantic valgrind" will error on memory that is "Still Reachable".
# We only run this on OpenSSL 1.1.1 because there are hundreds of false positives in other libcryptos.
# Tracking issue: https://github.com/aws/s2n-tls/issues/4777
if ($ENV{S2N_LIBCRYPTO} MATCHES "openssl-1.1.1")
set(MEMORYCHECK_COMMAND_OPTIONS "${VALGRIND_DEFAULT} --errors-for-leak-kinds=all")
set(MEMORYCHECK_COMMAND_OPTIONS "${VALGRIND_DEFAULT} --run-libc-freeres=yes --errors-for-leak-kinds=all --show-leak-kinds=all")
else()
set(MEMORYCHECK_COMMAND_OPTIONS ${VALGRIND_DEFAULT})
set(MEMORYCHECK_COMMAND_OPTIONS "${VALGRIND_DEFAULT} --run-libc-freeres=no")
endif()

set(CTEST_MEMORYCHECK_TYPE "Valgrind")
set(MEMORYCHECK_TYPE "Valgrind")

set(UNIT_TEST_ENVS S2N_DONT_MLOCK=1)
if (TSAN OR ASAN)
Expand Down
25 changes: 0 additions & 25 deletions codebuild/bin/display_memory_errors.sh

This file was deleted.

11 changes: 3 additions & 8 deletions codebuild/spec/buildspec_valgrind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ batch:
- identifier: gcc_openssl_1_1_1
env:
compute-type: BUILD_GENERAL1_LARGE
image: 024603541914.dkr.ecr.us-west-2.amazonaws.com/docker:ubuntu22codebuild
image: 024603541914.dkr.ecr.us-west-2.amazonaws.com/docker:ubuntu18codebuild
variables:
S2N_LIBCRYPTO: openssl-1.1.1
COMPILER: gcc
Expand Down Expand Up @@ -68,10 +68,5 @@ phases:
S2N_VALGRIND=1 \
CTEST_PARALLEL_LEVEL=$(nproc) \
CTEST_OUTPUT_ON_FAILURE=1 \
ctest -T memcheck \
--test-dir build;
EXITCODE=$?
- cd codebuild/bin/
- ./display_memory_errors.sh
- cd ../../
- exit $EXITCODE
cmake --build build/ --target test \
-- ARGS="--test-action memcheck"

0 comments on commit e7ab1ff

Please sign in to comment.