Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop leaking path #185

Closed
alfa07 opened this issue May 29, 2021 · 0 comments
Closed

Stop leaking path #185

alfa07 opened this issue May 29, 2021 · 0 comments

Comments

@alfa07
Copy link

alfa07 commented May 29, 2021

Leak creates noise and prevents from running sanitizer in CI

Address sanitizer complains about memory leak here: https://github.com/mitsuhiko/insta/blob/master/src/runtime.rs#L204
Like this:

$ RUST_BACKTRACE=1 RUSTFLAGS=-Zsanitizer=address cargo test --target x86_64-unknown-linux-gnu
..... skipped ....
=================================================================
==2927823==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x5593809c790d in malloc /rustc/llvm/src/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145:3
    #1 0x5593810d7f48 in alloc::alloc::alloc::h8d7eb83558c3a58a /home/maxim/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:86:14
    #2 0x5593810d7f48 in alloc::alloc::Global::alloc_impl::h9eeeef21ad1fa569 /home/maxim/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:166:73
    #3 0x5593810d7f48 in _$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$::allocate::hff4002a2175a8570 /home/maxim/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:226:9
    #4 0x5593810d7f48 in alloc::alloc::exchange_malloc::hb01d0b8a035cc1a4 /home/maxim/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:316:11
    #5 0x5593810d7f48 in alloc::boxed::Box$LT$T$GT$::new::h0aec4b78846d8d44 /home/maxim/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/boxed.rs:185:9
    #6 0x5593810d7f48 in insta::runtime::get_cargo_workspace::hd14cebdfc963ae90 /home/maxim/.cargo/registry/src/github.com-1ecc6299db9ec823/insta-1.7.1/src/runtime.rs:204:30
    #7 0x5593810ea877 in insta::runtime::assert_snapshot::h4bbd9fa593b577e7 /home/maxim/.cargo/registry/src/github.com-1ecc6299db9ec823/insta-1.7.1/src/runtime.rs:888:27
    #8 0x559380bcf262 in alicedb::core::rowset::test::test_intersect::h39191c2839e78e11 /home/maxim/dev/alicedb/src/core/rowset.rs:347:9
    #9 0x559380e740d5 in core::ops::function::FnOnce::call_once::hc6d33e7538d37f7d /rustc/45b3c28518e4c45dfd12bc2c4400c0d0e9639927/library/core/src/ops/function.rs:227:5
    #10 0x559380e740d5 in test::__rust_begin_short_backtrace::h38a84db7bd777a3b /rustc/45b3c28518e4c45dfd12bc2c4400c0d0e9639927/library/test/src/lib.rs:567:5

SUMMARY: AddressSanitizer: 24 byte(s) leaked in 1 allocation(s).
error: test failed, to rerun pass '--lib'

Reproduction steps

  1. Run RUST_BACKTRACE=1 RUSTFLAGS=-Zsanitizer=address cargo test --target x86_64-unknown-linux-gnu

Additional helpful information:

  • Version of insta: 1.7.1
  • Version of rustc: rustc 1.52.0-nightly (45b3c2851 2021-03-04)
  • Operating system and version: Ubuntu 20.04.2 LTS

What did you expect

No errors from sanitizer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant