GNOME Bugzilla – Bug 628526
gnome-settings-daemon crashes in gsd-clipboard-manager.c:628 conversions is NULL
Last modified: 2010-09-23 16:33:17 UTC
(gdb) bt full
+ Trace 223513
It looks like XGetWindowProperty sets &type to XA_ATOM_PAIR and &nitems to 0 so the following loop is never evaluated and later, when we access conversions->next it dies. I can't reproduce it myself, reporter has managed to crash g-s-d by using kolourpaint4 but I couldn't do it - probably I don't know how to connect KDE applications to g-s-d.
Created attachment 169356 [details] [review] return if conversions == NULL We could probably remove critical message completely but the patch is from the downstream bug and I've decided to display it so we know something isn't right.
Created attachment 170257 [details] [review] return early from convert_clipboard is nitems is set to 0 XGetWindowProperty returns Success but still sets nitems_return to 0 - I'm not sure whether it's a bug in function or is it a valid result. If nitems_return is set to 0 return early to avoid crash on accessing a "next" field of the NULL conversions pointer. XGetWindowProperty manual also states that the function always allocates one more byte for prop_return (which is multiple in g-s-d code) so freeing it is supposed to be safe - but I'm not sure if it allocates this byte even if actual_type_return is set to None so lets check whether multiple isn't NULL before freeing it.
Review of attachment 170257 [details] [review]: Committed to both master and gnome-2-32 branch
*** Bug 628926 has been marked as a duplicate of this bug. ***