Skip to content

Commit

Permalink
Enable -Z randomize-layout in miri CI
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Feb 20, 2022
1 parent b4d594c commit 8786237
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion ci/crossbeam-epoch-loom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -euxo pipefail
IFS=$'\n\t'
cd "$(dirname "$0")"/../crossbeam-epoch

export RUSTFLAGS="-D warnings --cfg crossbeam_loom --cfg crossbeam_sanitize"
export RUSTFLAGS="${RUSTFLAGS:-} --cfg crossbeam_loom --cfg crossbeam_sanitize"

# With MAX_PREEMPTIONS=2 the loom tests (currently) take around 11m.
# If we were to run with =3, they would take several times that,
Expand Down
2 changes: 2 additions & 0 deletions ci/miri.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ set -euxo pipefail
IFS=$'\n\t'
cd "$(dirname "$0")"/..

export RUSTFLAGS="${RUSTFLAGS:-} -Z randomize-layout"

MIRIFLAGS="-Zmiri-check-number-validity -Zmiri-symbolic-alignment-check -Zmiri-tag-raw-pointers" \
cargo miri test \
-p crossbeam-queue
Expand Down
24 changes: 12 additions & 12 deletions ci/san.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ rustup component add rust-src
# `cfg(crossbeam_sanitize)` with `cfg(sanitize = "..")` and remove
# `--cfg crossbeam_sanitize`.
cargo clean
RUSTFLAGS="-Dwarnings -Zsanitizer=address --cfg crossbeam_sanitize" \
cargo test --all --release --target x86_64-unknown-linux-gnu --tests \
RUSTFLAGS="${RUSTFLAGS:-} -Z sanitizer=address --cfg crossbeam_sanitize" \
cargo test --all --release --target x86_64-unknown-linux-gnu --tests \
--exclude crossbeam-skiplist --exclude benchmarks -- --test-threads=1

# There are memory leaks in crossbeam-skiplist.
# https://github.com/crossbeam-rs/crossbeam/issues/614
cargo clean
RUSTFLAGS="-Dwarnings -Zsanitizer=address --cfg crossbeam_sanitize" \
cargo test --release --target x86_64-unknown-linux-gnu \
RUSTFLAGS="${RUSTFLAGS:-} -Z sanitizer=address --cfg crossbeam_sanitize" \
cargo test --release --target x86_64-unknown-linux-gnu \
-p crossbeam-skiplist --test map --test set
cargo clean
ASAN_OPTIONS="detect_leaks=0" \
RUSTFLAGS="-Dwarnings -Zsanitizer=address --cfg crossbeam_sanitize" \
cargo test --release --target x86_64-unknown-linux-gnu \
RUSTFLAGS="${RUSTFLAGS:-} -Z sanitizer=address --cfg crossbeam_sanitize" \
cargo test --release --target x86_64-unknown-linux-gnu \
-p crossbeam-skiplist --tests

cargo clean
RUSTFLAGS="-Dwarnings -Zsanitizer=address --cfg crossbeam_sanitize" \
cargo run \
RUSTFLAGS="${RUSTFLAGS:-} -Z sanitizer=address --cfg crossbeam_sanitize" \
cargo run \
--release \
--target x86_64-unknown-linux-gnu \
--features nightly \
Expand All @@ -41,11 +41,11 @@ cargo run \

# Run memory sanitizer
cargo clean
RUSTFLAGS="-Dwarnings -Zsanitizer=memory --cfg crossbeam_sanitize" \
cargo test -Zbuild-std --all --release --target x86_64-unknown-linux-gnu --tests --exclude benchmarks -- --test-threads=1
RUSTFLAGS="${RUSTFLAGS:-} -Z sanitizer=memory --cfg crossbeam_sanitize" \
cargo test -Z build-std --all --release --target x86_64-unknown-linux-gnu --tests --exclude benchmarks -- --test-threads=1

# Run thread sanitizer
cargo clean
TSAN_OPTIONS="suppressions=$(pwd)/ci/tsan" \
RUSTFLAGS="-Dwarnings -Zsanitizer=thread --cfg crossbeam_sanitize" \
cargo test -Zbuild-std --all --release --target x86_64-unknown-linux-gnu --tests --exclude benchmarks -- --test-threads=1
RUSTFLAGS="${RUSTFLAGS:-} -Z sanitizer=thread --cfg crossbeam_sanitize" \
cargo test -Z build-std --all --release --target x86_64-unknown-linux-gnu --tests --exclude benchmarks -- --test-threads=1
2 changes: 0 additions & 2 deletions ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ set -euxo pipefail
IFS=$'\n\t'
cd "$(dirname "$0")"/..

export RUSTFLAGS="-D warnings"

if [[ -n "${RUST_TARGET:-}" ]]; then
# If RUST_TARGET is specified, use cross for testing.
cross test --all --target "$RUST_TARGET" --exclude benchmarks -- --test-threads=1
Expand Down

0 comments on commit 8786237

Please # to comment.