Skip to content

valgrind error with num_cpus #5

@andrieshiemstra

Description

@andrieshiemstra

my error:

running 6 tests
test auto_id_map::tests::test_aim ... ok
test eventloop::tests::test ... ok
test eventloop::tests::test_sync ... ok
test js_utils::facades::values::tests::test_jsvf ... ok
==5283== Thread 2 task_manager::te:
==5283== Syscall param statx(file_name) points to unaddressable byte(s)
==5283==    at 0x4AFD9FE: statx (statx.c:29)
==5283==    by 0x2DA930: statx (weak.rs:136)
==5283==    by 0x2DA930: std::sys::unix::fs::try_statx (fs.rs:139)
==5283==    by 0x2CC035: file_attr (fs.rs:776)
==5283==    by 0x2CC035: metadata (fs.rs:493)
==5283==    by 0x2CC035: buffer_capacity_required (fs.rs:609)
==5283==    by 0x2CC035: <std::fs::File as std::io::Read>::read_to_string (fs.rs:645)
==5283==    by 0x27536E: num_cpus::linux::Cgroup::param (linux.rs:214)
==5283==    by 0x275219: num_cpus::linux::Cgroup::quota_us (linux.rs:203)
==5283==    by 0x2750A2: num_cpus::linux::Cgroup::cpu_quota (linux.rs:188)
==5283==    by 0x274CB1: num_cpus::linux::load_cgroups (linux.rs:149)
==5283==    by 0x27494D: num_cpus::linux::init_cgroups (linux.rs:129)
==5283==    by 0x27D3A8: core::ops::function::FnOnce::call_once (function.rs:227)
==5283==    by 0x27ED7A: std::sync::once::Once::call_once::{{closure}} (once.rs:262)
==5283==    by 0x136C27: std::sync::once::Once::call_inner (once.rs:419)
==5283==    by 0x27ED05: std::sync::once::Once::call_once (once.rs:262)
==5283==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==5283== 
==5283== Syscall param statx(buf) points to unaddressable byte(s)
==5283==    at 0x4AFD9FE: statx (statx.c:29)
==5283==    by 0x2DA930: statx (weak.rs:136)
==5283==    by 0x2DA930: std::sys::unix::fs::try_statx (fs.rs:139)
==5283==    by 0x2CC035: file_attr (fs.rs:776)
==5283==    by 0x2CC035: metadata (fs.rs:493)
==5283==    by 0x2CC035: buffer_capacity_required (fs.rs:609)
==5283==    by 0x2CC035: <std::fs::File as std::io::Read>::read_to_string (fs.rs:645)
==5283==    by 0x27536E: num_cpus::linux::Cgroup::param (linux.rs:214)
==5283==    by 0x275219: num_cpus::linux::Cgroup::quota_us (linux.rs:203)
==5283==    by 0x2750A2: num_cpus::linux::Cgroup::cpu_quota (linux.rs:188)
==5283==    by 0x274CB1: num_cpus::linux::load_cgroups (linux.rs:149)
==5283==    by 0x27494D: num_cpus::linux::init_cgroups (linux.rs:129)
==5283==    by 0x27D3A8: core::ops::function::FnOnce::call_once (function.rs:227)
==5283==    by 0x27ED7A: std::sync::once::Once::call_once::{{closure}} (once.rs:262)
==5283==    by 0x136C27: std::sync::once::Once::call_inner (once.rs:419)
==5283==    by 0x27ED05: std::sync::once::Once::call_once (once.rs:262)
==5283==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==5283== 
test cache::tests::test_cache ... ok
test task_manager::tests::test ... ok

test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 9.45s

==5283== 
==5283== HEAP SUMMARY:
==5283==     in use at exit: 1,056 bytes in 2 blocks
==5283==   total heap usage: 577 allocs, 575 frees, 97,207 bytes allocated
==5283== 
==5283== LEAK SUMMARY:
==5283==    definitely lost: 0 bytes in 0 blocks
==5283==    indirectly lost: 0 bytes in 0 blocks
==5283==      possibly lost: 0 bytes in 0 blocks
==5283==    still reachable: 1,056 bytes in 2 blocks
==5283==         suppressed: 0 bytes in 0 blocks
==5283== Reachable blocks (those to which a pointer was found) are not shown.
==5283== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==5283== 
==5283== For lists of detected and suppressed errors, rerun with: -s
==5283== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
Error: Process completed with exit code 123.

look sthe same as this issue, but i'm not going to build valgrind from source in my CI, todo check in 3 or 4 months if valgrinbd 3.19 is released and fixes this...

https://users.rust-lang.org/t/simple-fs-read-to-string-program-causes-valgrind-memcheck-errors/68722

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions