markbt / streampager

A pager for command output or large files
MIT License
45 stars 11 forks source link

`sp -c 'find / -ls'` crashes out quickly #3

Closed jsgf closed 5 years ago

jsgf commented 5 years ago

The output blinks up for a moment, and then sp exits with status 101. Capturing its stderr with RUST_BACKTRACE=1 shows:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 11, kind: WouldBlock, message: "Resource temporarily unavailable" }

stack backtrace:
   0: failure::backtrace::internal::InternalBacktrace::new::ha5b2d1e22b191585 (0x55d810d8969f)
   1: failure::backtrace::Backtrace::new::he8937a7fff317027 (0x55d810d8985f)
   2: termwiz::render::terminfo::TerminfoRenderer::render_to::h1f07d18ac39d9fe2 (0x55d810d708fb)
   3: <scopeguard::ScopeGuard<T,F,S> as core::ops::drop::Drop>::drop::hd48c53cfe7245430 (0x55d810cab9f7)
   4: sp::display::start::h872c19cf01890326 (0x55d810c7dd4b)
   5: sp::main::hf9503f69d76a8afe (0x55d810c68691)
   6: std::rt::lang_start::{{closure}}::h4bf6a73ded644694 (0x55d810c7a872)
   7: {{closure}} (0x55d810e09792)
             at src/libstd/rt.rs:49
      do_call<closure,i32>
             at src/libstd/panicking.rs:293
   8: __rust_maybe_catch_panic (0x55d810e11299)
             at src/libpanic_unwind/lib.rs:87
   9: try<i32,closure> (0x55d810e0a29c)
             at src/libstd/panicking.rs:272
      catch_unwind<closure,i32>
             at src/libstd/panic.rs:388
      lang_start_internal
             at src/libstd/rt.rs:48
  10: main (0x55d810c6d621)
  11: __libc_start_main (0x7f104c826f32)
  12: _start (0x55d810c6122d)
  13: <unknown> (0x0)', src/libcore/result.rs:997:5

This error is coming out of termwiz, so maybe its a bug there? It looks like its failing with EAGAIN, presumably while writing to a non-blocking terminal fd. (cc @wez)

This is on Fedora 30, stable Rust.

wez commented 5 years ago

Yep, was a termwiz issue; #5 will pick up the fix for this.

jsgf commented 5 years ago

Yep, looks good to me.