-
-
Notifications
You must be signed in to change notification settings - Fork 36
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: "thread 'main' panicked at 'attempt to subtract with overflow'" #8
Comments
confirm v0.4.1 bugs (Manjaro), v0.4.0 - works good. RUST_BACKTRACE=1 ./so how to setup async rust
thread 'main' panicked at 'byte index 18446744073709551615 is out of bounds of ` function](https://github.com/rust-lang-nursery/futures-rs/blob/0.3.1/futures-util/src/future/
`', /rust/lib/rustlib/src/rust/src/libcore/str/mod.rs:2052:47
stack backtrace:
0: backtrace::backtrace::libunwind::trace
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
1: backtrace::backtrace::trace_unsynchronized
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
2: std::sys_common::backtrace::_print_fmt
at src/libstd/sys_common/backtrace.rs:78
3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
at src/libstd/sys_common/backtrace.rs:59
4: core::fmt::write
at src/libcore/fmt/mod.rs:1069
5: std::io::Write::write_fmt
at src/libstd/io/mod.rs:1504
6: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:62
7: std::sys_common::backtrace::print
at src/libstd/sys_common/backtrace.rs:49
8: std::panicking::default_hook::{{closure}}
at src/libstd/panicking.rs:198
9: std::panicking::default_hook
at src/libstd/panicking.rs:218
10: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:511
11: rust_begin_unwind
at src/libstd/panicking.rs:419
12: core::panicking::panic_fmt
at src/libcore/panicking.rs:111
13: core::str::slice_error_fail
at src/libcore/str/mod.rs:0
14: core::str::traits::<impl core::slice::SliceIndex<str> for core::ops::range::RangeFrom<usize>>::index::{{closure}}
15: termimad::wrap::hard_wrap_composite
16: termimad::text::FmtText::from_text
17: so::term::Term::print
18: so::run::{{closure}}
19: std::thread::local::LocalKey<T>::with
20: so::main
21: std::rt::lang_start_internal::{{closure}}::{{closure}}
at src/libstd/rt.rs:52
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. although other requests work fine |
@Ethan3600 Thanks for the issue. Unfortunately I'm having trouble reproducing it, but it seems to be coming from And yes I desperately need to add logging and debug flags 🙈 @D1mon Are you positive? I'm not sure how that could be; while I did do some refactoring / reorganization around printing, for both v0.4.0 and v0.4.1 we call |
@samtay thanks for explaining that! Here's what I got from running the query again: (it actually prints out a lot more stuff, but it looks like there's a bunch of markdown from stackoverflow) Terminal size: Ok((190, 51))
Calling skin.print_text with: BEGIN
(removed the stuff that came back from stackoverflow)
END
thread 'main' panicked at 'attempt to subtract with overflow', /home/eyehuda/.cargo/registry/src/github.com-1ecc6299db9ec823/minimad-0.6.4/src/compound.rs:117:19
stack backtrace:
0: backtrace::backtrace::libunwind::trace
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
1: backtrace::backtrace::trace_unsynchronized
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
2: std::sys_common::backtrace::_print_fmt
at src/libstd/sys_common/backtrace.rs:78
3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
at src/libstd/sys_common/backtrace.rs:59
4: core::fmt::write
at src/libcore/fmt/mod.rs:1076
5: std::io::Write::write_fmt
at src/libstd/io/mod.rs:1537
6: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:62
7: std::sys_common::backtrace::print
at src/libstd/sys_common/backtrace.rs:49
8: std::panicking::default_hook::{{closure}}
at src/libstd/panicking.rs:198
9: std::panicking::default_hook
at src/libstd/panicking.rs:217
10: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:526
11: rust_begin_unwind
at src/libstd/panicking.rs:437
12: core::panicking::panic_fmt
at src/libcore/panicking.rs:85
13: core::panicking::panic
at src/libcore/panicking.rs:50
14: minimad::compound::Compound::cut_tail
at /home/eyehuda/.cargo/registry/src/github.com-1ecc6299db9ec823/minimad-0.6.4/src/compound.rs:117
15: termimad::wrap::hard_wrap_composite
at /home/eyehuda/.cargo/registry/src/github.com-1ecc6299db9ec823/termimad-0.8.24/src/wrap.rs:137
16: termimad::wrap::hard_wrap_lines
at /home/eyehuda/.cargo/registry/src/github.com-1ecc6299db9ec823/termimad-0.8.24/src/wrap.rs:172
17: termimad::text::FmtText::from_text
at /home/eyehuda/.cargo/registry/src/github.com-1ecc6299db9ec823/termimad-0.8.24/src/text.rs:44
18: termimad::text::FmtText::from
at /home/eyehuda/.cargo/registry/src/github.com-1ecc6299db9ec823/termimad-0.8.24/src/text.rs:32
19: termimad::skin::MadSkin::term_text
at /home/eyehuda/.cargo/registry/src/github.com-1ecc6299db9ec823/termimad-0.8.24/src/skin.rs:208
20: termimad::skin::MadSkin::print_text
at /home/eyehuda/.cargo/registry/src/github.com-1ecc6299db9ec823/termimad-0.8.24/src/skin.rs:243
21: so::term::Term::print
at src/term.rs:52
22: so::run::{{closure}}
at src/main.rs:86
23: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
at /home/eyehuda/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/future/mod.rs:74
24: tokio::runtime::enter::Enter::block_on::{{closure}}
at /home/eyehuda/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.21/src/runtime/enter.rs:163
25: tokio::coop::with_budget::{{closure}}
at /home/eyehuda/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.21/src/coop.rs:127
26: std::thread::local::LocalKey<T>::try_with
at /home/eyehuda/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/thread/local.rs:263
27: std::thread::local::LocalKey<T>::with
at /home/eyehuda/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/thread/local.rs:239
28: tokio::coop::with_budget
at /home/eyehuda/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.21/src/coop.rs:120
29: tokio::coop::budget
at /home/eyehuda/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.21/src/coop.rs:96
30: tokio::runtime::enter::Enter::block_on
at /home/eyehuda/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.21/src/runtime/enter.rs:163
31: tokio::runtime::thread_pool::ThreadPool::block_on
at /home/eyehuda/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.21/src/runtime/thread_pool/mod.rs:82
32: tokio::runtime::Runtime::block_on::{{closure}}
at /home/eyehuda/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.21/src/runtime/mod.rs:446
33: tokio::runtime::context::enter
at /home/eyehuda/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.21/src/runtime/context.rs:72
34: tokio::runtime::handle::Handle::enter
at /home/eyehuda/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.21/src/runtime/handle.rs:76
35: tokio::runtime::Runtime::block_on
at /home/eyehuda/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.21/src/runtime/mod.rs:441
36: so::main
at src/main.rs:21
37: std::rt::lang_start::{{closure}}
at /home/eyehuda/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/rt.rs:67
38: std::rt::lang_start_internal::{{closure}}
at src/libstd/rt.rs:52
39: std::panicking::try::do_call
at src/libstd/panicking.rs:348
40: std::panicking::try
at src/libstd/panicking.rs:325
41: std::panic::catch_unwind
at src/libstd/panic.rs:394
42: std::rt::lang_start_internal
at src/libstd/rt.rs:51
43: std::rt::lang_start
at /home/eyehuda/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/rt.rs:67
44: main
45: __libc_start_main
46: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. |
Oh, I actually wanted to see what's between the BEGIN & END tags; this is what |
Whoops! Sorry! Here it is (sorry if github is interpreting the markdown. Couldn't find a way to make it ignore it):
|
Awesome, thanks @Ethan3600 this is super helpful. |
sorry v0.4.0 - same error on query: |
Thanks for the quick turnaround. Seems to work on v0.4.2! This is such an awesome tool! Now I can ask my newbie Rust questions in style 😎 |
Describe the bug
The following command results in a the program crashing with the error
thread 'main' panicked at 'attempt to subtract with overflow
so how to setup async rust
To Reproduce
Steps to reproduce the behavior:
so how to setup async rust
Environment
so --version
: so 0.4.1Additional context
I was able to make the error go away by doing the following:
Going to be honest with you here.. I don't Rust very well (tyring my best to learn!) and I have zero clue what the difference is between
print_text
andprint_inline
is. Just wanted to throw that out there though.Stack trace:
The text was updated successfully, but these errors were encountered: