vhakulinen / gnvim

GUI for neovim, without any web bloat
MIT License
1.85k stars 69 forks source link

Crashes from time to time #127

Closed masaeedu closed 4 years ago

masaeedu commented 4 years ago

Hello there. Thanks for setting up this nice GUI frontend, I've been missing something like this for a while.

I've been running into issues where gnvim crashes from time to time with a trace like this:

➜  mcpanel git:(master) ✗ RUST_BACKTRACE=1 gnvim
Gtk-Message: 21:33:42.988: Failed to load module "canberra-gtk-module"
Fontconfig warning: "/etc/fonts/fonts.conf", line 5: unknown element "its:rules"
Fontconfig warning: "/etc/fonts/fonts.conf", line 6: unknown element "its:translateRule"
Fontconfig error: "/etc/fonts/fonts.conf", line 6: invalid attribute 'translate'
Fontconfig error: "/etc/fonts/fonts.conf", line 6: invalid attribute 'selector'
Fontconfig error: "/etc/fonts/fonts.conf", line 7: invalid attribute 'xmlns:its'
Fontconfig error: "/etc/fonts/fonts.conf", line 7: invalid attribute 'version'
Fontconfig warning: "/etc/fonts/fonts.conf", line 9: unknown element "description"
Fontconfig error: Cannot load config file from /etc/fonts/fonts.conf
Not supported option set: arabicshape
Not supported option set: ambiwidth
Not supported option set: emoji
Not supported option set: guifontset
Not supported option set: guifontwide
Not supported option set: pumblend
Not supported option set: showtabline
Not supported option set: termguicolors
Not supported option set: ext_linegrid
Not supported option set: ext_multigrid
Not supported option set: ext_hlstate
Not supported option set: ext_termcolors
Received unknown redraw event: hl_group_set
Not supported option set: ext_cmdline
Not supported option set: ext_popupmenu
Not supported option set: ext_tabline
Not supported option set: ext_wildmenu
Not supported option set: ext_messages
Not supported option set: termguicolors
Not supported option set: termguicolors
Received unknown redraw event: hl_group_set
Received unknown redraw event: update_menu
Not supported option set: showtabline
Received unknown redraw event: hl_group_set
Not supported option set: ext_cmdline
Not supported option set: ext_popupmenu
Not supported option set: ext_tabline
Not supported option set: ext_wildmenu
Not supported option set: ext_messages
Not supported option set: ext_cmdline
Not supported option set: ext_popupmenu
Not supported option set: ext_tabline
Not supported option set: ext_wildmenu
Not supported option set: ext_messages
Failed to turn input event into nvim key (keyval: 65505)
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { domain: gdk-pixbuf-error-quark, code: 3, message: "Unrecognized image file format" }', src/libcore/result.rs:1165:5
stack backtrace:
   0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::default_hook
   5: std::panicking::rust_panic_with_hook
   6: std::panicking::continue_panic_fmt
   7: rust_begin_unwind
   8: core::panicking::panic_fmt
   9: core::result::unwrap_failed
  10: gnvim::ui::popupmenu::completion_item_widget::get_icon_pixbuf
  11: gnvim::ui::popupmenu::completion_item_widget::CompletionItemWidgetWrap::create
  12: glib::source::trampoline
  13: g_main_context_dispatch
  14: g_main_context_iterate.isra.26
  15: g_main_context_iteration
  16: g_application_run
  17: <O as gio::application::ApplicationExtManual>::run
  18: gnvim::main
  19: std::rt::lang_start::{{closure}}
  20: std::panicking::try::do_call
  21: __rust_maybe_catch_panic
  22: std::rt::lang_start_internal
  23: main
  24: __libc_start_main
  25: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
➜  mcpanel git:(master)

I can't be 100% sure because the crash is really abrupt, but I believe it's happening whenever it tries to open a completion popup.

I don't have any Rust expertise, so I'm not sure what's going on here, but I thought I'd open an issue to report the crash.

smolck commented 4 years ago

Hello! Thanks for opening this issue! Reading the stacktrace it appears that the crash is occurring in the get_icon_pixbuf function. Probably failing at the .unwrap() call here (only call to .unwrap() in the function): https://github.com/vhakulinen/gnvim/blob/65846f45020b338fedd932b058c9e8036dadd976/src/ui/popupmenu/completion_item_widget.rs#L121-L123

Makes sense that this would happen when opening a completion popup, because it's part of what needs to happen when doing that action. What plugin are you using for completion?

Also, what are the outputs of nvim --version and gnvim --version?

masaeedu commented 4 years ago

@smolck Here's the version numbers:

➜  mcpanel git:(master) nvim --version; gnvim --version
NVIM v0.4.3
Build type: Release
LuaJIT 2.1.0-beta3
Compilation:
Compiled by nixbld

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "
/nix/store/f9rrfphl5fk1irb1gq8f4acll8dlw9rp-neovim-unwrapped-0.4.3/share/nvim
"

Run :checkhealth for more info
gnvim 0.1.5

The plugin I'm using is coc.nvim.

smolck commented 4 years ago

Could you comment out your init.vim and see if the problem still occurs?

Can't seem to reproduce this issue on my machine, but I'm using neovim-nightly. Would you mind also testing this with the latest master of neovim to see if it's an upstream issue with neovim 0.4.3? (I see you're using Nix, so if yes, I can post an overlay I use on NixOS to compile and install neovim master from source if you need/want it.)

smolck commented 4 years ago

@masaeedu Are you still experiencing this issue?

masaeedu commented 4 years ago

@smolck Unfortunately I stopped using gnvim so I can't say. I appreciate your offer to provide an overlay I can test this out with but my current editor set up is held together with duct tape, peanut butter and prayers, and I don't have the time to fix stuff at the moment. Sorry I can't be of more help at the moment.

smolck commented 4 years ago

@masaeedu No problem! If you do start using GNvim again and experience this issue, please don’t hesitate to re-open this issue or create a new one!

afreakk commented 4 years ago

Hi, Im experiencing the same issue, also using coc.nvim, When I commented out my whole init.vim file, it didnt happen anymore.

But id like to use coc.nvim, so hopefully this gets fixed.

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { domain: gdk-pixbuf-error-quark, code: 3, message: "Unrecognized image file format" }', src/ui/popupmenu/completion_item_widget.rs:122:9
stack backtrace:
   0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::default_hook
   5: std::panicking::rust_panic_with_hook
   6: rust_begin_unwind
   7: core::panicking::panic_fmt
   8: core::result::unwrap_failed
   9: gnvim::ui::popupmenu::completion_item_widget::get_icon_pixbuf
  10: gnvim::ui::popupmenu::completion_item_widget::CompletionItemWidgetWrap::create
  11: glib::source::trampoline
  12: g_main_context_dispatch
  13: g_main_context_iterate.isra.0
  14: g_main_context_iteration
  15: g_application_run
  16: <O as gio::application::ApplicationExtManual>::run
  17: gnvim::main
  18: std::rt::lang_start::{{closure}}
  19: std::panicking::try::do_call
  20: __rust_maybe_catch_panic
  21: std::rt::lang_start_internal
  22: main
  23: __libc_start_main
  24: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

gnvim 0.1.6 NVIM v0.4.3 I am also using nixos, and installed it with this package: https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/neovim/gnvim/default.nix

(and it seems maybe masaeedu also uses nix, so might be related)

vhakulinen commented 4 years ago

I guess that your system doesn't have required svg related libraries preset. For reference: https://github.com/NixOS/nixpkgs/issues/13537#issuecomment-332327760. I'm not too familiar with nixos, but does that comment ring any bells?