-
-
Notifications
You must be signed in to change notification settings - Fork 120
Procfs v0.8.1 does not support kernel version string larger than 256 #267
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug description
Linux kernel version: 4.19.270. When I tried to run scaphandre (version 0.4.1) with qemu exporter, I got the following error:
Sending ⚡ metrics
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Other("Failed to parse patch version")', /home/XXX/.cargo/registry/src/github.amrom.workers.dev-1ecc6299db9ec823/procfs-0.8.1/src/lib.rs:315:34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
To Reproduce
Directly compile the code.
Expected behavior
Qemu exporter should be started.
Environment
- Linux distribution version [Ubuntu 18.04.6 LTS]
- Kernel version (output of
uname -r) [4.19.270]
Additional context
After a deep dive, the procfs version v0.8.1 still uses u8 as the kernel version patch string, and any number larger than 256 with cause a panic. A simple workaround for me was to compile my own procfs-v0.8.1 but change the patch to u16, following this patch. A better solution would be upgrading procfs version to v0.10.0 or newer because the patch was applied to that version and above. It's not a simple fix, as procfs changed the interface from floating point numbers to integers for CPU information. Details can be found here and here.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Previous releases