Skip to content
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

Crash from attempting to display messages in one channel #87

Closed
cleeyv opened this issue Jul 18, 2021 · 0 comments
Closed

Crash from attempting to display messages in one channel #87

cleeyv opened this issue Jul 18, 2021 · 0 comments

Comments

@cleeyv
Copy link
Contributor

cleeyv commented Jul 18, 2021

Attempting to display the messages from one of my groups caused gurk to abort with the following errors:

memory allocation of 18446744073709551609 bytes failed
Thread 1 "gurk" received signal SIGABRT, Aborted.
0x00007ffff7c80d22 in raise () from /usr/lib/libc.so.6

I got a backtrace from gdb and it looked like this:

(gdb) bt
#0  0x00007f1f06468d22 in raise () from /usr/lib/libc.so.6
#1  0x00007f1f06452862 in abort () from /usr/lib/libc.so.6
#2  0x0000562b51c0d98a in std::sys::unix::abort_internal () at /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/sys/unix/mod.rs:237
#3  0x0000562b51c009e9 in std::process::abort () at /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/process.rs:1792
#4  0x0000562b51c03d20 in std::alloc::rust_oom () at /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/alloc.rs:332
#5  0x0000562b51608f7a in alloc::alloc::__alloc_error_handler::__rg_oom () at /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/alloc/src/alloc.rs:397
#6  0x0000562b515f2187 in __rust_alloc_error_handler ()
#7  0x0000562b51608f69 in alloc::alloc::handle_alloc_error () at /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/alloc/src/alloc.rs:366
#8  0x0000562b516096d0 in alloc::raw_vec::RawVec::allocate_in<u8,alloc::alloc::Global> () at /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/alloc/src/raw_vec.rs:206
#9  alloc::raw_vec::RawVec::with_capacity_in<u8,alloc::alloc::Global> () at /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/alloc/src/raw_vec.rs:142
#10 alloc::vec::Vec::with_capacity_in<u8,alloc::alloc::Global> () at /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/alloc/src/vec/mod.rs:574
#11 alloc::vec::Vec::with_capacity<u8> () at /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/alloc/src/vec/mod.rs:440
#12 alloc::slice::{{impl}}::repeat<u8> () at /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/alloc/src/slice.rs:534
#13 alloc::str::{{impl}}::repeat () at /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/alloc/src/str.rs:493
#14 0x0000562b517b211b in core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut ()
#15 0x0000562b51791e55 in <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::next ()
#16 0x0000562b517ab348 in <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter ()
#17 0x0000562b517c59f6 in gurk::ui::draw ()
#18 0x0000562b5174c2e6 in tui::terminal::Terminal<B>::draw ()
#19 0x0000562b5184b133 in gurk::run_single_threaded::_$u7b$$u7b$closure$u7d$$u7d$::hd2afcf3e81f1528e ()
#20 0x0000562b516ee9f6 in tokio::macros::scoped_tls::ScopedKey<T>::set ()
#21 0x0000562b518201f7 in <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll ()
#22 0x0000562b51727adc in tokio::runtime::enter::Enter::block_on ()
#23 0x0000562b517a378e in tokio::runtime::thread_pool::ThreadPool::block_on ()
#24 0x0000562b51862d2a in tokio::runtime::Runtime::block_on ()
#25 0x0000562b517c77d6 in gurk::main ()
#26 0x0000562b517b0c36 in std::sys_common::backtrace::__rust_begin_short_backtrace ()
#27 0x0000562b517b0c4d in std::rt::lang_start::{{closure}} ()
#28 0x0000562b51c05160 in core::ops::function::impls::{{impl}}::call_once<(),Fn<()>> () at /rustc/a143517d44cac50b20cbd3a0b579addab40dd399/library/core/src/ops/function.rs:259
#29 std::panicking::try::do_call<&Fn<()>,i32> () at /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/panicking.rs:379
#30 std::panicking::try<i32,&Fn<()>> () at /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/panicking.rs:343
#31 std::panic::catch_unwind<&Fn<()>,i32> () at /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/panic.rs:431
#32 std::rt::lang_start_internal () at /rustc/a143517d44cac50b20cbd3a0b579addab40dd399//library/std/src/rt.rs:51
#33 0x0000562b517c78b5 in main ()

Based on lines 15-18, I assumed that the issue somewhere in fn draw_messages in ui.rs.

When I built it locally, the --verbose log showed the following error:

[2021-07-18T14:52:11.760959272-04:00 ERROR log_panics] thread 'main' panicked at 'attempt to subtract with overflow': src/ui.rs:300

This was enough info for PR that seems to have fixed the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant