Subject: Re: bug#58221: nautilus: Crashes loading KgxNautilus plugin twice (problems with NAUTILUS_EXTENSION_PATH)

From: Christopher Baines <[email-masked]>
Date: Wed, 09 Nov 2022 13:54:32 +0100

Tobias Kortkamp <[email-masked]> writes:

> I updated from c8112f3bd95269ce4aca12dedbfe61bb6b37acae to
> 0dec41f329c37a4293a2a8326f1fe7d9318ec455 and now Nautilus crashes
> with:
>
> (org.gnome.Nautilus:3664): GLib-GObject-WARNING **: 13:25:09.877: Two different plugins tried to register 'KgxNautilus'.
>
> (org.gnome.Nautilus:3664): GLib-GObject-CRITICAL **: 13:25:09.877: g_type_add_interface_dynamic: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed
>
> (org.gnome.Nautilus:3664): GLib-GObject-WARNING **: 13:25:09.877: Two different plugins tried to register 'KgxNautilusMenuItem'.
>
> ** (org.gnome.Nautilus:3664): WARNING **: 13:25:09.882: Tracker 2 migration: Couldn't run `tracker3`: Failed to execute child process “tracker3” (No such file or directory)
>
> (org.gnome.Nautilus:3664): GLib-GObject-WARNING **: 13:25:10.222: invalid cast from 'KgxNautilus' to '<invalid>'
>
> (org.gnome.Nautilus:3664): GLib-GObject-CRITICAL **: 13:25:10.222: g_object_new_valist: assertion 'G_TYPE_IS_OBJECT (object_type)' failed
>
> (org.gnome.Nautilus:3664): GLib-GObject-CRITICAL **: 13:25:10.222: g_object_get: assertion 'G_IS_OBJECT (object)' failed
>
> The problem seems to be that NAUTILUS_EXTENSION_PATH contains the same
> path twice and that it tries to load KgxNautilus from each of the paths:
>
> $ echo $NAUTILUS_EXTENSION_PATH
> /run/current-system/profile/lib/nautilus/site-extensions:/run/current-system/profile/lib/nautilus/site-extensions
>
> Running Nautilus like this works fine:
>
> $ NAUTILUS_EXTENSION_PATH=/run/current-system/profile/lib/nautilus/site-extensions nautilus

Thanks for investigating Tobi, I've been experiencing this too, but
didn't get anywhere trying to use GDB, so thanks for tracking it down!

This NAUTILUS_EXTENSION_PATH is a Guix specific modification made to
nautilus at build time, so yeah, something is up here and it's down to
us to fix it.

Maybe the duplication of the directory in the search path is something
to fix, but I guess the code in nautilus using the search path probalbly
needs to be smarter to avoid loading plugins twice.

Chris