MCDatapacker icon indicating copy to clipboard operation
MCDatapacker copied to clipboard

When opening the file browser the program crashes

Open scp487 opened this issue 1 year ago • 4 comments

Using: 0.10.0 x86_64 appimage Bug: when loading up the program, and clicking any button that should open up a file browser the program crashes.

scp487 avatar Apr 29 '24 01:04 scp487

What Linux distro and desktop environment are you using? The issue doesn't occur to me on WSL.

IoeCmcomc avatar Apr 29 '24 06:04 IoeCmcomc

What Linux distro and desktop environment are you using? The issue doesn't occur to me on WSL.

Linux distro: Ubuntu 22.04 LTS Desktop environment: gnome

scp487 avatar Apr 29 '24 10:04 scp487

After install a new Ubuntu 22.04 VM, I'm able to reproduce the issue. For some reasons, I have to run the AppImage in the terminal with GDK_BACKEND=x11 or it will crash. Here's the error messages:

(MCDatapacker:23599): Gtk-WARNING: Could not load a pixbuf from icon theme.
This may indicate that pixbuf loaders or the mime database could not be found.
Gtk: ERROR: ../../../../gtk/gtkiconheIper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /usr/share/icons/Yaru/16x16/status/image-missing.png: Unrecognized image file format (gdk-pixbuf-error-quark, 3)
Bail out! Gtk: ERROR: ../../../../gtk/gtkiconheIper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /usr/share/icons/Yaru/16x16/status/image-missing.png: Unrecognized image file format (gdk-pixbuf-error-quark, 3)
Aborted (core dumped)

Can you run the AppImage in the terminal and confirm the error messages?

IoeCmcomc avatar Apr 29 '24 16:04 IoeCmcomc

After install a new Ubuntu 22.04 VM, I'm able to reproduce the issue. For some reasons, I have to run the AppImage in the terminal with GDK_BACKEND=x11 or it will crash. Here's the error messages:

(MCDatapacker:23599): Gtk-WARNING: Could not load a pixbuf from icon theme.
This may indicate that pixbuf loaders or the mime database could not be found.
Gtk: ERROR: ../../../../gtk/gtkiconheIper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /usr/share/icons/Yaru/16x16/status/image-missing.png: Unrecognized image file format (gdk-pixbuf-error-quark, 3)
Bail out! Gtk: ERROR: ../../../../gtk/gtkiconheIper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /usr/share/icons/Yaru/16x16/status/image-missing.png: Unrecognized image file format (gdk-pixbuf-error-quark, 3)
Aborted (core dumped)

Can you run the AppImage in the terminal and confirm the error messages?

yes, the error message is the same: (MCDatapacker:51246): Gtk-WARNING **: 15:39:05.752: Could not load a pixbuf from icon theme. This may indicate that pixbuf loaders or the mime database could not be found. ** Gtk:ERROR:../../../../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /usr/share/icons/Yaru/16x16/status/image-missing.png: Unrecognized image file format (gdk-pixbuf-error-quark, 3) Bail out! Gtk:ERROR:../../../../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /usr/share/icons/Yaru/16x16/status/image-missing.png: Unrecognized image file format (gdk-pixbuf-error-quark, 3) Aborted (core dumped)

scp487 avatar Apr 29 '24 19:04 scp487

After searching on GitHub and Google for months with many unsuccessful attempts, I have finally fixed the crash. The libgdk_pixbuf-2.0 library, which is included in the AppImage file, seems to cause conflict with other packages on Ubuntu 22.04; even upgrading packages in my build environment (WSL Ubuntu 20.02) and the target OS (Ubuntu 22.04) doesn't fix the problem. The fix is to exclude libgdk_pixbuf-2.0 from being included in the binary when packaging. The program should now use the library from the system instead. The only downside I have found so far is that the file dialog can't display icons properly.

While searching for a solution, I also tried to force the program to use Qt file dialogs instead of native file dialogs without success. However, if I use a third-party library to show native file dialogs, it also fixes the issue. I may switch to using this method in the future if the issue still persists.

I also tested the old Appimage files on LinuxMint, and the crash didn't occur.

In conclusion, this crash should be fixed on MCDatapacker v0.11.0.

IoeCmcomc avatar Apr 17 '25 11:04 IoeCmcomc