GNOME Bugzilla – Bug 334587
Possible crasher on startup
Last modified: 2006-04-06 16:37:22 UTC
If libbtctl can't initialise the Bluetooth device, then nautilus-sendto will crash on startup (usually, while loading the interface). The problem is that if libbtctl fails, it will create a new GQuark using g_quark_from_static_string. And the GModule documentation says: " If your module introduces static data to common subsystems in the running program, e.g. through calling g_quark_from_static_string ("my-module-stuff"), it must ensure that it is never unloaded, by calling g_module_make_resident(). " So using g_module_close on the bluetooth plugin will remove a quark from a static string, and crash nautilus-sendto whenever another quark is registered. The attached patch adds the "never_unload" struct member so that modules that say so can't be unloaded. It also fixes: - don't use home-made str_has_suffix, we have g_str_has_suffix - use g_dir_open instead of opendir - don't leak the plugins directory on startup - mark as static functions that are not used anywhere else - namespace the plugins so as to avoid clashes with system libraries, confusing the hell out of libtool (libbluetooth.so is the generated library, as well as the system bluetooth library) - use GError properly in the bluetooth module - Fix a couple of warnings in the evo plugin
Created attachment 61254 [details] [review] nst-module-unload-crasher.patch
*** Bug 327876 has been marked as a duplicate of this bug. ***
2006-04-06 Bastien Nocera <hadess@hadess.net> * src/nautilus-sendto-command.c: (nautilus_sendto_plugin_init): Use g_str_has_suffix instead of our home-made str_has_suffix, and use g_dir_open instead of opendir * src/plugins/Makefile.am: namespace the plugins so as to avoid clashes with system libraries, confusing the hell out of libtool (libbluetooth.so is the generated library, as well as the system bluetooth library) * src/plugins/bluetooth.c: (init): use GError properly * src/plugins/evolution.c: (add_evolution_contacts_to_model): fix a compilation warning * src/plugins/gaim.c: * src/nautilus-sendto-plugin.h: Update the plugin struct to allow plugins not to be unloaded, fixes the crashes on startup when the bluetooth plugin fails to initialise (Closes: #334587)