After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 346401 - nautilus doesn't finalize extensions
nautilus doesn't finalize extensions
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Extension Library
0.x.x [obsolete]
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 515913 (view as bug list)
Depends on:
Blocks: 345754
 
 
Reported: 2006-07-02 14:47 UTC by Gustavo Carneiro
Modified: 2008-02-12 09:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (2.62 KB, patch)
2006-07-02 14:48 UTC, Gustavo Carneiro
none Details | Review

Description Gustavo Carneiro 2006-07-02 14:47:37 UTC
nautilus_module_shutdown() is not being called for loaded extensions when nautilus exits normally.
Comment 1 Gustavo Carneiro 2006-07-02 14:48:32 UTC
Created attachment 68263 [details] [review]
patch
Comment 2 Gustavo Carneiro 2007-06-19 16:52:30 UTC
it's been almost a year, ping! :P
Comment 3 Martin Wehner 2007-06-23 12:24:02 UTC
Thanks and sorry for the delay. I committed something based on your patch on HEAD: It uses the eel_debug_shutdown_* infrastructure to install a shutdown call to the existing nautilus_module_extension_list_free function. 

2007-06-23  Martin Wehner  <martin.wehner@gmail.com>

	* libnautilus-private/nautilus-module.c: (nautilus_module_init):
	Unref extension modules at shutdown. (#346401)
	Based on patch from Gustavo Carneiro  <gjc@inescporto.pt>
Comment 4 Kjartan Maraas 2007-09-10 11:53:27 UTC
Could this be what's causing the invalid reads I see when running under valgrind:

 ==14141== Invalid read of size 4
==14141==    at 0x8121B4A: nautilus_module_extension_list_free (nautilus-module.c:249)
==14141==    by 0x405D7FB: eel_debug_shut_down (eel-debug.c:110)
==14141==    by 0x807BE53: main (nautilus-main.c:563)
==14141==  Address 0x5B1F0C4 is 4 bytes inside a block of size 12 free'd
==14141==    at 0x402213F: free (vg_replace_malloc.c:233)
==14141==    by 0x4FDE340: g_free (gmem.c:187)
==14141==    by 0x4FF29B6: g_slice_free1 (gslice.c:886)
==14141==    by 0x4FD4D9F: g_list_remove (glist.c:231)
==14141==    by 0x8121B06: module_object_weak_notify (nautilus-module.c:148)
==14141==    by 0x4F7B840: weak_refs_notify (gobject.c:1466)
==14141==    by 0x4FC4AE6: g_datalist_id_set_data_full (gdataset.c:242)
==14141==    by 0x4F7BF28: g_object_real_dispose (gobject.c:534)
==14141==    by 0x4F7C17A: g_object_unref (gobject.c:1765)
==14141==    by 0x8121B49: nautilus_module_extension_list_free (nautilus-module.c:250)
==14141==    by 0x405D7FB: eel_debug_shut_down (eel-debug.c:110)
==14141==    by 0x807BE53: main (nautilus-main.c:563)
==14141==
==14141== Invalid read of size 4
==14141==    at 0x4FF35B1: g_slice_free_chain_with_offset (gslice.c:955)
==14141==    by 0x4FD4DF0: g_list_free (glist.c:53)
==14141==    by 0x8121B58: nautilus_module_extension_list_free (nautilus-module.c:252)
==14141==    by 0x405D7FB: eel_debug_shut_down (eel-debug.c:110)
==14141==    by 0x807BE53: main (nautilus-main.c:563)
==14141==  Address 0x5B1F0C4 is 4 bytes inside a block of size 12 free'd
==14141==    at 0x402213F: free (vg_replace_malloc.c:233)
==14141==    by 0x4FDE340: g_free (gmem.c:187)
==14141==    by 0x4FF29B6: g_slice_free1 (gslice.c:886)
==14141==    by 0x4FD4D9F: g_list_remove (glist.c:231)
==14141==    by 0x8121B06: module_object_weak_notify (nautilus-module.c:148)
==14141==    by 0x4F7B840: weak_refs_notify (gobject.c:1466)
==14141==    by 0x4FC4AE6: g_datalist_id_set_data_full (gdataset.c:242)
==14141==    by 0x4F7BF28: g_object_real_dispose (gobject.c:534)
==14141==    by 0x4F7C17A: g_object_unref (gobject.c:1765)
==14141==    by 0x8121B49: nautilus_module_extension_list_free (nautilus-module.c:250)
==14141==    by 0x405D7FB: eel_debug_shut_down (eel-debug.c:110)
==14141==    by 0x807BE53: main (nautilus-main.c:563)
==14141==
==14141== Invalid write of size 1
==14141==    at 0x4023654: memset (mc_replace_strmem.c:490)
==14141==    by 0x4FF376A: g_slice_free_chain_with_offset (gslice.c:960)
==14141==    by 0x4FD4DF0: g_list_free (glist.c:53)
==14141==    by 0x8121B58: nautilus_module_extension_list_free (nautilus-module.c:252)
==14141==    by 0x405D7FB: eel_debug_shut_down (eel-debug.c:110)
==14141==    by 0x807BE53: main (nautilus-main.c:563)
==14141==  Address 0x5B1F0C0 is 0 bytes inside a block of size 12 free'd
==14141==    at 0x402213F: free (vg_replace_malloc.c:233)
==14141==    by 0x4FDE340: g_free (gmem.c:187)
==14141==    by 0x4FF29B6: g_slice_free1 (gslice.c:886)
==14141==    by 0x4FD4D9F: g_list_remove (glist.c:231)
==14141==    by 0x8121B06: module_object_weak_notify (nautilus-module.c:148)
==14141==    by 0x4F7B840: weak_refs_notify (gobject.c:1466)
==14141==    by 0x4FC4AE6: g_datalist_id_set_data_full (gdataset.c:242)
==14141==    by 0x4F7BF28: g_object_real_dispose (gobject.c:534)
==14141==    by 0x4F7C17A: g_object_unref (gobject.c:1765)
==14141==    by 0x8121B49: nautilus_module_extension_list_free (nautilus-module.c:250)
==14141==    by 0x405D7FB: eel_debug_shut_down (eel-debug.c:110)
==14141==    by 0x807BE53: main (nautilus-main.c:563)
==14141==
Comment 5 Matthias Clasen 2007-09-10 20:00:14 UTC
Yes it does.

If you want to do something like that, it should be something like:

void
nautilus_module_extension_list_free (gpointer data)
{
        GList *l, *next;

        for (l = module_objects; l != NULL; l = next) {
                next = l->next;
                g_object_unref (l->data);
        }
        g_list_free (module_objects);
}


Comment 6 Alexander Larsson 2007-09-11 15:10:13 UTC
fixed in svn
Comment 7 Alexander Larsson 2007-09-11 15:17:58 UTC
reverted fix due to hard code freeze.
Comment 8 Christian Neumair 2007-10-03 21:48:00 UTC
Re-applied to HEAD. Closing.
Comment 9 Christian Kirbach 2007-10-07 21:11:00 UTC
Bug 480807 may be a dup
Comment 10 Cosimo Cecchi 2008-02-12 09:56:54 UTC
*** Bug 515913 has been marked as a duplicate of this bug. ***