ahodesuka / ahoviewer

A GTK image viewer, manga reader, and booru browser
MIT License
479 stars 30 forks source link

GTK3 version crashes when removing text from search field #105

Closed pizzadude closed 3 years ago

pizzadude commented 3 years ago

The GTK3 version of ahoviewer crashes immediately after typing something into the search field, and then deleting the search term by pressing backspace a few times. This is on Fedora 32 KDE.

Terminal output:

/usr/bin/ahoviewer 
Gtk-Message: 10:58:37.613: Failed to load module "appmenu-gtk-module"
Using videosink of type 'xvimagesink'

(ahoviewer:1840669): Gtk-WARNING **: 10:58:37.899: Attempting to read the recently used resources file at '/home/user/.local/share/recently-used.xbel', but the parser failed: Error reading file “/home/user/.local/share/recently-used.xbel”: Is a directory.
/builddir/build/BUILD/gcc-10.2.1-20200723/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/bits/basic_string.h:1116: std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::back() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference = char&]: Assertion '!empty()' failed.
Aborted (core dumped)

So for now I have to use the gtk2 branch.

ahodesuka commented 3 years ago

I can't reproduce this when compiling with gcc-9.3.0 or clang-10.0.0, and can't really see what's going on without a full backtrace.

ahodesuka commented 3 years ago

Installed gcc-10.2.1 and still can't reproduce this.

pizzadude commented 3 years ago

I get the same error even if I build with clang.

ahodesuka commented 3 years ago

Is the crash occurring when the tag entry is empty (after deleting all the text in it)? Or is it just randomly when hitting backspace?

ahodesuka commented 3 years ago

Check if 518c20c (master) fixes this

pizzadude commented 3 years ago

@ahodesuka Thanks, that fixes it. And yes, the problem occured when the tag entry was empty, after deleting the text in it.