cjbassi / ytop

A TUI system monitor written in Rust
MIT License
2.16k stars 84 forks source link

"Cannot allocate memory" #75

Open jsatk opened 4 years ago

jsatk commented 4 years ago

Required information:

Include any of the following information if relevant:

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.

sudopseudocode commented 4 years ago

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 4 years ago

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

CosmicHorrorDev commented 4 years ago

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 4 years ago
❯ 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.

CosmicHorrorDev commented 4 years ago

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

CosmicHorrorDev commented 4 years ago

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.

CosmicHorrorDev commented 4 years ago

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 4 years ago

Thanks @LovecraftianHorror !

jsatk commented 4 years ago

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

What are y'all using in the meantime?