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

Freeze when opening neo-tree (?) #2234

Closed
Jomik opened this issue Jan 3, 2024 · 3 comments · Fixed by #2247
Closed

Freeze when opening neo-tree (?) #2234

Jomik opened this issue Jan 3, 2024 · 3 comments · Fixed by #2247
Assignees
Labels
bug Something isn't working

Comments

@Jomik
Copy link

Jomik commented Jan 3, 2024

Describe the bug
When I open my Go project, dotfiles or pretty much any project. I can open individual files, but as soon as I open neo-tree it freezes. I cannot resize the window or anything.
I initially believed it to be any project, because it freezes as soon as I open a directory.
But I do believe it is something to do with the rendering that happens when neo-tree is opened.
I do not have the error in Neovide 0.11.2

To Reproduce
Steps to reproduce the behavior:

  1. Open a project folder with neovide ~/projects/foo, open neo-tree
  2. Observe frozen Neovide screen.

Expected behavior
Neovide to show neovim as normal :)

Screenshots
image

Desktop (please complete the following information):

  • OS: MacOS 14.2.1
  • Neovide Version: 0.12.0
  • Neovim Version: NVIM v0.10.0-dev-2021+gee2127363-Homebrew

Please run neovide --log and paste the contents of the .log file created in the current directory here:
They are quite long, made a gist : https://gist.github.com/Jomik/e90f9b0460caa76e7f2ef3fccc9af5ee

Additional context
Add any other context about the problem here.

@Jomik Jomik added the bug Something isn't working label Jan 3, 2024
@fredizzimo
Copy link
Member

I don't know why it happens, I haven't seen those issues with neo-tree myself. But grid 5 neotree keeps increasing in hight every "frame", making grid 6 eventually becoming 0 height and crashing.

This should have been fixed by

But apparently there's some cases missing. The neovide_backtraces.log does not give much information though, due to missing symbols. Is it possible for you to do a produce a log from a debug build? I'm not sure if it's easily reproducable by others, there might be some interaction with another plugin that causes it.

To run a debug build you can just do cargo run -- --log, if you are able to build from source, debug is the default.

@Kethku Kethku self-assigned this Jan 4, 2024
@Mentalist
Copy link
Contributor

Mentalist commented Jan 7, 2024

Experiencing (almost) the same issue (mine instantly crashes), it happens when launching an instance of neovide with a directory path as argument or when triggering Neo-tree.nvim manually. This behavior is not reproducible in the kitty and alacritty terminal emulators nor Neovim-Qt.

  • OS: Arch Linux (Kernel 6.6.10-arch-1-1)
  • Neovide Version: 0.12.1
  • Neovim Version: v0.10.0-dev-2048+g367e52cc79

Commands:

$ RUST_BACKTRACE=1 cargo run -- --log ./ # instant crash
$ RUST_BACKTRACE=1 cargo run -- --log # crash on toggle Neo-tree.nvim
neovide_backtrace.log
2024-01-07 21:11:45 - Neovide panicked with the message 'attempt to calculate the remainder with a divisor of zero'. (File: /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/core/src/num/mod.rs; Line: 455, Column: 5)
 0: neovide::main::{{closure}}
           at src/main.rs:78:25
 1: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/alloc/src/boxed.rs:2029:9
    std::panicking::rust_panic_with_hook
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/std/src/panicking.rs:783:13
 2: std::panicking::begin_panic_handler::{{closure}}
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/std/src/panicking.rs:649:13
 3: std::sys_common::backtrace::__rust_end_short_backtrace
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/std/src/sys_common/backtrace.rs:171:18
 4: rust_begin_unwind
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/std/src/panicking.rs:645:5
 5: core::panicking::panic_fmt
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/core/src/panicking.rs:72:14
 6: core::panicking::panic
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/core/src/panicking.rs:144:5
 7: core::num::<impl isize>::rem_euclid
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/core/src/num/int_macros.rs:2216:21
 8: neovide::utils::ring_buffer::RingBuffer<T>::get_array_index
           at src/utils/ring_buffer.rs:89:9
 9: <neovide::utils::ring_buffer::RingBufferIterMut<T> as core::iter::traits::iterator::Iterator>::next
           at src/utils/ring_buffer.rs:149:27
10: core::ops::function::FnOnce::call_once
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/core/src/ops/function.rs:250:5
11: core::iter::adapters::fuse::and_then_or_clear
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/core/src/iter/adapters/fuse.rs:443:13
12: <core::iter::adapters::fuse::Fuse<I> as core::iter::adapters::fuse::FuseImpl<I>>::next
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/core/src/iter/adapters/fuse.rs:275:9
13: <core::iter::adapters::fuse::Fuse<I> as core::iter::traits::iterator::Iterator>::next
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/core/src/iter/adapters/fuse.rs:46:9
    <core::iter::adapters::flatten::FlattenCompat<I,U> as core::iter::traits::iterator::Iterator>::next
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/core/src/iter/adapters/flatten.rs:601:29
14: <core::iter::adapters::flatten::Flatten<I> as core::iter::traits::iterator::Iterator>::next
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/core/src/iter/adapters/flatten.rs:290:9
15: neovide::renderer::rendered_window::RenderedWindow::prepare_lines
           at src/renderer/rendered_window.rs:751:21
16: neovide::renderer::Renderer::prepare_lines::{{closure}}
           at src/renderer/mod.rs:298:32
17: core::iter::traits::iterator::Iterator::for_each::call::{{closure}}
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/core/src/iter/traits/iterator.rs:855:29
18: core::iter::traits::iterator::Iterator::fold
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/core/src/iter/traits/iterator.rs:2640:21
19: core::iter::traits::iterator::Iterator::for_each
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/core/src/iter/traits/iterator.rs:858:9
20: neovide::renderer::Renderer::prepare_lines
           at src/renderer/mod.rs:296:9
21: neovide::window::window_wrapper::WinitWindowWrapper::animate_frame
           at src/window/window_wrapper.rs:394:9
22: neovide::window::update_loop::UpdateLoop::animate
           at src/window/update_loop.rs:165:16
23: neovide::window::update_loop::UpdateLoop::step
           at src/window/update_loop.rs:225:25
24: neovide::window::main_loop::{{closure}}
           at src/window/mod.rs:305:44
25: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/core/src/ops/function.rs:294:13
26: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/core/src/ops/function.rs:294:13
27: winit::platform_impl::platform::wayland::event_loop::EventLoop<T>::single_iteration
           at /home/REDACTED/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/platform_impl/linux/wayland/event_loop/mod.rs:520:9
28: winit::platform_impl::platform::wayland::event_loop::EventLoop<T>::poll_events_with_timeout
           at /home/REDACTED/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/platform_impl/linux/wayland/event_loop/mod.rs:323:9
29: winit::platform_impl::platform::wayland::event_loop::EventLoop<T>::pump_events
           at /home/REDACTED/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/platform_impl/linux/wayland/event_loop/mod.rs:237:13
30: winit::platform_impl::platform::wayland::event_loop::EventLoop<T>::run_on_demand
           at /home/REDACTED/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/platform_impl/linux/wayland/event_loop/mod.rs:201:19
31: winit::platform_impl::platform::EventLoop<T>::run_on_demand
           at /home/REDACTED/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/platform_impl/linux/mod.rs:821:56
32: winit::platform_impl::platform::EventLoop<T>::run
           at /home/REDACTED/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/platform_impl/linux/mod.rs:814:9
33: winit::event_loop::EventLoop<T>::run
           at /home/REDACTED/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.4/src/event_loop.rs:249:9
34: neovide::window::main_loop
           at src/window/mod.rs:296:5
35: neovide::main
           at src/main.rs:98:13
36: core::ops::function::FnOnce::call_once
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/core/src/ops/function.rs:250:5
37: std::sys_common::backtrace::__rust_begin_short_backtrace
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/std/src/sys_common/backtrace.rs:155:18
38: std::rt::lang_start::{{closure}}
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/std/src/rt.rs:166:18
39: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/core/src/ops/function.rs:284:13
    std::panicking::try::do_call
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/std/src/panicking.rs:552:40
    std::panicking::try
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/std/src/panicking.rs:516:19
    std::panic::catch_unwind
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/std/src/panic.rs:142:14
    std::rt::lang_start_internal::{{closure}}
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/std/src/rt.rs:148:48
    std::panicking::try::do_call
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/std/src/panicking.rs:552:40
    std::panicking::try
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/std/src/panicking.rs:516:19
    std::panic::catch_unwind
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/std/src/panic.rs:142:14
    std::rt::lang_start_internal
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/std/src/rt.rs:148:20
40: std::rt::lang_start
           at /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/std/src/rt.rs:165:17
41: main
42: <unknown>
43: __libc_start_main
44: _start

@fredizzimo
Copy link
Member

fredizzimo commented Jan 8, 2024

I don't have access to a development environment for a couple of more weeks, but the fix should be easy for anyone that wants to send a PR.

Just add the following check if !self.scrollback_lines.is_empty() around

for line in self
.scrollback_lines
.iter_range_mut(scroll_offset_lines..scroll_offset_lines + height + 1)
.flatten()
{
prepare_line(line)
}

The check here is no longer enough due to the borders not being part of the scrollback

if height == 0 {
return;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants