Skip to content

Commit 27e3982

Browse files
authored
Merge pull request #127 from Dushistov/master
Add suppression for `thread_local::native::lazy::Storage<>::get_or_init_slow`
2 parents ea83ca9 + bfbb8ac commit 27e3982

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ jobs:
2929
- run: rustup update --no-self-update 1.82 && rustup default 1.82
3030
- name: Run tests
3131
run: cargo test
32+
- name: Run tests in release mode
33+
run: cargo test --release

suppressions/rust-1.84

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
Rust 1.84 standard library
3+
Memcheck:Leak
4+
match-leak-kinds: possible
5+
fun:malloc
6+
fun:_ZN3std6thread6Thread3new*
7+
fun:_ZN3std6thread7current12init_current*
8+
fun:_ZN3std4sync4mpmc7context7Context3new*
9+
fun:_ZN3std3sys12thread_local6native4lazy20Storage*
10+
fun:_ZN3std4sync4mpmc4list16Channel$LT$T$GT$4recv*
11+
}

tests/regression.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,20 @@ fn environment_variables_are_passed_to_program_under_test() {
7777
.stdout(predicates::str::contains("RUST_LOG=debug"));
7878
}
7979

80+
/// Issue: [#126]
81+
///
82+
/// [#126]: https://github.com/jfrimmel/cargo-valgrind/issues/126
83+
#[test]
84+
fn empty_tests_not_leak_in_release_mode() {
85+
const FFI_TARGET_CRATE: &[&str] = &["--manifest-path", "tests/ffi-bug/Cargo.toml"];
86+
cargo_valgrind()
87+
.arg("test")
88+
.arg("--release")
89+
.args(FFI_TARGET_CRATE)
90+
.assert()
91+
.success();
92+
}
93+
8094
/// If a program crashes within running it in Valgrind, a `vgcore.<pid>`-file
8195
/// might be created in the current working directory. In order to not clutter
8296
/// the main project directory, this type can be used as a drop-guard to delete

0 commit comments

Comments
 (0)