GNOME Bugzilla – Bug 657244
gnome-settings-daemon crashed with SIGSEGV in g_simple_async_result_complete()
Last modified: 2012-03-09 14:51:42 UTC
this report has been filed here: https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/832603 ".
+ Trace 228181
Thread 1 (Thread 0xb77fc840 (LWP 1233))
I can't actually see where it's crashing as this file doesn't match the upstream code. Let me know if you can actually provide the snippet of code that "line 2048" represents for that exact version of gnome-settings-daemon. (Even better, get a backtrace with an unmodified 3.1.90, the media-keys plugin is heavily modified downstream)
I got this as well, and gave the resulting CoreDump an analysis. In on_bus_gotten, manager->priv->introspection_data is NULL. This can happen if gsd_xrandr_manager_stop/gsd_media_keys_manager_stop/etc is called between register_manager and on_bus_gotten. As I'm not a gnome expert, please review the attached patch before applying - and if you think it makes sense, extend it to do media_keys_manager, power_manager, etc as well. It also adds an explicit ref/unref to make sure the manager is not a dangling pointer at this point, but I doubt this is needed.
Created attachment 197659 [details] [review] Patch example (not complete)
As I said on the Launchpad bug, your fix is just for the symptom, not the real problem, which seems to be that we have _stop being called when the dbus operation is still in progress. So, I think we either should use the _sync version of g_bus_get (or even better, share a GDBusConnection between all the plugins, as this crash happens in media-keys, xrandr and power plugins) or use a GCancellable on the g_bus_get call and g_cancellable_cancel it in _stop, although that would make the call to complete and the callback being called (but I guess we can just check if the cancellable is cancelled there). Richard, Bastien, what do you think?
GDBusConnection is already a singleton when returned from g_bus_get() or g_bus_get_sync(). Using a cancellable is fine by me, but I'd certainly like to see a patch before it's committed.
Setting to NEW as this is apparently an issue that needs to be fixed.
Should already have been fixed by: commit ae303fb2b05265888f8b65ba2236782693369da7 Author: Matthias Clasen <mclasen@redhat.com> Date: Fri Jan 20 09:11:14 2012 -0500 Media keys: Be more careful when shutting down The gtksettings instance is also initialized in an idle, so we must handle it still being NULL when we shut down. commit 42f9427729d763e7fd62aec9e15b036531489682 Author: Matthias Clasen <mclasen@redhat.com> Date: Fri Jan 20 09:00:54 2012 -0500 media-keys: Be more careful when finalizing The keys array is initalized in an idle, so if we go right back down because another instance of gsd is already running, we crash in finalize, trying to clear a nonexisting array. Amongst others. Let us know if you can still reproduce on a recent 3.3 gnome-settings-daemon build.
I'm closing as FIXED then. Please reopen if this is still an issue besides the patches. Also feel free to set to VERIFIED once it's confirmed that the issue is resolved.