GNOME Bugzilla – Bug 674827
gnome-settings-daemon crashed in engine_coldplug()
Last modified: 2013-01-22 21:25:46 UTC
Ubuntu got this crash report: https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/868928
+ Trace 230138
The relevant code is: array = up_client_get_devices (manager->priv->up_client); for (i=0;i<array->len;i++) { It doesn't make sense to me. I can't quite see how array can be NULL at that juncture, given that we call up_client_enumerate_devices_sync() beforehand. But I do see that the code could be more defensive. NULL is a valid return for up_client_get_devices(), so it should be safe-guarded. Patch coming.
Created attachment 212832 [details] [review] Proposed patch
Hmm, up_client_get_devices should not return NULL unless there's a critical warning being printed. I think we need to find the root cause of why priv->up_client is invalid (or done_enumerate is FALSE) at this point.
Agreed, but I could not trace a path through the code that would end up with get_devices() failing. :-/
Michael, when you've managed to get more info, or a more recent reproducer, let us know.
Closing this bug report as no further information has been provided. Please feel free to reopen this bug if you can provide the information asked for. Thanks!
I'd like to petition for this patch again. (I can't provide more recent reproducers as asked, since it wasn't a reliable crasher in the first place and I'm not about to remove the patch from Ubuntu and inflict crashes on our users.) I sympathize that you want to find the root cause. But that shouldn't prevent you from being defensive programmers and preventing a crash that users do see. A) The API call up_client_get_devices() is allowed to return NULL and your code doesn't provide for that case. B) Ubuntu was seeing quite a few of these crashes before we applied this patch. We have gotten no regression reports since then. Regardless of why up_client_get_devices() is returning NULL, I'd argue that the code should be prepared to handle it. The perfect should not be the enemy of the good.
A simplified version pushed to master.