New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 659261 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

X11 error causes mustash to crash

Project Member Reported by kylec...@chromium.org, Oct 25 2016

Issue description

There is an X11 error when starting mustash. This seems to occur around 1/10 times mustash starts. This error causes what looks like service:ui to crash which in turn brings down the rest of mustash. The following X11 error text is output to stderr.

X Error of failed request:  XI_BadDevice (invalid Device parameter)
  Major opcode of failed request:  131 (XInputExtension)
  Minor opcode of failed request:  39 (X_GetDeviceProperty)
  Device id in failed request: 0x3e00001
  Serial number of failed request:  71
  Current serial number in output stream:  71

 
It looks like the problem is in X11HotplugEventHandler in the helper method GetDevicePath(). GetDevicePath() calls XGetDeviceProperty() with an invalid device id.

$ xinput list
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ Logitech G500s Laser Gaming Mouse       	id=8	[slave  pointer  (2)]
⎜   ↳ Logitech G500s Laser Gaming Mouse       	id=9	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ Power Button                            	id=6	[slave  keyboard (3)]
    ↳ Power Button                            	id=7	[slave  keyboard (3)]
    ↳ HP USB Keyboard                         	id=10	[slave  keyboard (3)]
    ↳ HP USB Keyboard                         	id=11	[slave  keyboard (3)]
    ↳ HP WMI hotkeys                          	id=12	[slave  keyboard (3)]

The failure seems to come from XOpenDevice(). It's called with a valid device id, on my system device.deviceid=7. The XDevice* that XOpenDevice returns isn't null, so GetDevicePath() continues, but dev->device_id=0 (or dev->device_id=1) even though device.deviceid=7. When dev is passed to XGetDeviceProperty() it causes the error.
Project Member

Comment 2 by bugdroid1@chromium.org, Nov 2 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c32a70410b6c23d686dce57bd72080f43a3e5a60

commit c32a70410b6c23d686dce57bd72080f43a3e5a60
Author: kylechar <kylechar@chromium.org>
Date: Wed Nov 02 03:56:44 2016

Check that XOpenDevice() returns valid device_id.

XOpenDevice() is sometimes returning a non-null XDevice* but the
contents are garbage. This shouldn't be happening but for now we can
check if the device_id is correct. If not, we exit early to avoid a
crash from X BadDevice error.

BUG= 659261 

Review-Url: https://codereview.chromium.org/2471653002
Cr-Commit-Position: refs/heads/master@{#429199}

[modify] https://crrev.com/c32a70410b6c23d686dce57bd72080f43a3e5a60/ui/events/platform/x11/x11_hotplug_event_handler.cc

Owner: kylec...@chromium.org
Status: Fixed (was: Untriaged)

Sign in to add a comment