GNOME Bugzilla – Bug 724789
g-s-d hardening for BadDevice errors
Last modified: 2014-03-04 16:19:57 UTC
Created attachment 269785 [details] [review] 0001-mouse-wrap-device-button-mapping-into-gdk_error_trap.patch g-s-d struggles to handle devices that appear and immediately disappear (libinput test suite). The expectation must be that any XI call can fail with BadDevice. Most calls are handled correctly already, but XCloseDevice can fail too with a BadDevice error.
Created attachment 269786 [details] [review] 0002-mouse-wrap-pointer-acceleration-changes-into-a-gdk_e.patch
Created attachment 269787 [details] [review] 0003-common-provide-a-helper-function-to-close-an-XDevice.patch I need to go through the other plugins to audit them for similar issues, but these fix all the crashes I've been seeing so far.
Review of attachment 269785 [details] [review]: Looks good.
Review of attachment 269786 [details] [review]: Looks good otherwise ::: plugins/mouse/gsd-mouse-manager.c @@ +462,3 @@ + if (gdk_error_trap_pop ()) + g_warning ("Error in setting acceleration on on \"%s\"", gdk_device_get_name (device)); "on on"?
Review of attachment 269787 [details] [review]: Looks good otherwise. ::: plugins/common/gsd-input-helper.h @@ +81,3 @@ char * xdevice_get_device_node (int deviceid); int xdevice_get_last_tool_id (int deviceid); +void device_close_safely (XDevice *xdevice); xdevice_close() is a nicer name. I don't think we need the "safely"
Created attachment 269858 [details] [review] 0002-mouse-wrap-pointer-acceleration-changes-into-a-gdk_e.patch fixed error message
Created attachment 269859 [details] [review] 0003-common-provide-a-helper-function-to-close-an-XDevice.patch Function renamed to xdevice_close fwiw, all three patches are for master
Created attachment 269860 [details] [review] GNOME3.10: 0001-mouse-wrap-device-button-mapping-into-gdk_error_trap.patch Patch for 3.10.2 (Fedora 20), that's the one I tested :)
Created attachment 269861 [details] [review] GNOME3.10: 0002-mouse-wrap-pointer-acceleration-changes-into-a-gdk_e.patch Patch for 3.10.2 (Fedora 20)
Created attachment 269862 [details] [review] GNOME3.10: 0003-common-provide-a-helper-function-to-close-an-XDevice.patch Patch for 3.10.2 (Fedora 20)
Review of attachment 269858 [details] [review]: ++
Review of attachment 269859 [details] [review]: Looks good.
Review of attachment 269860 [details] [review]: Looks good.
Review of attachment 269861 [details] [review]: ++
Review of attachment 269862 [details] [review]: ++
Pushed all of these to the respective branches.