Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add support for address and thread sanitizer #534

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions industrial_ci/src/docker.env
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ ROSDEP_SKIP_KEYS
ROSINSTALL_FILENAME
ROS_DISTRO
ROS_PYTHON_VERSION
RUN_ASAN
RUN_TSAN
TARGET_CMAKE_ARGS
TARGET_REPO_NAME
TARGET_REPO_PATH
Expand Down
4 changes: 4 additions & 0 deletions industrial_ci/src/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ function ici_run_cmd_in_docker() {
run_opts+=(-v "$CCACHE_DIR:/root/.ccache" -e "CCACHE_DIR=/root/.ccache")
fi

if [ "$RUN_ASAN" = "true" ]; then
run_opts+=(--cap-add SYS_PTRACE)
fi

local hooks=()
for hook in $(env | grep -o '^\(BEFORE\|AFTER\)_[^=]*'); do
hooks+=(-e "$hook")
Expand Down
7 changes: 7 additions & 0 deletions industrial_ci/src/tests/source_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ function run_source_tests {
if [ "${CLANG_TIDY:-false}" != false ]; then
TARGET_CMAKE_ARGS="$TARGET_CMAKE_ARGS -DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
fi
if [ "$RUN_ASAN" = "true" ]; then
TARGET_CMAKE_ARGS="$TARGET_CMAKE_ARGS -DCMAKE_BUILD_TYPE=Debug -DOSRF_TESTING_TOOLS_CPP_DISABLE_MEMORY_TOOLS=ON -DCMAKE_C_FLAGS='-fsanitize=address' -DCMAKE_CXX_FLAGS='-fsanitize=address'"
fi

if [ "$RUN_TSAN" = "true" ]; then
TARGET_CMAKE_ARGS="$TARGET_CMAKE_ARGS -DCMAKE_BUILD_TYPE=Debug -DOSRF_TESTING_TOOLS_CPP_DISABLE_MEMORY_TOOLS=ON -DCMAKE_C_FLAGS='-fsanitize=thread -O2 -g -fno-omit-frame-pointer' -DCMAKE_CXX_FLAGS='-fsanitize=thread -O2 -g -fno-omit-frame-pointer'"
fi
ici_with_ws "$target_ws" ici_build_workspace "target" "$extend" "$target_ws"

if [ "$NOT_TEST_BUILD" != "true" ]; then
Expand Down