Re: [gtk-osx-users] Crash when loading icon





On Jun 6, 2018, at 10:35 AM, Miroslav Rajcic <mrajcic hotmail com> wrote:

Hello,

I've managed to build GTK3 stack and bundle the app.
Starting the app, at first it looked OK, toolbars with stock icons look OK, working with the app seems fine, but when I started the File Open widget, the app crashes.

Crash cause seems to be explained in the following log:
16:46:37.736 GTK [8]: gdk_cairo_surface_create_from_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
16:46:37.736 GTK [8]: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
16:46:37.736 GTK [8]: gdk_pixbuf_get_width: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
16:46:37.736 GTK [8]: gdk_pixbuf_get_height: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
16:46:37.736 GTK [8]: gdk_pixbuf_get_width: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
16:46:37.736 GTK [8]: gdk_pixbuf_get_width: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
16:46:37.736 GTK [8]: gdk_pixbuf_get_height: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
16:46:37.736 GTK [8]: gdk_pixbuf_get_height: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
16:46:37.736 GTK [8]: gdk_pixbuf_scale_simple: assertion 'GDK_IS_PIXBUF (src)' failed
16:46:37.737 **
Gtk:ERROR:gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /org/gtk/libgtk/icons/16x16/status/image-missing.png: Failed to load icon (gtk-icon-theme-error-quark, 0)

Backtrace is given below.

Icon is found in the bundle, but the strange thing in the log above is that the GTK loads the file using absolute path /org/gtk/...

miros-MacBook-Air:~ miro$ cd /Applications/NotecasePro.app/
miros-MacBook-Air:NotecasePro.app miro$ find . -iname "image-missing.png"
./Contents/Resources/share/icons/Adwaita/16x16/status/image-missing.png
./Contents/Resources/share/icons/Adwaita/32x32/status/image-missing.png
./Contents/Resources/share/icons/Adwaita/24x24/status/image-missing.png
./Contents/Resources/share/icons/Adwaita/22x22/status/image-missing.png
./Contents/Resources/share/icons/Adwaita/48x48/status/image-missing.png
./Contents/Resources/share/icons/Adwaita/512x512/status/image-missing.png

BTW, should the icons be under 
./Contents/Resources/usr/share
instead of 
./Contents/Resources/share ?

Icons were bundled using standard block from demo bundle:
 ... 
 <data>
    ${prefix}/share/icons
  </data>
 ...

Is this a GTK bug or some variable missing in launcher script?

Regards,
   Miroslav

PS. Backtrace:
16:46:37.760 2   notecase-bin                        0x000000010cf5cf18 signal_handler + 24 ()
16:46:37.760 3   libsystem_platform.dylib            0x00007fff5b230f5a _sigtramp + 26 ()
16:46:37.760 4   ???                                 0x00000001105592c4 0x0 + 4569010884 ()
16:46:37.760 5   libsystem_c.dylib                   0x00007fff5afce1ae abort + 127 ()
16:46:37.760 6   libglib-2.0.0.dylib                 0x000000010e825626 g_assertion_message + 646 ()
16:46:37.760 7   libglib-2.0.0.dylib                 0x000000010e825b3f g_assertion_message_error + 287 ()
16:46:37.760 8   libgtk-3.0.dylib                    0x000000010daa4e2e ensure_surface_for_gicon + 510 ()
16:46:37.760 9   libgtk-3.0.dylib                    0x000000010daa49b6 gtk_icon_helper_load_surface + 630 ()
16:46:37.760 10  libgtk-3.0.dylib                    0x000000010daa5657 gtk_icon_helper_ensure_surface + 71 ()
16:46:37.760 11  libgtk-3.0.dylib                    0x000000010daa50de _gtk_icon_helper_get_size + 446 ()
16:46:37.760 12  libgtk-3.0.dylib                    0x000000010dac7563 gtk_image_get_content_size + 83 ()
16:46:37.760 13  libgtk-3.0.dylib                    0x000000010d9cd7b8 gtk_css_custom_gadget_get_preferred_size + 120 ()
16:46:37.760 14  libgtk-3.0.dylib                    0x000000010d9d35be gtk_css_gadget_get_preferred_size + 862 ()
16:46:37.760 15  libgtk-3.0.dylib                    0x000000010dac728e gtk_image_get_preferred_height_and_baseline_for_width + 78 ()
16:46:37.760 16  libgtk-3.0.dylib                    0x000000010dc085cc gtk_widget_query_size_for_orientation + 540 ()
16:46:37.760 17  libgtk-3.0.dylib                    0x000000010dc075ba gtk_widget_compute_size_for_orientation + 234 ()
16:46:37.760 18  libgtk-3.0.dylib                    0x000000010dc07c54 gtk_widget_get_preferred_height_and_baseline_for_width + 356 ()
16:46:37.760 19  libgtk-3.0.dylib                    0x000000010dc0835b _gtk_widget_get_preferred_size_for_size + 395 ()
16:46:37.760 20  libgtk-3.0.dylib                    0x000000010d965d6b gtk_button_measure + 139 ()
16:46:37.760 21  libgtk-3.0.dylib                    0x000000010d9cd7b8 gtk_css_custom_gadget_get_preferred_size + 120 ()
16:46:37.760 22  libgtk-3.0.dylib                    0x000000010d9d35be gtk_css_gadget_get_preferred_size + 862 ()
16:46:37.760 23  libgtk-3.0.dylib                    0x000000010d9645fe gtk_button_get_preferred_height_and_baseline_for_width + 78 ()
16:46:37.760 24  libgtk-3.0.dylib                    0x000000010dc085cc gtk_widget_query_size_for_orientation + 540 ()
16:46:37.760 25  libgtk-3.0.dylib                    0x000000010dc075ba gtk_widget_compute_size_for_orientation + 234 ()
16:46:37.760 26  libgtk-3.0.dylib                    0x000000010dc07c54 gtk_widget_get_preferred_height_and_baseline_for_width + 356 ()
16:46:37.760 27  libgtk-3.0.dylib                    0x000000010d94cd5a gtk_box_get_size + 298 ()
16:46:37.760 28  libgtk-3.0.dylib                    0x000000010d94caa5 gtk_box_get_content_size + 117 ()
16:46:37.760 29  libgtk-3.0.dylib                    0x000000010d9cd7b8 gtk_css_custom_gadget_get_preferred_size + 120 ()
16:46:37.760 30  libgtk-3.0.dylib                    0x000000010d9d35be gtk_css_gadget_get_preferred_size + 862 ()
16:46:37.760 31  libgtk-3.0.dylib                    0x000000010d94bd9e gtk_box_get_preferred_height_and_baseline_for_width + 78 ()
16:46:37.760 32  libgtk-3.0.dylib                    0x000000010dc085cc gtk_widget_query_size_for_orientation + 540 ()
16:46:37.760 33  libgtk-3.0.dylib                    0x000000010dc075ba gtk_widget_compute_size_for_orientation + 234 ()
16:46:37.760 34  libgtk-3.0.dylib                    0x000000010dc07814 gtk_widget_get_preferred_height + 292 ()
16:46:37.760 35  libgtk-3.0.dylib                    0x000000010dc9e096 gtk_tool_item_get_preferred_height + 102 ()
16:46:37.760 36  libgtk-3.0.dylib                    0x000000010dc085ea gtk_widget_query_size_for_orientation + 570 ()
16:46:37.760 37  libgtk-3.0.dylib                    0x000000010dc075ba gtk_widget_compute_size_for_orientation + 234 ()
16:46:37.760 38  libgtk-3.0.dylib                    0x000000010dc07c54 gtk_widget_get_preferred_height_and_baseline_for_width + 356 ()
16:46:37.760 39  libgtk-3.0.dylib                    0x000000010dc07de4 _gtk_widget_get_preferred_size_and_baseline + 388 ()
16:46:37.760 40  libgtk-3.0.dylib                    0x000000010dc07e81 gtk_widget_get_preferred_size + 49 ()
16:46:37.760 41  libgtk-3.0.dylib                    0x000000010dc90eaf toolbar_content_size_request + 47 ()
16:46:37.760 42  libgtk-3.0.dylib                    0x000000010dc9522b gtk_toolbar_measure + 203 ()
16:46:37.760 43  libgtk-3.0.dylib                    0x000000010d9cd7b8 gtk_css_custom_gadget_get_preferred_size + 120 ()
16:46:37.760 44  libgtk-3.0.dylib                    0x000000010d9d35be gtk_css_gadget_get_preferred_size + 862 ()
16:46:37.760 45  libgtk-3.0.dylib                    0x000000010dc93b11 gtk_toolbar_get_preferred_height + 97 ()
16:46:37.760 46  libgtk-3.0.dylib                    0x000000010dc085ea gtk_widget_query_size_for_orientation + 570 ()
16:46:37.760 47  libgtk-3.0.dylib                    0x000000010dc075ba gtk_widget_compute_size_for_orientation + 234 ()
16:46:37.760 48  libgtk-3.0.dylib                    0x000000010dc07c54 gtk_widget_get_preferred_height_and_baseline_for_width + 356 ()
16:46:37.760 49  libgtk-3.0.dylib                    0x000000010d94cd5a gtk_box_get_size + 298 ()
16:46:37.760 50  libgtk-3.0.dylib                    0x000000010d94caa5 gtk_box_get_content_size + 117 ()
16:46:37.760 51  libgtk-3.0.dylib                    0x000000010d9cd7b8 gtk_css_custom_gadget_get_preferred_size + 120 ()
16:46:37.760 52  libgtk-3.0.dylib                    0x000000010d9d35be gtk_css_gadget_get_preferred_size + 862 ()
16:46:37.760 53  libgtk-3.0.dylib                    0x000000010d94bd9e gtk_box_get_preferred_height_and_baseline_for_width + 78 ()
16:46:37.760 54  libgtk-3.0.dylib                    0x000000010dc085cc gtk_widget_query_size_for_orientation + 540 ()
16:46:37.760 55  libgtk-3.0.dylib                    0x000000010dc075ba gtk_widget_compute_size_for_orientation + 234 ()
16:46:37.760 56  libgtk-3.0.dylib                    0x000000010dc07814 gtk_widget_get_preferred_height + 292 ()
16:46:37.760 57  libgtk-3.0.dylib                    0x000000010dd49b53 gtk_window_get_preferred_height + 387 ()
16:46:37.760 58  libgtk-3.0.dylib                    0x000000010dc085ea gtk_widget_query_size_for_orientation + 570 ()
16:46:37.760 59  libgtk-3.0.dylib                    0x000000010dc075ba gtk_widget_compute_size_for_orientation + 234 ()

I haven’t encountered a problem like that, so it’s probably something that your app is doing wrong, though it could be a Gtk bug that I haven’t run up against. Gtk-osx is for developers, not script kiddies, so fire up you debugger and get to work.

Regards,
John Ralls




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]