cjbassi/ytop

"Cannot allocate memory"

jsatk opened this issue · 9 comments

jsatk commented

Required information:

  • ytop version (ytop -V): 0.6.0
  • The output of uname -a: Darwin C02ZH2XRLVDR 19.4.0 Darwin Kernel Version 19.4.0: Wed Mar 4 22:28:40 PST 2020; root:xnu-6153.101.6~15/RELEASE_X86_64 x86_64

Include any of the following information if relevant:

  • Terminal emulator (e.g. iTerm or gnome terminal): iTerm 3.3.9
  • tmux version (tmux -V): 3.1

Error:

$ ytop

Backtrace omitted. Run with RUST_BACKTRACE=1 to display it.
Run with RUST_BACKTRACE=full to include source snippets.

The application panicked (crashed).
  called `Result::unwrap()` on an `Err` value: OsError { source: Os { code: 12, kind: Other, message: "Cannot allocate memory" } }
in src/widgets/proc.rs, line 217
thread: main

image

Was a gotop user. Saw it was no longer maintained. Decided to try this. Crashes within three seconds or so.

I can confirm I am also having this issue, it crashes after 10-30 seconds for me.

Also using iTerm and tmux. macOS Catalina 10.15.4. Using ytop version 0.6.1.

hiepd commented

I am having this issue with Alacritty and tmux. macOS Catalina 10.15. ytop version 0.6.2.

I just got ahold of a mac to try and reproduce this and didn't have any luck. If any of you all can still consistently reproduce this could you build with debug info and run with RUST_BACKTRACE=full that would really help out for trying to track it down.

hiepd commented
❯ RUST_BACKTRACE=full ytop
Backtrace (most recent call first):
  File "<unknown>", line 0, in <ytop::widgets::proc::ProcWidget as ytop::update::UpdatableWidget>::update
  File "<unknown>", line 0, in ytop::update::update_widgets
  File "<unknown>", line 0, in ytop::main
  File "<unknown>", line 0, in std::rt::lang_start::{{closure}}
  File "<unknown>", line 0, in std::panicking::try::do_call
  File "<unknown>", line 0, in __rust_maybe_catch_panic
  File "<unknown>", line 0, in std::rt::lang_start_internal
  File "<unknown>", line 0, in main

The application panicked (crashed).
  called `Result::unwrap()` on an `Err` value: OsError { source: Os { code: 12, kind: Other, message: "Cannot allocate memory" } }
in src/widgets/proc.rs, line 217
thread: main

Alacritty and tmux. macOS Catalina 10.15. ytop version 0.6.2.

Thanks for the backtrace, but the debug info has been stripped. If someone wouldn't mind rebuilding the program with debug info then that would really help. It would require cargo to build and will require adding

[profile.release]
debug = true

To the bottom of Cargo.toml. From there you can run it with RUST_BACKTRACE=full cargo run --release

I was able to find the source of the problem and reproduce it on a friends mac. Ill be opening a pull request later today to fix it, so no need for debug information.

I've opened rust-psutil/rust-psutil#80 to address this issue, but we have to:

  1. Wait for the PR to get merged
  2. Wait for a new release of psutil
  3. Update the psutil and Cargo.lock file here

So it'll still be a while before this is fully fixed.

hiepd commented

Thanks @LovecraftianHorror !

jsatk commented

Thanks @LovecraftianHorror. This is also affecting htop as well it seems.

What are y'all using in the meantime?