AMythicDev / minus

An asynchronous, runtime data feedable terminal paging library for Rust
https://crates.io/crates/minus/
Apache License 2.0
317 stars 23 forks source link

Panic at runtime: minus-5.5.2/src/core/init.rs:121:9 - Failed to set the RUNMODE when using minus 5.5.2 #126

Closed Sam-Sims closed 8 months ago

Sam-Sims commented 8 months ago

Hello!

Describe the bug When compiling with 5.5.2 and running using dynamic_output, I get a panic at runtime, which can be recreated using the less-rs example. This does not happen when compiling with 5.5.1.

Full stack trace:

thread '<unnamed>' panicked at /home/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/minus-5.5.2/src/core/init.rs:121:9:
Failed to set the RUNMODE. This is caused probably because another instance of minus is already running
stack backtrace:
   0: std::panicking::begin_panic
   1: minus::minus_core::init::init_core
   2: minus::dynamic_pager::dynamic_paging
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
thread 'main' panicked at src/main.rs:28:17:
called `Result::unwrap()` on an `Err` value: Any { .. }
stack backtrace:
   0: rust_begin_unwind
             at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/panicking.rs:597:5
   1: core::panicking::panic_fmt
             at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/core/src/panicking.rs:72:14
   2: core::result::unwrap_failed
             at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/core/src/result.rs:1652:5
   3: fatcat::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

To Reproduce I can recreate this error with the less-rs example and minus 5.5.2.

Expected behaviour Contents of file paged to terminal.

Desktop:

Please let me know if I missed any information, I can workaround this by using 5.5.1.

AMythicDev commented 8 months ago

Apparently the code checking RUNMODE was duplicated and the second instance of it was present after we set RUNMODE to the desired value. This duplication appeared while resolving a merge conflict hence I wasn't able to recreate it on main. Anyway I have fixed it and will put out a release in a while. Thanks for filing the issue.

Sam-Sims commented 8 months ago

Great thanks for the speedy response!

AMythicDev commented 8 months ago

I am also yanking 5.5.2 so that people avoid the buggy release.

AMythicDev commented 8 months ago

BTW I released v5.5.3 so you can try that one out.

Sam-Sims commented 8 months ago

5.5.3 fixes this, thanks again