Skip to content

Commit

Permalink
Merge #674
Browse files Browse the repository at this point in the history
674: Adjust scope of asan leak check r=taiki-e a=taiki-e

asan leak check is currently disabled for all crates, but only skiplist actually has memory leaks.
This PR minimizes the scope that asan leak check is disabled and enables asan leak check for most crates and test.
This PR also adds tests for memory leaks recently fixed.

Co-authored-by: Taiki Endo <te316e89@gmail.com>
  • Loading branch information
bors[bot] and taiki-e committed Mar 4, 2021
2 parents 2970aae + 570cde6 commit e1d6460
Show file tree
Hide file tree
Showing 3 changed files with 1,128 additions and 4 deletions.
19 changes: 15 additions & 4 deletions ci/san.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,25 @@ fi
rustup component add rust-src

# Run address sanitizer
# https://github.com/crossbeam-rs/crossbeam/issues/614
export ASAN_OPTIONS="detect_leaks=0"
cargo clean
# TODO: Once `cfg(sanitize = "..")` is stable, replace
# `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 \
--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 \
-p crossbeam-skiplist --test map --test set
cargo clean
ASAN_OPTIONS="detect_leaks=0" \
RUSTFLAGS="-Dwarnings -Zsanitizer=address --cfg crossbeam_sanitize" \
cargo test --all --release --target x86_64-unknown-linux-gnu --tests --exclude benchmarks -- --test-threads=1
cargo test --release --target x86_64-unknown-linux-gnu \
-p crossbeam-skiplist --tests

cargo clean
RUSTFLAGS="-Dwarnings -Zsanitizer=address --cfg crossbeam_sanitize" \
Expand Down
Loading

0 comments on commit e1d6460

Please sign in to comment.