ahodesuka / ahoviewer

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

Segmentation fault on start (Wayland) #109

Closed Erhannis closed 3 years ago

Erhannis commented 3 years ago

I've built from source, and I get a segmentation fault when I try to start the program. No warnings, no explanations, no log files, just

$ ahoviewer 
Segmentation fault
$

I'm at a bit of a loss as to what to do.

I'm on Debian 10.3, GNOME 3.30.2 ... using Wayland, I think?

ahodesuka commented 3 years ago

This probably has something to do with Wayland, but I have no method of testing. If you could run ahoviewer with gdb and give a backtrace that would be very helpful.

Erhannis commented 3 years ago

Is this what you wanted?

GNU gdb (Debian 8.2.1-2+b3) 8.2.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ahoviewer...done.
(gdb) run
Starting program: /usr/local/bin/ahoviewer 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff06c9700 (LWP 8193)]
[New Thread 0x7fffefec8700 (LWP 8194)]
[New Thread 0x7fffef6c7700 (LWP 8195)]
[New Thread 0x7fffeeec6700 (LWP 8196)]
[New Thread 0x7fffee4aa700 (LWP 8197)]
[New Thread 0x7fffedca9700 (LWP 8198)]
[Thread 0x7fffedca9700 (LWP 8198) exited]
[Detaching after fork from child process 8199]

Thread 1 "ahoviewer" received signal SIGSEGV, Segmentation fault.
0x00007ffff6ab34bb in ?? () from /usr/lib/x86_64-linux-gnu/libX11.so.6
(gdb) bt
#0  0x00007ffff6ab34bb in  () at /usr/lib/x86_64-linux-gnu/libX11.so.6
#1  0x00007ffff6ab3d05 in _XFlush () at /usr/lib/x86_64-linux-gnu/libX11.so.6
#2  0x00007ffff6ab67f5 in _XGetRequest ()
    at /usr/lib/x86_64-linux-gnu/libX11.so.6
#3  0x00007ffff6aa0fc4 in XListExtensions ()
    at /usr/lib/x86_64-linux-gnu/libX11.so.6
#4  0x0000555555679aa7 in AhoViewer::ImageBox::ImageBox(_GtkScrolledWindow*, Glib::RefPtr<Gtk::Builder> const&)
    (this=0x555555940e10, cobj=0x555555e94e60, bldr=..., __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at ../src/imagebox.cc:115
#5  0x00005555556baeb5 in Gtk::Builder::get_widget_derived<AhoViewer::ImageBox>(Glib::ustring const&, AhoViewer::ImageBox*&)
    (this=0x555555d53200, name=..., widget=@0x55555596e7b8: 0x0)
    at /usr/include/gtkmm-3.0/gtkmm/builder.h:781
#6  0x00005555556a18da in AhoViewer::MainWindow::MainWindow(_GtkApplicationWindow*, Glib::RefPtr<Gtk::Builder>)
    (this=0x55555596e750, cobj=0x555555e9e2b0, bldr=..., __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at ../src/mainwindow.cc:35
#7  0x0000555555673247 in Gtk::Builder::get_widget_derived<AhoViewer::MainWindow>(Glib::ustring const&, AhoViewer::MainWindow*&)
    (this=0x555555d53200, name=..., widget=@0x7fffffffcff0: 0x0)
    at /usr/include/gtkmm-3.0/gtkmm/builder.h:781
#8  0x0000555555671de3 in AhoViewer::Application::create_window()
--Type <RET> for more, q to quit, c to continue without paging--c
    (this=0x5555557b76c0 <AhoViewer::Application::get_instance()::app>) at ../src/application.cc:144
#9  0x0000555555672019 in AhoViewer::Application::on_activate() (this=0x5555557b76c0 <AhoViewer::Application::get_instance()::app>) at ../src/application.cc:172
#10 0x00007ffff769c6bb in Gio::Application_Class::activate_callback(_GApplication*) () at /usr/lib/x86_64-linux-gnu/libgiomm-2.4.so.1
#11 0x00007ffff7f01c8d in g_closure_invoke () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#12 0x00007ffff7f14bbd in  () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#13 0x00007ffff7f1e2be in g_signal_emit_valist () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#14 0x00007ffff7f1e97f in g_signal_emit () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#15 0x00007ffff6ca57e8 in  () at /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#16 0x00007ffff769c1db in Gio::Application::local_command_line_vfunc(char**&, int&) () at /usr/lib/x86_64-linux-gnu/libgiomm-2.4.so.1
#17 0x00007ffff769c42d in Gio::Application_Class::local_command_line_vfunc_callback(_GApplication*, char***, int*) () at /usr/lib/x86_64-linux-gnu/libgiomm-2.4.so.1
#18 0x00007ffff6ca599b in g_application_run () at /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#19 0x0000555555671ffd in AhoViewer::Application::run(int, char**) (this=0x5555557b76c0 <AhoViewer::Application::get_instance()::app>, argc=1, argv=0x7fffffffd868) at ../src/application.cc:167
#20 0x000055555569eeef in main(int, char**) (argc=1, argv=0x7fffffffd868) at ../src/main.cc:5
(gdb) 
ahodesuka commented 3 years ago

Yeah that works, I know where the problem is now, I'll try to fix it soon.

Erhannis commented 3 years ago

Oh cool; thanks

TypicalFence commented 3 years ago

I have the same issue on under xorg

different backtrace tho:

(gdb) bt
#0  0x00007ffff7c13b63 in Gtk::Widget::hide() () at /usr/lib/libgtkmm-3.0.so.1
#1  0x000055555587d8f1 in AhoViewer::ImageBox::clear_image() (this=0x5555560009e0)
    at ../src/imagebox.cc:277
#2  0x000055555587d064 in AhoViewer::ImageBox::~ImageBox()
    (this=0x5555560009e0, __in_chrg=<optimized out>, __vtt_parm=<optimized out>)
    at ../src/imagebox.cc:209
#3  0x000055555587d252 in AhoViewer::ImageBox::~ImageBox()
    (this=0x5555560009e0, __in_chrg=<optimized out>, __vtt_parm=<optimized out>)
    at ../src/imagebox.cc:213
#4  0x00007ffff7d99a67 in g_datalist_clear () at /usr/lib/libglib-2.0.so.0
#5  0x00007ffff7eb97b1 in g_object_unref () at /usr/lib/libgobject-2.0.so.0
#6  0x00007ffff7da6eef in g_hash_table_destroy () at /usr/lib/libglib-2.0.so.0
#7  0x00007ffff6fc2bb4 in  () at /usr/lib/libgtk-3.so.0
#8  0x00007ffff7eb97b1 in g_object_unref () at /usr/lib/libgobject-2.0.so.0
#9  0x00005555557e5a51 in Glib::RefPtr<Gtk::Builder>::~RefPtr()
    (this=0x7fffffffd5b0, __in_chrg=<optimized out>) at /usr/include/glibmm-2.4/glibmm/refptr.h:273
#10 0x0000555555873e5e in AhoViewer::Application::create_window()
    (this=0x5555559c6ae0 <AhoViewer::Application::get_instance()::app>) at ../src/application.cc:131
#11 0x0000555555873f10 in AhoViewer::Application::on_activate()
    (this=0x5555559c6ae0 <AhoViewer::Application::get_instance()::app>) at ../src/application.cc:172
#12 0x00007ffff778c33c in Gio::Application_Class::activate_callback(_GApplication*) ()
    at /usr/lib/libgiomm-2.4.so.1
#13 0x00007ffff7ec998a in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#14 0x00007ffff7ec9b00 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#15 0x00007ffff6d1eb09 in  () at /usr/lib/libgio-2.0.so.0
#16 0x00007ffff778bdba in Gio::Application::local_command_line_vfunc(char**&, int&) ()
    at /usr/lib/libgiomm-2.4.so.1
#17 0x00007ffff778c0b1 in Gio::Application_Class::local_command_line_vfunc_callback(_GApplication*, char***, int*) () at /usr/lib/libgiomm-2.4.so.1
#18 0x00007ffff6d1ec8a in g_application_run () at /usr/lib/libgio-2.0.so.0
#19 0x0000555555873ee5 in AhoViewer::Application::run(int, char**)
    (this=0x5555559c6ae0 <AhoViewer::Application::get_instance()::app>, argc=1, argv=0x7fffffffdb68)
    at ../src/application.cc:167
#20 0x00005555558a4067 in main(int, char**) (argc=1, argv=0x7fffffffdb68) at ../src/main.cc:5
TypicalFence commented 3 years ago

nevermind it seems like it had something to do with my old settings files, deleting them made it run

tzlils commented 3 years ago

been getting another segfault now, using sway version 1.6-rc2-62fbf33c (Apr 3 2021, branch 'master')

Thread 1 "ahoviewer" received signal SIGSEGV, Segmentation fault.
0x00007ffff5795751 in xcb_take_socket () from /usr/lib/libxcb.so.1
(gdb) bt
#0  0x00007ffff5795751 in xcb_take_socket () at /usr/lib/libxcb.so.1
#1  0x00007ffff6af8b6f in  () at /usr/lib/libX11.so.6
#2  0x00007ffff6af94d5 in _XFlush () at /usr/lib/libX11.so.6
#3  0x00007ffff6afc1f6 in _XGetRequest () at /usr/lib/libX11.so.6
#4  0x00007ffff6ae5fb3 in XListExtensions () at /usr/lib/libX11.so.6
#5  0x00005555556810d0 in AhoViewer::ImageBox::ImageBox(_GtkScrolledWindow*, Glib::RefPtr<Gtk::Builder> const&)
    (this=0x5555559b2410, cobj=0x555555c1cd00, bldr=..., __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at ../src/imagebox.cc:115
#6  0x00005555556c5119 in Gtk::Builder::get_widget_derived<AhoViewer::ImageBox>(Glib::ustring const&, AhoViewer::ImageBox*&) (this=0x555555be08f0, name=..., widget=@0x555555987f08: 0x0)
    at /usr/include/gtkmm-3.0/gtkmm/builder.h:801
#7  0x00005555556ab1a5 in AhoViewer::MainWindow::MainWindow(_GtkApplicationWindow*, Glib::RefPtr<Gtk::Builder>)
    (this=0x555555987ea0, cobj=0x555555c362c0, bldr=..., __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at ../src/mainwindow.cc:35
#8  0x000055555567a0f1 in Gtk::Builder::get_widget_derived<AhoViewer::MainWindow>(Glib::ustring const&, AhoViewer::MainWindow*&) (this=0x555555be08f0, name=..., widget=@0x7fffffffe388: 0x0)
    at /usr/include/gtkmm-3.0/gtkmm/builder.h:801
#9  0x0000555555678ca0 in AhoViewer::Application::create_window() (this=0x5555557c1880 <AhoViewer::Application::get_instance()::app>) at ../src/application.cc:144
#10 0x0000555555678ee6 in AhoViewer::Application::on_activate() (this=0x5555557c1880 <AhoViewer::Application::get_instance()::app>) at ../src/application.cc:172
#11 0x00007ffff77b135c in Gio::Application_Class::activate_callback(_GApplication*) () at /usr/lib/libgiomm-2.4.so.1
#12 0x00007ffff7ef0096 in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#13 0x00007ffff7ef0210 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#14 0x00007ffff6d40079 in  () at /usr/lib/libgio-2.0.so.0
#15 0x00007ffff77b0dda in Gio::Application::local_command_line_vfunc(char**&, int&) () at /usr/lib/libgiomm-2.4.so.1
#16 0x00007ffff77b10d1 in Gio::Application_Class::local_command_line_vfunc_callback(_GApplication*, char***, int*) () at /usr/lib/libgiomm-2.4.so.1
#17 0x00007ffff6d401fa in g_application_run () at /usr/lib/libgio-2.0.so.0
#18 0x0000555555678ebb in AhoViewer::Application::run(int, char**) (this=0x5555557c1880 <AhoViewer::Application::get_instance()::app>, argc=1, argv=0x7fffffffe938) at ../src/application.cc:167
#19 0x00005555556a86ab in main(int, char**) (argc=1, argv=0x7fffffffe938) at ../src/main.cc:5
ahodesuka commented 3 years ago

@tzlils You're 100% sure you are running the latest version of ahoviewer?

tzlils commented 3 years ago

@tzlils You're 100% sure you are running the latest version of ahoviewer?

i think i was using ahoviewer-git from the AUR, but regardless i compiled latest and it works now