Skip to content

Commit

Permalink
skiplist: Fix memory leaks in SkipList test
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Aug 26, 2023
1 parent 0720460 commit fada640
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 97 deletions.
7 changes: 1 addition & 6 deletions ci/miri.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,9 @@ MIRIFLAGS="-Zmiri-strict-provenance -Zmiri-symbolic-alignment-check -Zmiri-disab
MIRIFLAGS="-Zmiri-strict-provenance -Zmiri-symbolic-alignment-check -Zmiri-disable-isolation -Zmiri-tree-borrows" \
cargo miri test \
-p crossbeam-epoch \
-p crossbeam-skiplist \
-p crossbeam 2>&1 | ts -i '%.s '

# Use Tree Borrows instead of Stacked Borrows because epoch is not compatible with Stacked Borrows: https://github.com/crossbeam-rs/crossbeam/issues/545#issuecomment-1192785003
# -Zmiri-ignore-leaks is needed for https://github.com/crossbeam-rs/crossbeam/issues/614
MIRIFLAGS="-Zmiri-strict-provenance -Zmiri-symbolic-alignment-check -Zmiri-disable-isolation -Zmiri-tree-borrows -Zmiri-ignore-leaks" \
cargo miri test \
-p crossbeam-skiplist 2>&1 | ts -i '%.s '

# Use Tree Borrows instead of Stacked Borrows because epoch is not compatible with Stacked Borrows: https://github.com/crossbeam-rs/crossbeam/issues/545#issuecomment-1192785003
# -Zmiri-compare-exchange-weak-failure-rate=0.0 is needed because some sequential tests (e.g.,
# doctest of Stealer::steal) incorrectly assume that sequential weak CAS will never fail.
Expand Down
15 changes: 2 additions & 13 deletions ci/san.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,10 @@ rustup component add rust-src
# `--cfg crossbeam_sanitize`.
cargo clean
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
RUSTFLAGS="${RUSTFLAGS:-} -Z sanitizer=address --cfg crossbeam_sanitize" \
cargo test --release --target x86_64-unknown-linux-gnu \
-p crossbeam-skiplist --test map --test set
ASAN_OPTIONS="detect_leaks=0" \
RUSTFLAGS="${RUSTFLAGS:-} -Z sanitizer=address --cfg crossbeam_sanitize" \
cargo test --release --target x86_64-unknown-linux-gnu \
-p crossbeam-skiplist --tests
cargo test -Z build-std --all --release --target x86_64-unknown-linux-gnu --tests --exclude benchmarks -- --test-threads=1

RUSTFLAGS="${RUSTFLAGS:-} -Z sanitizer=address --cfg crossbeam_sanitize" \
cargo run \
cargo run -Z build-std \
--release \
--target x86_64-unknown-linux-gnu \
--example sanitize \
Expand Down
Loading

0 comments on commit fada640

Please sign in to comment.