From dc4b928ec5a1a40fa19af5a4f8f5141fa7f91425 Mon Sep 17 00:00:00 2001 From: Dave Tucker Date: Fri, 8 Oct 2021 17:03:31 +0100 Subject: [PATCH] miri: Disable Stacked Borrows and skip some tests The perf_buffer code fails due to stacked borrows, skip this for now. munmap isn't supported by miri. Signed-off-by: Dave Tucker --- .github/workflows/lint.yml | 2 ++ aya/src/maps/perf/perf_buffer.rs | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 88232815..674a9b16 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -44,6 +44,8 @@ jobs: popd - name: Run miri + env: + MIRIFLAGS: -Zmiri-disable-stacked-borrows run: | cargo miri test pushd bpf diff --git a/aya/src/maps/perf/perf_buffer.rs b/aya/src/maps/perf/perf_buffer.rs index 3706a781..bdfea0d3 100644 --- a/aya/src/maps/perf/perf_buffer.rs +++ b/aya/src/maps/perf/perf_buffer.rs @@ -347,6 +347,7 @@ mod tests { } #[test] + #[cfg_attr(miri, ignore)] fn test_no_out_bufs() { let mut mmapped_buf = MMappedBuf { data: [0; PAGE_SIZE * 2], @@ -361,6 +362,7 @@ mod tests { } #[test] + #[cfg_attr(miri, ignore)] fn test_no_events() { let mut mmapped_buf = MMappedBuf { data: [0; PAGE_SIZE * 2], @@ -376,6 +378,7 @@ mod tests { } #[test] + #[cfg_attr(miri, ignore)] fn test_read_first_lost() { let mut mmapped_buf = MMappedBuf { data: [0; PAGE_SIZE * 2], @@ -440,6 +443,7 @@ mod tests { } #[test] + #[cfg_attr(miri, ignore)] fn test_read_first_sample() { let mut mmapped_buf = MMappedBuf { data: [0; PAGE_SIZE * 2], @@ -457,6 +461,7 @@ mod tests { } #[test] + #[cfg_attr(miri, ignore)] fn test_read_many_with_many_reads() { let mut mmapped_buf = MMappedBuf { data: [0; PAGE_SIZE * 2], @@ -479,6 +484,7 @@ mod tests { } #[test] + #[cfg_attr(miri, ignore)] fn test_read_many_with_one_read() { let mut mmapped_buf = MMappedBuf { data: [0; PAGE_SIZE * 2], @@ -500,6 +506,7 @@ mod tests { } #[test] + #[cfg_attr(miri, ignore)] fn test_read_last_sample() { let mut mmapped_buf = MMappedBuf { data: [0; PAGE_SIZE * 2], @@ -519,6 +526,7 @@ mod tests { } #[test] + #[cfg_attr(miri, ignore)] fn test_read_wrapping_sample_size() { let mut mmapped_buf = MMappedBuf { data: [0; PAGE_SIZE * 2], @@ -547,6 +555,7 @@ mod tests { } #[test] + #[cfg_attr(miri, ignore)] fn test_read_wrapping_value() { let mut mmapped_buf = MMappedBuf { data: [0; PAGE_SIZE * 2],