Skip to content

Valgrind reported some error #104567

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

Closed
jiangbo opened this issue Nov 18, 2022 · 4 comments
Closed

Valgrind reported some error #104567

jiangbo opened this issue Nov 18, 2022 · 4 comments

Comments

@jiangbo
Copy link

jiangbo commented Nov 18, 2022

I used axum to write an http service, and when I used valgrind to analyze it, it prompted some errors.
I don't know if there is a problem, can someone help me?

env:
virtual box 7.0.2
centos 7
ustup 1.25.1 (bb60b1e89 2022-07-12)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active rustc version is rustc 1.65.0 (897e37553 2022-11-02)

[root@centos7 debug]# valgrind --leak-check=full ./decrypt
==9829== Memcheck, a memory error detector
==9829== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==9829== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==9829== Command: ./decrypt
==9829== 
==9829== Syscall param statx(file_name) points to unaddressable byte(s)
==9829==    at 0x5A6FE29: syscall (in /usr/lib64/libc-2.17.so)
==9829==    by 0x42B99E: statx (weak.rs:182)
==9829==    by 0x42B99E: std::sys::unix::fs::try_statx (fs.rs:161)
==9829==    by 0x41F7A2: file_attr (fs.rs:955)
==9829==    by 0x41F7A2: metadata (fs.rs:550)
==9829==    by 0x41F7A2: std::fs::buffer_capacity_required (fs.rs:718)
==9829==    by 0x41F97D: <std::fs::File as std::io::Read>::read_to_string (fs.rs:752)
==9829==    by 0x39ABC6: num_cpus::linux::Cgroup::raw_param (linux.rs:246)
==9829==    by 0x39A971: num_cpus::linux::Cgroup::param (linux.rs:237)
==9829==    by 0x39A599: num_cpus::linux::Cgroup::quota_us (linux.rs:219)
==9829==    by 0x39A38B: num_cpus::linux::Cgroup::cpu_quota (linux.rs:203)
==9829==    by 0x399F26: num_cpus::linux::load_cgroups (linux.rs:154)
==9829==    by 0x399B8D: num_cpus::linux::init_cgroups (linux.rs:134)
==9829==    by 0x3A45C8: core::ops::function::FnOnce::call_once (function.rs:248)
==9829==    by 0x392F02: std::sync::once::Once::call_once::{{closure}} (once.rs:276)
==9829==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==9829== 
==9829== Syscall param statx(buf) points to unaddressable byte(s)
==9829==    at 0x5A6FE29: syscall (in /usr/lib64/libc-2.17.so)
==9829==    by 0x42B99E: statx (weak.rs:182)
==9829==    by 0x42B99E: std::sys::unix::fs::try_statx (fs.rs:161)
==9829==    by 0x41F7A2: file_attr (fs.rs:955)
==9829==    by 0x41F7A2: metadata (fs.rs:550)
==9829==    by 0x41F7A2: std::fs::buffer_capacity_required (fs.rs:718)
==9829==    by 0x41F97D: <std::fs::File as std::io::Read>::read_to_string (fs.rs:752)
==9829==    by 0x39ABC6: num_cpus::linux::Cgroup::raw_param (linux.rs:246)
==9829==    by 0x39A971: num_cpus::linux::Cgroup::param (linux.rs:237)
==9829==    by 0x39A599: num_cpus::linux::Cgroup::quota_us (linux.rs:219)
==9829==    by 0x39A38B: num_cpus::linux::Cgroup::cpu_quota (linux.rs:203)
==9829==    by 0x399F26: num_cpus::linux::load_cgroups (linux.rs:154)
==9829==    by 0x399B8D: num_cpus::linux::init_cgroups (linux.rs:134)
==9829==    by 0x3A45C8: core::ops::function::FnOnce::call_once (function.rs:248)
==9829==    by 0x392F02: std::sync::once::Once::call_once::{{closure}} (once.rs:276)
==9829==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==9829== 
@tgross35
Copy link
Contributor

tgross35 commented Dec 6, 2022

What version of valgrind are you using? It looks like maybe this issue stems from an older version #68979

@jiangbo
Copy link
Author

jiangbo commented Dec 9, 2022

[root@centos7 ~]# valgrind --version
valgrind-3.15.0

@tgross35
Copy link
Contributor

tgross35 commented Dec 9, 2022

Same version as in the issue, update it

@jiangbo
Copy link
Author

jiangbo commented Dec 9, 2022

Thank you. I'll try it when I have time.

@jiangbo jiangbo closed this as completed Dec 9, 2022
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

2 participants