linuxmint / nemo-extensions

A set of extensions for Nemo
414 stars 151 forks source link

Nemo-preview crash when multiple GTK versions are installed #449

Closed roberts-code closed 2 years ago

roberts-code commented 2 years ago

Hi,

nemo-preview crashes on Arch Linux + Cinnamon with three versions of GTK installed. Starting it from the console, it prints the error message:

Cjs-Message: 23:22:51.273: JS WARNING: [/usr/share/nemo-preview/js/viewers/audio.js 32]: Requiring Gtk but it has 3 versions available; use imports.gi.versions to pick one

I believe this is related to #437, where gst.js was fixed. When I also add imports.gi.versions.Gtk = '3.0'; to audio.js, nemo-preview works as expected.

Could someone familiar with the code base check, if this is the proper fix and add it?

Thanks, Robert

ghost commented 2 years ago

I'm also having this issue on the Cinnamon spin of Fedora 35.

> nemo-preview Screenshot\ from\ 2022-04-10\ 00-46-48.png

Cjs-Message: 01:40:29.990: JS WARNING: [/usr/share/nemo-preview/js/viewers/audio.js 32]: Requiring Gtk but it has 3 versions available; use imports.gi.versions to pick one

(nemo-preview-start:37057): GLib-GObject-WARNING **: 01:40:29.993: cannot register existing type 'GtkWidget'

(nemo-preview-start:37057): GLib-GObject-WARNING **: 01:40:29.993: cannot add class private field to invalid type '<invalid>'

(nemo-preview-start:37057): GLib-GObject-WARNING **: 01:40:29.993: cannot add private field to invalid (non-instantiatable) type '<invalid>'

(nemo-preview-start:37057): GLib-GObject-WARNING **: 01:40:29.993: cannot register existing type 'GtkAccessible'

(nemo-preview-start:37057): GLib-GObject-CRITICAL **: 01:40:29.993: g_type_interface_add_prerequisite: assertion 'G_TYPE_IS_INTERFACE (interface_type)' failed

(nemo-preview-start:37057): GLib-CRITICAL **: 01:40:29.993: g_once_init_leave: assertion 'result != 0' failed

(nemo-preview-start:37057): GLib-GObject-CRITICAL **: 01:40:29.994: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

(nemo-preview-start:37057): GLib-GObject-WARNING **: 01:40:29.994: cannot register existing type 'GtkBuildable'

(nemo-preview-start:37057): GLib-GObject-CRITICAL **: 01:40:29.994: g_type_interface_add_prerequisite: assertion 'G_TYPE_IS_INTERFACE (interface_type)' failed

(nemo-preview-start:37057): GLib-CRITICAL **: 01:40:29.994: g_once_init_leave: assertion 'result != 0' failed

(nemo-preview-start:37057): GLib-GObject-CRITICAL **: 01:40:29.994: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

(nemo-preview-start:37057): GLib-GObject-CRITICAL **: 01:40:29.994: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

(nemo-preview-start:37057): Cjs-CRITICAL **: 01:40:29.994: JS ERROR: Error: Unsupported type (null), deriving from fundamental (null)
_init@resource:///org/gnome/gjs/modules/core/overrides/Gtk.js:38:5
@/usr/share/nemo-preview/js/viewers/audio.js:32:13

/usr/bin/nemo-preview: line 15: 37057 Segmentation fault      (core dumped) /usr/libexec/nemo-preview-start
mtwebster commented 2 years ago

I think I've fixed all places where this could occur, but I don't have anywhere to realistically test it on at the moment.

Let me know if someone can confirm it's fixed so I can close this. Thanks.

roberts-code commented 2 years ago

I just tested with commit ebe9cf2a7c0262eb638487938a78830d2b86d27c and can confirm, that nemo-preview works on Arch + multiple GTK versions. I see that it's in the main branch already, so this issue can be closed as fixed.

Thank!

ghost commented 2 years ago

What packages and versions do I need to check that has this fix applied? My nemo-preview still doesn't work.

Here's a list of nemo and cinnamon related packages on my system:

$ dnf list installed | grep 'nemo\|cinnamon'

cinnamon.x86_64                                   5.2.7-4.fc36
cinnamon-calendar-server.x86_64                   5.2.7-4.fc36
cinnamon-control-center.x86_64                    5.2.1-3.fc36
cinnamon-control-center-filesystem.x86_64         5.2.1-3.fc36
cinnamon-desktop.x86_64                           5.2.1-1.fc36
cinnamon-menus.x86_64                             5.2.0-2.fc36
cinnamon-screensaver.x86_64                       5.2.1-1.fc36
cinnamon-session.x86_64                           5.2.0-2.fc36
cinnamon-settings-daemon.x86_64                   5.2.0-3.fc36
cinnamon-themes.noarch                            1:1.9.8-1.fc36
cinnamon-translations.noarch                      5.2.2-2.fc36
fedora-release-cinnamon.noarch                    36-17
fedora-release-identity-cinnamon.noarch           36-17
imsettings-cinnamon.x86_64                        1.8.3-2.fc36
nemo.x86_64                                       5.2.4-1.fc36
nemo-extensions.x86_64                            5.2.4-1.fc36
nemo-fileroller.x86_64                            5.2.0-3.fc36
nemo-image-converter.x86_64                       5.2.0-3.fc36
nemo-preview.x86_64                               5.2.0-3.fc36
nemo-python.x86_64                                5.2.0-3.fc36
nemo-search-helpers.x86_64                        5.2.4-1.fc36
slick-greeter-cinnamon.noarch                     1.5.6-2.fc36
leigh123linux commented 2 years ago

@raniesantos The fedora package works fine here.

[leigh@mpd lightdm]$ rpm -qa gtk{2,3,4} nemo-preview |sort
gtk2-2.24.33-8.fc36.x86_64
gtk3-3.24.34-1.fc36.x86_64
gtk4-4.6.4-1.fc36.x86_64
nemo-preview-5.2.0-3.fc36.x86_64
ghost commented 2 years ago

Interesting, mine says:

gtk2-2.24.33-8.fc36.i686
gtk2-2.24.33-8.fc36.x86_64
gtk3-3.24.34-1.fc36.i686
gtk3-3.24.34-1.fc36.x86_64
gtk4-4.6.5-1.fc36.x86_64
nemo-preview-5.2.0-3.fc36.x86_64

I have no idea why there are i686 versions in there.

And running it directly through the command line still gives me this:

$ nemo-preview ~/Pictures/screenshots/Screenshot\ from\ 2022-04-05\ 06-41-16.png

Cjs-Message: 23:05:35.721: JS WARNING: [/usr/share/nemo-preview/js/viewers/audio.js 32]: Requiring Gtk but it has 3 versions available; use imports.gi.versions to pick one

(nemo-preview-start:7429): GLib-GObject-WARNING **: 23:05:35.724: cannot register existing type 'GtkWidget'

(nemo-preview-start:7429): GLib-GObject-WARNING **: 23:05:35.724: cannot add class private field to invalid type '<invalid>'

(nemo-preview-start:7429): GLib-GObject-WARNING **: 23:05:35.724: cannot add private field to invalid (non-instantiatable) type '<invalid>'

(nemo-preview-start:7429): GLib-GObject-WARNING **: 23:05:35.724: cannot register existing type 'GtkAccessible'

(nemo-preview-start:7429): GLib-GObject-CRITICAL **: 23:05:35.725: g_type_interface_add_prerequisite: assertion 'G_TYPE_IS_INTERFACE (interface_type)' failed

(nemo-preview-start:7429): GLib-CRITICAL **: 23:05:35.725: g_once_init_leave: assertion 'result != 0' failed

(nemo-preview-start:7429): GLib-GObject-CRITICAL **: 23:05:35.725: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

(nemo-preview-start:7429): GLib-GObject-WARNING **: 23:05:35.725: cannot register existing type 'GtkBuildable'

(nemo-preview-start:7429): GLib-GObject-CRITICAL **: 23:05:35.725: g_type_interface_add_prerequisite: assertion 'G_TYPE_IS_INTERFACE (interface_type)' failed

(nemo-preview-start:7429): GLib-CRITICAL **: 23:05:35.725: g_once_init_leave: assertion 'result != 0' failed

(nemo-preview-start:7429): GLib-GObject-CRITICAL **: 23:05:35.725: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

(nemo-preview-start:7429): GLib-GObject-CRITICAL **: 23:05:35.725: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

(nemo-preview-start:7429): Cjs-CRITICAL **: 23:05:35.725: JS ERROR: Error: Unsupported type (null), deriving from fundamental (null)
_init@resource:///org/gnome/gjs/modules/core/overrides/Gtk.js:38:5
@/usr/share/nemo-preview/js/viewers/audio.js:32:13

/usr/bin/nemo-preview: line 15:  7429 Segmentation fault      (core dumped) /usr/libexec/nemo-preview-start

Any ideas on potential fixes?

ghost commented 2 years ago

I tried these exact same commands in a virtual machine using GNOME Boxes.

This is what I got:

[mutahar@fedora ~]$ rpm -qa gtk{2,3,4} nemo-preview |sort
gtk2-2.24.33-8.fc36.x86_64
gtk3-3.24.34-1.fc36.x86_64
gtk4-4.6.5-1.fc36.x86_64
nemo-preview-5.2.0-3.fc36.x86_64
[mutahar@fedora ~]$ nemo-preview Screenshot\ from\ 2022-06-06\ 23-54-17.png 
Cjs-Message: 00:47:23.787: JS WARNING: [/usr/share/nemo-preview/js/viewers/audio.js 32]: Requiring Gtk but it has 3 versions available; use imports.gi.versions to pick one

(nemo-preview-start:2548): GLib-GObject-WARNING **: 00:47:23.791: cannot register existing type 'GtkWidget'

(nemo-preview-start:2548): GLib-GObject-WARNING **: 00:47:23.792: cannot add class private field to invalid type '<invalid>'

(nemo-preview-start:2548): GLib-GObject-WARNING **: 00:47:23.792: cannot add private field to invalid (non-instantiatable) type '<invalid>'

(nemo-preview-start:2548): GLib-GObject-WARNING **: 00:47:23.792: cannot register existing type 'GtkAccessible'

(nemo-preview-start:2548): GLib-GObject-CRITICAL **: 00:47:23.792: g_type_interface_add_prerequisite: assertion 'G_TYPE_IS_INTERFACE (interface_type)' failed

(nemo-preview-start:2548): GLib-CRITICAL **: 00:47:23.792: g_once_init_leave: assertion 'result != 0' failed

(nemo-preview-start:2548): GLib-GObject-CRITICAL **: 00:47:23.792: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

(nemo-preview-start:2548): GLib-GObject-WARNING **: 00:47:23.792: cannot register existing type 'GtkBuildable'

(nemo-preview-start:2548): GLib-GObject-CRITICAL **: 00:47:23.792: g_type_interface_add_prerequisite: assertion 'G_TYPE_IS_INTERFACE (interface_type)' failed

(nemo-preview-start:2548): GLib-CRITICAL **: 00:47:23.792: g_once_init_leave: assertion 'result != 0' failed

(nemo-preview-start:2548): GLib-GObject-CRITICAL **: 00:47:23.792: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

(nemo-preview-start:2548): GLib-GObject-CRITICAL **: 00:47:23.792: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

(nemo-preview-start:2548): Cjs-CRITICAL **: 00:47:23.793: JS ERROR: Error: Unsupported type (null), deriving from fundamental (null)
_init@resource:///org/gnome/gjs/modules/core/overrides/Gtk.js:38:5
@/usr/share/nemo-preview/js/viewers/audio.js:32:13

/usr/bin/nemo-preview: line 15:  2548 Segmentation fault      (core dumped) /usr/libexec/nemo-preview-start
leigh123linux commented 2 years ago

@raniesantos Try

https://bodhi.fedoraproject.org/updates/FEDORA-2022-8b5abb3b2f

https://koji.fedoraproject.org/koji/buildinfo?buildID=1977161

ghost commented 2 years ago

Ok sorry I took so long to get back.

I had to grab the rpms manually because I couldn't figure out how to force dnf to refresh the repo properly (I've only been using Fedora for 2 months).

It seems to have fixed it, the preview shows up now when I press space. If I try it in the terminal, it just spits out some text about mimetypes.