Skip to content
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

panic error message #552

Open
Anto79-ops opened this issue Feb 13, 2023 · 15 comments
Open

panic error message #552

Anto79-ops opened this issue Feb 13, 2023 · 15 comments

Comments

@Anto79-ops
Copy link

Hello all,

Not sure if this is an issue or usage problem, so I wanted to reach out.

I'm trying to install and run py-spy on Home Assistant OS in the container by these commands from these instructions:

wget https://github.com/benfred/py-spy/releases/download/v0.3.12/py_spy-0.3.12-py2.py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
unzip py_spy-0.3.12-py2.py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl

However, when I to run the py-spy on the PID of interest, i get these errors:

bash-5.1# cd py_spy-0.3.14.data
bash-5.1# cd scripts
bash-5.1# ./py-spy top --pid 61
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: PosOverflow }', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-maps-0.2.1/src/linux_maps.rs:81:65
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Error: receiving on a closed channel
bash-5.1# ./py-spy top --pid 60
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: PosOverflow }', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-maps-0.2.1/src/linux_maps.rs:81:65
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Error: receiving on a closed channel

Does anyone know what these means and how to solve the problem?

thank you

@BrainInSight
Copy link

Same here

@Jongy
Copy link
Contributor

Jongy commented Mar 5, 2023

The problem is with parsing the process maps - probably of the PID you're trying to profile.

Please attach:

  • /proc/pid/maps outputs for the process you tried to profile / top, i.e cat /proc/60/maps
  • Please run with RUST_BACKTRACE=1 so we get full stack trace (so we know which field specifically failed to parse). From the line number I suppose it's range_start: usize::from_str_radix(range_start, 16).unwrap() but let's be sure.

@Anto79-ops
Copy link
Author

Anto79-ops commented Mar 5, 2023

@Jongy thank you very much for these instructions.

just a couple mentions

  1. when I tried cat /proc/66/maps (PID is now 66), there is a quite a bit of lines coming out, not sure how write to file so that I can share that with you
  2. how do I exactly do this? when I type that, it just gives me the same message
bash-5.1# ./py-spy top --pid 66 RUST_BACKTRACE=1
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: PosOverflow }', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-maps-0.2.1/src/linux_maps.rs:81:65
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Error: receiving on a closed channel
bash-5.1#

thanks for your time

@bdraco
Copy link

bdraco commented Mar 6, 2023

RUST_BACKTRACE=1 ./py-spy top --pid 66

@Anto79-ops
Copy link
Author

Anto79-ops commented Mar 6, 2023

thanks @bdraco!

here's what that command outputs (word wrapping might be weird so you'll have to scroll all the way right) :

py-spy
bash-5.1# RUST_BACKTRACE=1 ./py-spy top --pid 67

thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Par                                                      seIntError { kind: PosOverflow }', /root/.cargo/registry/src/github.com-1ecc6299                                                      db9ec823/proc-maps-0.2.1/src/linux_maps.rs:81:65
stack backtrace:
   0: rust_begin_unwind
             at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/                                                      panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src                                                      /panicking.rs:142:14
   2: core::result::unwrap_failed
             at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src                                                      /result.rs:1785:5
   3: proc_maps::linux_maps::get_process_maps
   4: py_spy::python_spy::PythonSpy::new
   5: py_spy::python_spy::PythonSpy::retry_new
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose bac                                                      ktrace.
Error: receiving on a closed channel

and just to confirm the PID of interest is now 67

image

@Jongy
Copy link
Contributor

Jongy commented Mar 6, 2023

Thanks @Anto79-ops . Getting the contents of /proc/pid/maps will help as the some "protocol" between the file and the parser is broken and having the raw contents will help understanding exactly which.

when I tried cat /proc/66/maps (PID is now 66), there is a quite a bit of lines coming out, not sure how write to file so that I can share that with you

It can be quite long indeed (depending on the amount of libraries your process has loaded), but since any of those lines can be the problematic line, we'll need the full one. You can attach it as a message in GitHub (copy the file aside, then drag and drop it to the textbox)

@BrainInSight
Copy link

Hi,

as mentioned above I have the same problems (and the same output for RUST_BACKTRACE=1 ./py-spy top --pid 66 as above). Here is the content of my /proc/66/maps.

maps.txt

@Anto79-ops
Copy link
Author

@BrainInSight could you please tell me how you wrote your maps to a file? Thanks

@Anto79-ops
Copy link
Author

Anto79-ops commented Mar 6, 2023

ok, was able to get the maps file thanks @Jongy

maps.txt

and just to be consistent, here's the RUST_BACKTRACE for the same session

bash-5.1# RUST_BACKTRACE=1 ./py-spy top --pid 68
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: PosOverflow }', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-maps-0.2.1/src/linux_maps.rs:81:65
stack backtrace:
   0: rust_begin_unwind
             at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/panicking.rs:142:14
   2: core::result::unwrap_failed
             at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/result.rs:1785:5
   3: proc_maps::linux_maps::get_process_maps
   4: py_spy::python_spy::PythonSpy::new
   5: py_spy::python_spy::PythonSpy::retry_new
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Error: receiving on a closed channel
bash-5.1#

image

@Anto79-ops
Copy link
Author

Hi @Jongy wondering if you had a chance to look the logs, and perhaps see a resolution. Thanks for your help and time.

@Jongy
Copy link
Contributor

Jongy commented Mar 23, 2023

Hi @Anto79-ops haven't had the chance yet, I'll update once I do :)

I did try meanwhile to run proc-maps crate on v0.2.1 (used by py-spy) and on master with your file from here and @BrainInSight 's file from here. Both manage to parse correctly so I might be doing something wrong :/ will continue testing it thoroughly once I find the time.

@Anto79-ops
Copy link
Author

Thank you @Jongy anytime you put to this issue is greatly appreciated.

@pimw1
Copy link

pimw1 commented Apr 3, 2023

Hi, i'm facing the same issue. See below the ouput of backtrace=1 . I hope this might help to find the issue.

bash-5.1# RUST_BACKTRACE=1 ./py-spy top --pid 66
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: PosOverflow }', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-maps-0.2.1/src/linux_maps.rs:81:65
stack backtrace:
   0: rust_begin_unwind
             at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/panicking.rs:142:14
   2: core::result::unwrap_failed
             at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/result.rs:1785:5
   3: proc_maps::linux_maps::get_process_maps
   4: py_spy::python_spy::PythonSpy::new
   5: py_spy::python_spy::PythonSpy::retry_new

@Anto79-ops
Copy link
Author

any luck on a solution for this issue? thank you

@JampireX
Copy link

JampireX commented Jan 9, 2024

I have the same backtrace. Attaching my maps.
maps.txt

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

6 participants