From a11c4b22cbcbbdbc4fa0ff62bdbffb430a9d3394 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Thu, 23 Jan 2025 23:55:24 +0900 Subject: [PATCH] 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} (sync.rs:484) ==5246== by 0x22D2A7: allocate_for_layout, alloc::sync::{impl#14}::new_uninit::{closure_env#0}, fn(*mut u8) -> *mut alloc::sync::ArcInner>> (sync.rs:1952) ==5246== by 0x22D2A7: new_uninit (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 core::cell::Cell>, ()> (function.rs:250) ==5246== by 0x1BA891: unwrap_or_else>, fn() -> core::cell::Cell>> (option.rs:1023) ==5246== by 0x1BA891: std::sys::thread_local::native::lazy::Storage::initialize (lazy.rs:64) ==5246== by 0x1BC045: get_or_init>, (), fn() -> core::cell::Cell>> (lazy.rs:56) ==5246== by 0x1BC045: {closure#0} (mod.rs:94) ==5246== by 0x1BC045: call_once>>>)> (function.rs:250) ==5246== by 0x1BC045: try_with>, std::sync::mpmc::context::{impl#0}::with::{closure_env#1}, ()>, ()> (local.rs:307) ==5246== by 0x1BC045: with, ()> (context.rs:52) ==5246== by 0x1BC045: std::sync::mpmc::list::Channel::recv (list.rs:437) ==5246== by 0x1D5336: recv (mod.rs:976) ==5246== by 0x1D5336: recv (mod.rs:850) ==5246== by 0x1D5336: run_tests (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` ``` --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 89aba8f..6f8bac9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,7 +60,8 @@ jobs: - name: Run cargo test (with valgrind) run: cargo test -- --test-threads=1 env: - 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 + # TODO: use --errors-for-leak-kinds=definite,indirect due to upstream bug (https://github.com/rust-lang/rust/issues/135608) + 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 - name: Run cargo test (with portable-atomic enabled) run: cargo test --features portable-atomic - name: Clone async-executor