Skip to content

Commit

Permalink
Use cargo-careful for --tool=asan, without strict init checks
Browse files Browse the repository at this point in the history
  • Loading branch information
saethlin committed Jul 29, 2023
1 parent 58ab65c commit 3e3653d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ RUN apt-get update && apt-get install -y curl build-essential && \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
sh -s -- --default-toolchain=nightly --component=miri --component=rust-src --profile=minimal -y && \
cargo install --git https://github.com/saethlin/miri-tools cargo-download inapty get-args && \
cargo install cargo-careful && \
curl -L https://github.com/nextest-rs/nextest/releases/download/cargo-nextest-0.9.54/cargo-nextest-0.9.54-x86_64-unknown-linux-gnu.tar.gz | tar xz -C /root/.cargo/bin/ && \
rm -rf /var/lib/apt/lists/*

Expand Down
6 changes: 3 additions & 3 deletions docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ elif [[ $TOOL == "asan" ]]; then
# We really want to only run out of stack in true infinite recursion.
ulimit -s 1048576
export RUST_MIN_STACK=1073741824
export RUSTFLAGS="$RUSTFLAGS -Zsanitizer=address -Cdebuginfo=1"
export RUSTFLAGS="$RUSTFLAGS -Cdebuginfo=1 -Zstrict-init-checks=no"
export ASAN_OPTIONS="detect_stack_use_after_return=true:allocator_may_return_null=1:detect_invalid_pointer_pairs=2"
elif [[ $TOOL == "miri" ]]; then
export RUSTFLAGS="$RUSTFLAGS -Zrandomize-layout -Cdebuginfo=0"
Expand All @@ -32,8 +32,8 @@ function run_build {
}

function run_asan {
cargo +$TOOLCHAIN test --no-run --target=$HOST $ARGS &> /dev/null
timeout --kill-after=10 600 inapty cargo +$TOOLCHAIN test --color=always --no-fail-fast --target=$HOST $ARGS
cargo +$TOOLCHAIN careful test -Zcareful-sanitizer=address --no-run --target=$HOST $ARGS &> /dev/null
timeout --kill-after=10 600 inapty cargo +$TOOLCHAIN careful test -Zcareful-sanitizer=address --color=always --no-fail-fast --target=$HOST $ARGS
}

function run_miri {
Expand Down

0 comments on commit 3e3653d

Please sign in to comment.