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

Segmentation fault (core dumped) #707

Open
efa opened this issue Mar 5, 2025 · 5 comments
Open

Segmentation fault (core dumped) #707

efa opened this issue Mar 5, 2025 · 5 comments

Comments

@efa
Copy link

efa commented Mar 5, 2025

I just build the GTK frontend on 2 different Debian 12 installations:

  1. Debian12/WSL/Win10
$ sudo apt install  debhelper cmake intltool libdjvulibre-dev libgtkspellmm-3.0-dev libgtkmm-3.0-dev libgtksourceviewmm-3.0-dev libcairomm-1.0-dev libpoppler-glib-dev libtesseract-dev libsane-dev qtbase5-dev qttools5-dev qttools5-dev-tools libqtspell-qt5-dev libpoppler-qt5-dev libjson-glib-dev libxml++2.6-dev libpodofo-dev libquazip5-dev libzip-dev python3-gi uuid-dev
$ git clone https://github.com/manisandro/gImageReader.git
$ cd gImageReader
$ mkdir build
$ cd build
$ cmake -DINTERFACE_TYPE=gtk ..
$ make
$ export XDG_DATA_DIRS=$PWD:$XDG_DATA_DIRS
$ gImageReader/build$ gimagereader-gtk
(gimagereader-gtk:21354): Gtk-WARNING **: 17:53:23.208: Could not load a pixbuf from /org/gtk/libgtk/icons/16x16/status/window-close-symbolic.symbolic.png.
This may indicate that pixbuf loaders or the mime database could not be found.
**
Gtk:ERROR:../../../gtk/gtkiconhelper.c:495:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /org/gtk/libgtk/icons/16x16/status/image-missing.png: Unrecognized image file format (gdk-pixbuf-error-quark, 3)
Bail out! Gtk:ERROR:../../../gtk/gtkiconhelper.c:495:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /org/gtk/libgtk/icons/16x16/status/image-missing.png: Unrecognized image file format (gdk-pixbuf-error-quark, 3)
Segmentation fault (core dumped)
  1. Debian12 (on real HW)
/gImageReader/build$ gimagereader-gtk
Segmentation fault

and a windows open with the backtrace:

gImageReader 3.4.2 (rev e1679305c8b8e2e6a38bf3fcb7699ba6a2b2860a)

#1  0x00005620f55a4341 in MainWindow::signalHandlerExec(int, bool) ()
#2  0x00005620f55a3df2 in MainWindow::signalHandler(int) ()
#3  0x00007ffaf325b050 in <signal handler called> ()
#4  0x00007ffaf4fee064 in Gtk::Widget::get_parent() ()
#5  0x00005620f55b9139 in Ui::MainWindow::~MainWindow() ()
#6  0x00005620f55a638b in MainWindow::MainWindow() ()
#7  0x00005620f56c2bc8 in Application::on_startup() ()
#8  0x00007ffaf4b0055b in Gio::Application_Class::startup_callback(_GApplication*) () at /lib/x86_64-linux-gnu/libgiomm-2.4.so.1
#9  0x00007ffaf3dd75a9 in  () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#10 0x00007ffaf3df0bbf in g_signal_emit_valist ()
#11 0x00007ffaf3df0dbf in g_signal_emit ()
#12 0x00007ffaf3efcea2 in g_application_register ()
#13 0x00007ffaf3efd26a in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#14 0x00007ffaf4b00118 in Gio::Application::local_command_line_vfunc(char**&, int&) () at /lib/x86_64-linux-gnu/libgiomm-2.4.so.1
#15 0x00007ffaf4b0035d in Gio::Application_Class::local_command_line_vfunc_callback(_GApplication*, char***, int*) ()
#16 0x00007ffaf3efd5c6 in g_application_run ()
#17 0x00005620f56c2251 in main ()

Thread 3 (Thread 0x7ffaed7fe6c0 (LWP 3261532) "gdbus"):
#0  0x00007ffaf331b1df in __GI___poll (fds=0x5620f5937aa0, nfds=2, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007ffaf3cdd9ae in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffaf3cddcef in g_main_loop_run () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffaf3f397c6 in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#4  0x00007ffaf3d07cfd in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffaf32a81c4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#6  0x00007ffaf332885c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 2 (Thread 0x7ffaedfff6c0 (LWP 3261531) "gmain"):
#0  0x00007ffaf331b1df in __GI___poll (fds=0x5620f592adf0, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007ffaf3cdd9ae in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffaf3cddacc in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffaf3cddb11 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007ffaf3d07cfd in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffaf32a81c4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#6  0x00007ffaf332885c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 1 (Thread 0x7ffaf03e6d80 (LWP 3261530) "gimagereader-gt"):
#0  0x00007ffaf32f2bd7 in __GI___wait4 (pid=3261572, stat_loc=0x0, options=0, usage=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:30
#1  0x00005620f55a4341 in MainWindow::signalHandlerExec(int, bool) ()
#2  0x00005620f55a3df2 in MainWindow::signalHandler(int) ()
#3  0x00007ffaf325b050 in <signal handler called> () at /lib/x86_64-linux-gnu/libc.so.6
#4  0x00007ffaf4fee064 in Gtk::Widget::get_parent() () at /lib/x86_64-linux-gnu/libgtkmm-3.0.so.1
#5  0x00005620f55b9139 in Ui::MainWindow::~MainWindow() ()
#6  0x00005620f55a638b in MainWindow::MainWindow() ()
#7  0x00005620f56c2bc8 in Application::on_startup() ()
#8  0x00007ffaf4b0055b in Gio::Application_Class::startup_callback(_GApplication*) () at /lib/x86_64-linux-gnu/libgiomm-2.4.so.1
#9  0x00007ffaf3dd75a9 in  () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#10 0x00007ffaf3df0bbf in g_signal_emit_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#11 0x00007ffaf3df0dbf in g_signal_emit () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#12 0x00007ffaf3efcea2 in g_application_register () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#13 0x00007ffaf3efd26a in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#14 0x00007ffaf4b00118 in Gio::Application::local_command_line_vfunc(char**&, int&) () at /lib/x86_64-linux-gnu/libgiomm-2.4.so.1
#15 0x00007ffaf4b0035d in Gio::Application_Class::local_command_line_vfunc_callback(_GApplication*, char***, int*) () at /lib/x86_64-linux-gnu/libgiomm-2.4.so.1
#16 0x00007ffaf3efd5c6 in g_application_run () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#17 0x00005620f56c2251 in main ()
@manisandro
Copy link
Owner

First segfault is due to XDG_DATA_DIRS not containing the system XDG_DATA_DIRS. What does echo $XDG_DATA_DIRS give you after overriding the env?

Second one I need to investigate, does not seem to happen on linux though.

@efa
Copy link
Author

efa commented Mar 5, 2025

my XDG_DATA_DIRS var was empty before
$ export XDG_DATA_DIRS=$PWD:$XDG_DATA_DIRS
so now contain only PWD

This on both Debian installations

@manisandro
Copy link
Owner

This is strange. On Fedora/KDE by default it is

/usr/share/kde-settings/kde-profile/default/share:/usr/local/share:/usr/share

Try

export XDG_DATA_DIRS=$PWD:/usr/local/share:/usr/share

@efa
Copy link
Author

efa commented Mar 5, 2025

OK, so work on both Debian 12 installations

@efa
Copy link
Author

efa commented Mar 6, 2025

I made some tests, and the binary need to find those files:
build/glib-2.0/schemas/org.gnome.gimagereader.gschema.xml
build/glib-2.0/schemas/gschemas.compiled
or Segmentation fault.
System schemas:
/usr/local/share:/usr/share
does not matter.
So XDG_DATA_DIRS must be set to path 'build', that it is not the gimagereader-gtk binary path, but the path up one level of glib-2.0/schemas

I think this should be solved.

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

2 participants