Handle failure to access mime.cache more gracefully (Terminate called after throwing an instance of 'Gdk::PixbufError')
Steps to reproduce:
- Remove read permissions for /usr/share/mime/mime.cache
- Open Inkscape in a terminal (with align and distribute dialog open for 0.92.x)
What happened?
Warnings in Terminal for 0.92.4
$ inkscape** (inkscape:19798): WARNING **: 11:00:26.541: Null pixbuf for 0x55b8147a3790 [/usr/share/inkscape/icons/remove-color.png]
(inkscape:19798): GdkPixbuf-CRITICAL **: 11:00:26.541: gdk_pixbuf_get_width: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(inkscape:19798): GdkPixbuf-CRITICAL **: 11:00:26.541: gdk_pixbuf_get_height: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
** (inkscape:19798): WARNING **: 11:00:26.555: Null pixbuf for 0x55b81473c500 [/usr/share/inkscape/icons/remove-color.png]
(inkscape:19798): GdkPixbuf-CRITICAL **: 11:00:26.555: gdk_pixbuf_get_width: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(inkscape:19798): GdkPixbuf-CRITICAL **: 11:00:26.555: gdk_pixbuf_get_height: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
** (inkscape:19798): WARNING **: 11:00:26.562: Null pixbuf for 0x55b814aa5450 [/usr/share/inkscape/icons/remove-color.png]
(inkscape:19798): GdkPixbuf-CRITICAL **: 11:00:26.562: gdk_pixbuf_get_width: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(inkscape:19798): GdkPixbuf-CRITICAL **: 11:00:26.562: gdk_pixbuf_get_height: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
** (inkscape:19798): WARNING **: 11:00:26.563: Null pixbuf for 0x55b814a7ffc0 [/usr/share/inkscape/icons/remove-color.png]
(inkscape:19798): GdkPixbuf-CRITICAL **: 11:00:26.563: gdk_pixbuf_get_width: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(inkscape:19798): GdkPixbuf-CRITICAL **: 11:00:26.563: gdk_pixbuf_get_height: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
** (inkscape:19798): WARNING **: 11:00:26.578: Null pixbuf for 0x55b814bc9a70 [/usr/share/inkscape/icons/remove-color.png]
(inkscape:19798): GdkPixbuf-CRITICAL **: 11:00:26.578: gdk_pixbuf_get_width: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(inkscape:19798): GdkPixbuf-CRITICAL **: 11:00:26.578: gdk_pixbuf_get_height: assertion 'GDK_IS_PIXBUF (pixbuf)' failed terminate called after throwing an instance of 'Gdk::PixbufError'
Emergency save activated! Emergency save completed. Inkscape will close now. If you can reproduce this crash, please file a bug at www.inkscape.org with a detailed description of the steps leading to the crash, so we can fix it.
Thread 1 "inkscape" received signal SIGABRT, Aborted.
0x00007ffff4a8c755 in raise () from /usr/lib/libc.so.6
In 1.0/1.1-dev versions, we always crash on startup with
(inkscape:31721): glibmm-CRITICAL **: 13:22:56.732:
unhandled exception (type Glib::Error) in signal handler:
domain: gdk-pixbuf-error-quark
code : 3
what : Could not identify image type of »/usr/local/share/inkscape/pixmaps/remove-color.png«
Backtrace (catching the exception) Inkscape 1.1-dev (de84fa05b9, 2020-05-15) Linux Mint 19.1
Thread 1 "inkscape" hit Catchpoint 1 (exception thrown), 0x00007ffff4245d1d in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(gdb) bt
#0 0x00007ffff4245d1d in __cxa_throw () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1 0x00007ffff6918188 in Inkscape::Extension::Extension::Extension(Inkscape::XML::Node*, Inkscape::Extension::Implementation::Implementation*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) (this=0x555555baee10, in_repr=<optimised out>, in_imp=<optimised out>, base_directory=<optimised out>) at ../src/extension/extension.cpp:171
#2 0x00007ffff6912b50 in Inkscape::Extension::Effect::Effect(Inkscape::XML::Node*, Inkscape::Extension::Implementation::Implementation*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) (this=0x555555baee10, in_repr=<optimised out>, in_imp=<optimised out>, base_directory=<optimised out>) at ../src/extension/effect.cpp:44
#3 0x00007ffff691c8e2 in Inkscape::Extension::build_from_reprdoc(Inkscape::XML::Document*, Inkscape::Extension::Implementation::Implementation*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) (doc=doc@entry=0x55555644f238, in_imp=in_imp@entry=0x0, baseDir=0x7fffffffcfc0,
baseDir@entry=0x7fffffffcfb0) at ../src/extension/system.cpp:523
#4 0x00007ffff691cbea in Inkscape::Extension::build_from_file(char const*) (filename=<optimised out>) at ../src/extension/system.cpp:573
#5 0x00007ffff69193c0 in Inkscape::Extension::init() () at ../src/extension/init.cpp:238
#6 0x00007ffff7239676 in Inkscape::Application::Application(bool) (this=0x555555857290, use_gui=<optimised out>) at ../src/inkscape.cpp:269
#7 0x00007ffff7239dca in Inkscape::Application::create(bool) (use_gui=<optimised out>) at ../src/inkscape.cpp:162
#8 0x00007ffff72f752b in ConcreteInkscapeApplication<Gtk::Application>::on_startup2() (this=
0x7ffff7dd3020 <ConcreteInkscapeApplication<Gtk::Application>::get_instance()::instance>) at ../src/inkscape-application.cpp:699
#9 0x00007ffff7318a99 in ConcreteInkscapeApplication<Gtk::Application>::on_activate() (this=0x7ffff7dd3020 <ConcreteInkscapeApplication<Gtk::Application>::get_instance()::instance>) at ../src/inkscape-application.cpp:983
#10 0x00007ffff5192b7d in Gio::Application_Class::activate_callback(_GApplication*) (self=0x5555557e02d0 [gtkmm__GtkApplication]) at application.cc:975
#14 0x00007ffff192712f in <emit signal ??? on instance 0x5555557e02d0 [gtkmm__GtkApplication]> (instance=instance@entry=0x5555557e02d0, signal_id=<optimised out>, detail=detail@entry=0) at ../../../../gobject/gsignal.c:3447
#11 0x00007ffff190b10d in g_closure_invoke (closure=0x555555975f10, return_value=0x0, n_param_values=1, param_values=0x7fffffffd930, invocation_hint=0x7fffffffd8b0) at ../../../../gobject/gclosure.c:804
#12 0x00007ffff191dde8 in signal_emit_unlocked_R (node=node@entry=0x555555837f10, detail=detail@entry=0, instance=instance@entry=0x5555557e02d0, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffd930) at ../../../../gobject/gsignal.c:3673
#13 0x00007ffff1926715 in g_signal_emit_valist (instance=<optimised out>, signal_id=<optimised out>, detail=<optimised out>, var_args=var_args@entry=0x7fffffffdaf0) at ../../../../gobject/gsignal.c:3391
#15 0x00007ffff1bf148d in g_application_activate (application=application@entry=0x5555557e02d0 [gtkmm__GtkApplication])
at ../../../../gio/gapplication.c:2236
#16 0x00007ffff1bf1c55 in g_application_real_local_command_line (application=0x5555557e02d0 [gtkmm__GtkApplication], arguments=0x7fffffffdd48, exit_status=0x7fffffffdd44) at ../../../../gio/gapplication.c:1119
#17 0x00007ffff51926ab in Gio::Application::local_command_line_vfunc(char**&, int&) (this=0x7ffff7dd3020 <ConcreteInkscapeApplication<Gtk::Application>::get_instance()::instance>, arguments=@0x7fffffffdd48: 0x7fffd4011f10, exit_status=@0x7fffffffdd44: -1) at application.cc:1422
#18 0x00007ffff51928ed in Gio::Application_Class::local_command_line_vfunc_callback(_GApplication*, char***, int*) (self=0x5555557e02d0 [gtkmm__GtkApplication], arguments=0x7fffffffdd48, exit_status=0x7fffffffdd44) at application.cc:752
#19 0x00007ffff1bf1e66 in g_application_run (application=0x5555557e02d0 [gtkmm__GtkApplication], argc=<optimised out>, argv=<optimised out>)
at ../../../../gio/gapplication.c:2439
#20 0x0000555555555e3d in main(int, char**) (argc=1, argv=0x7fffffffde98) at ../src/inkscape-main.cpp:183
Inkview (opening to the open dialog) will crash with this backtrace: #827 (comment 219881471)
What should have happened?
Apparently Inkscape should not crash. :-)
Inkscape Version and Operating System:
Operating System: Manjaro Linux Inkscape 0.92.4 5da689c313, 2019-01-14