Skip to content

Procfs v0.8.1 does not support kernel version string larger than 256 #267

@charles-typ

Description

@charles-typ

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Previous releases

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions