retis-org / retis

Tracing packets in the Linux networking stack & friends
https://retis.readthedocs.io/en/stable/
100 stars 14 forks source link

collect errors out with "Error: invalid digit found in string" #241

Closed pspacek closed 1 year ago

pspacek commented 1 year ago

Summary

tools/retis_in_container.sh collect errors out with "Error: invalid digit found in string"

Environment

Steps to reproduce

Output

Error: invalid digit found in string

I've tried to add --log-level debug but it does not extend the output.

I'm at loss what else to provide, but I'm happy to add more info if you tell me what's needed.

pspacek commented 1 year ago

I have big trouble debugging this using GDB or LLDB because GDB crashes on me constantly, and LLDB does not show me the right level of detail (but I admit I'm using it for the first time ...).

Anyway, I sense this might have something to do with Inspector constructor.

Content of /etc/os-release on my system:

NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://bugs.archlinux.org/"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo

parse_os_info() returns: Ok Some("arch"), None

pspacek commented 1 year ago

Poking at it bit more, it seems the last line it executes is

let version = KernelVersion::new()?;

GDB is crashing on me so I'm not able tell what exactly is going on here.

Anyway,

$ uname -a
Linux p 6.4.12-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 24 Aug 2023 00:38:14 +0000 x86_64 GNU/Linux
pspacek commented 1 year ago

On line 51 Ok(UtsName(ret.assume_init())) the ret value is:

(core::mem::maybe_uninit::MaybeUninit<libc::unix::linux_like::utsname>) $13 = {
  value = {
    value = {
      sysname = "Linux"
      nodename = "p"
      release = "6.4.12-arch1-1"
      version = "#1 SMP PREEMPT_DYNAMIC Thu, 24 Aug 2023 00:38:14 +0000"
      machine = "x86_64"
      domainname = "(none)"
    }
  }
}

and indeed it seems that the kernel version is what's causing the explosion.

amorenoz commented 1 year ago

@pspacek Thanks for reporting and for the initial analysis. Indeed, it seems the kernel version convention used in Arch is not being parsed properly.

amorenoz commented 1 year ago

Still trying to figure out if this is the right solution, but in the time being, could you please check if this fixes your issue? https://github.com/retis-org/retis/pull/242