Created attachment 325697 [details] Patch for current gdm-2.16 package in EL5 Description of problem: The gdmgreeter will fail to start if a xinput device is defined in the xorg.conf but is not actually plugged in. This happens for example when a Wacom tablet was added in xorg.conf but the device is not plugged in when gdm starts. Version-Release number of selected component (if applicable): gdm-2.16.0-46 How reproducible: 100% reproducible Steps to Reproduce: 1. Add devices to teh xorg.conf InputDevice "stylus" "SendCoreEvents" InputDevice "eraser" "SendCoreEvents" InputDevice "cursor" "SendCoreEvents" Section "InputDevice" Identifier "stylus" Driver "wacom" ... EndSection Section "InputDevice" Identifier "eraser" Driver "wacom" ... EndSection Section "InputDevice" Identifier "cursor" Driver "wacom" ... EndSection 2. Do _not_ plug any additional device 3. Restart gdm Actual results: “The greeter application appears to be crashing. Attempting to use a different one.” Expected results: The greeter is displayed correctly. Additional info: The problem comes from the additional modules dwellmouselistener and keymouselistener which try to open the extended devices reported by XInput without checking for errors. In gui/modules/keymouselistener.c and gui/modules/dwellmouselistener.c, the same code is duplicated and does: static void init_xinput (GdkDisplay *display, GdkWindow *root) { ... devices = XListInputDevices (GDK_DISPLAY_XDISPLAY (display), &num_devices); ... for (i=0; i < num_devices; i++) { if (devices[i].use == IsXExtensionDevice) { device = XOpenDevice (GDK_DISPLAY_XDISPLAY (display), devices[i].id); for (j=0; j < device->num_classes && number < 39; j++) { switch (device->classes[j].input_class) { ... That code works in most cases, except when the device is defined but not actually there, in which case the call to XOpenDevice() will cause an X error. Since there is no mechanism in place to trap that error, the gdmgreeter will fail and cause the error reported. The proper way (IMHO) to handle this is to protect the call to XOpenDevice() by wrapping it in an X error handler, ie change the code to: static void init_xinput (GdkDisplay *display, GdkWindow *root) { ... devices = XListInputDevices (GDK_DISPLAY_XDISPLAY (display), &num_devices); ... for (i=0; i < num_devices; i++) { if (devices[i].use == IsXExtensionDevice) { gdk_error_trap_push (); device = XOpenDevice (GDK_DISPLAY_XDISPLAY (display), devices[i].id); if (gdk_error_trap_pop()) { if (debug_gestures) syslog (LOG_WARNING, "Failed to open input devices %i (%s)", devices[i].id, devices[i].name); continue; } for (j=0; j < device->num_classes && number < 39; j++) { switch (device->classes[j].input_class) { ... The bug is still upstream (at least in gdm that comes with gnome-2.20, the last one before gdm was changed).
Created attachment 325700 [details] Same patch if the one from bz#473262 is applied Now, this patch modifies a part of the code that is modified by another patch for BZ#473262 (“Mouse cursor not movable when using tablet instead of mouse”) The patch for BZ#473262 removes the XInput code from “dwellmouselistener.c” so if that other patch for BZ#473262 is applied, then better use this one patch that fixes only the portion remaining in “keymouselistener.c”
devack+
building as gdm-2.16.0-49.el5 now. Marking MODIFIED for QA.
~~ Attention - RHEL 5.4 Beta Released! ~~ RHEL 5.4 Beta has been released! There should be a fix present in the Beta release that addresses this particular request. Please test and report back results here, at your earliest convenience. RHEL 5.4 General Availability release is just around the corner! If you encounter any issues while testing Beta, please describe the issues you have encountered and set the bug into NEED_INFO. If you encounter new issues, please clone this bug to open a new issue and request it be reviewed for inclusion in RHEL 5.4 or a later update, if it is not of urgent severity. Please do not flip the bug status to VERIFIED. Only post your verification results, and if available, update Verified field with the appropriate value. Questions can be posted to this bug or your customer or partner representative.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2009-1364.html