Skip to content

Commit a11c4b2

Browse files
committed
ci: Use --errors-for-leak-kinds=definite,indirect for valgrind to work around upstream bug
``` ==5246== ==5246== HEAP SUMMARY: ==5246== in use at exit: 48 bytes in 1 blocks ==5246== total heap usage: 428 allocs, 427 frees, 51,703 bytes allocated ==5246== ==5246== Searching for pointers to 1 not-freed blocks ==5246== Checked 128,240 bytes ==5246== ==5246== 48 bytes in 1 blocks are possibly lost in loss record 1 of 1 ==5246== at 0x4E050C5: malloc (vg_replace_malloc.c:442) ==5246== by 0x22D2A7: alloc (alloc.rs:96) ==5246== by 0x22D2A7: alloc_impl (alloc.rs:192) ==5246== by 0x22D2A7: allocate (alloc.rs:254) ==5246== by 0x22D2A7: {closure#0}<std::thread::Inner> (sync.rs:484) ==5246== by 0x22D2A7: allocate_for_layout<core::mem::maybe_uninit::MaybeUninit<std::thread::Inner>, alloc::sync::{impl#14}::new_uninit::{closure_env#0}<std::thread::Inner>, fn(*mut u8) -> *mut alloc::sync::ArcInner<core::mem::maybe_uninit::MaybeUninit<std::thread::Inner>>> (sync.rs:1952) ==5246== by 0x22D2A7: new_uninit<std::thread::Inner> (sync.rs:482) ==5246== by 0x22D2A7: std::thread::Thread::new (mod.rs:1429) ==5246== by 0x22C679: std::thread::current::init_current (current.rs:227) ==5246== by 0x2361E3: current_or_unnamed (current.rs:184) ==5246== by 0x2361E3: std::sync::mpmc::context::Context::new (context.rs:72) ==5246== by 0x1BA891: __init (context.rs:43) ==5246== by 0x1BA891: call_once<fn() -> core::cell::Cell<core::option::Option<std::sync::mpmc::context::Context>>, ()> (function.rs:250) ==5246== by 0x1BA891: unwrap_or_else<core::cell::Cell<core::option::Option<std::sync::mpmc::context::Context>>, fn() -> core::cell::Cell<core::option::Option<std::sync::mpmc::context::Context>>> (option.rs:1023) ==5246== by 0x1BA891: std::sys::thread_local::native::lazy::Storage<T,D>::initialize (lazy.rs:64) ==5246== by 0x1BC045: get_or_init<core::cell::Cell<core::option::Option<std::sync::mpmc::context::Context>>, (), fn() -> core::cell::Cell<core::option::Option<std::sync::mpmc::context::Context>>> (lazy.rs:56) ==5246== by 0x1BC045: {closure#0} (mod.rs:94) ==5246== by 0x1BC045: call_once<std::sync::mpmc::context::{impl#0}::with::CONTEXT::{constant#0}::{closure_env#0}, (core::option::Option<&mut core::option::Option<core::cell::Cell<core::option::Option<std::sync::mpmc::context::Context>>>>)> (function.rs:250) ==5246== by 0x1BC045: try_with<core::cell::Cell<core::option::Option<std::sync::mpmc::context::Context>>, std::sync::mpmc::context::{impl#0}::with::{closure_env#1}<std::sync::mpmc::list::{impl#3}::recv::{closure_env#1}<test::event::CompletedTest>, ()>, ()> (local.rs:307) ==5246== by 0x1BC045: with<std::sync::mpmc::list::{impl#3}::recv::{closure_env#1}<test::event::CompletedTest>, ()> (context.rs:52) ==5246== by 0x1BC045: std::sync::mpmc::list::Channel<T>::recv (list.rs:437) ==5246== by 0x1D5336: recv<test::event::CompletedTest> (mod.rs:976) ==5246== by 0x1D5336: recv<test::event::CompletedTest> (mod.rs:850) ==5246== by 0x1D5336: run_tests<test::console::run_tests_console::{closure_env#2}> (lib.rs:391) ==5246== by 0x1D5336: test::console::run_tests_console (console.rs:322) ==5246== by 0x1F2BE6: test::test_main (lib.rs:149) ==5246== by 0x1F354A: test::test_main_static (lib.rs:171) ==5246== by 0x1B8F72: basic::main (basic.rs:0) ==5246== by 0x1AAEDA: core::ops::function::FnOnce::call_once (function.rs:250) ==5246== by 0x1A610D: std::sys::backtrace::__rust_begin_short_backtrace (backtrace.rs:152) ==5246== ==5246== LEAK SUMMARY: ==5246== definitely lost: 0 bytes in 0 blocks ==5246== indirectly lost: 0 bytes in 0 blocks ==5246== possibly lost: 48 bytes in 1 blocks ==5246== still reachable: 0 bytes in 0 blocks ==5246== suppressed: 0 bytes in 0 blocks ==5246== ==5246== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) error: test failed, to rerun pass `--test basic` ```
1 parent 3421b07 commit a11c4b2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.github/workflows/ci.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ jobs:
6060
- name: Run cargo test (with valgrind)
6161
run: cargo test -- --test-threads=1
6262
env:
63-
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER: valgrind -v --error-exitcode=1 --error-limit=no --leak-check=full --show-leak-kinds=all --track-origins=yes --fair-sched=yes
63+
# TODO: use --errors-for-leak-kinds=definite,indirect due to upstream bug (https://github.com/rust-lang/rust/issues/135608)
64+
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER: valgrind -v --error-exitcode=1 --error-limit=no --leak-check=full --show-leak-kinds=all --errors-for-leak-kinds=definite,indirect --track-origins=yes --fair-sched=yes
6465
- name: Run cargo test (with portable-atomic enabled)
6566
run: cargo test --features portable-atomic
6667
- name: Clone async-executor

0 commit comments

Comments
 (0)