Skip to content

Commit

Permalink
ci: add MIRI_LEAK_CHECK=1 on ci
Browse files Browse the repository at this point in the history
  • Loading branch information
driftluo committed Jan 26, 2025
1 parent 77f38c2 commit 2de82b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ci/miri.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ export MIRIFLAGS="${MIRIFLAGS:-} -Zmiri-strict-provenance -Zmiri-symbolic-alignm

case "${group}" in
channel)
# -Zmiri-ignore-leaks is needed because we use detached threads in tests in tests/array.rs: panic_on_drop
MIRI_LEAK_CHECK='1' \
MIRIFLAGS="${MIRIFLAGS} -Zmiri-ignore-leaks" \
cargo miri test --all-features \
-p crossbeam-channel 2>&1 | ts -i '%.s '
# -Zmiri-ignore-leaks is needed because we use detached threads in tests in tests/golang.rs: https://github.com/rust-lang/miri/issues/1371
MIRI_LEAK_CHECK='1' \
MIRIFLAGS="${MIRIFLAGS} -Zmiri-ignore-leaks" \
cargo miri test --all-features \
-p crossbeam-channel --test golang 2>&1 | ts -i '%.s '
Expand Down
2 changes: 2 additions & 0 deletions crossbeam-channel/tests/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,8 @@ fn channel_through_channel() {
.unwrap();
}

// On the current implementation, panic on drop will cause memory leaks
#[cfg_attr(crossbeam_sanitize, ignore)]
#[test]
fn panic_on_drop() {
struct Msg1<'a>(&'a mut bool);
Expand Down

0 comments on commit 2de82b8

Please sign in to comment.