(I'm forwarding this bug upstream on the behalf of another user, for the original downstream bug report please see: https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/370851 ) Repro steps: 0. (using ubuntu 9.04 final; probably works on all xserver 1.6.0 systems though) 1. attach barcode reader hw to X of model [ref #1] 2. scan a barcode ==> immediate segv in xserver, return to GDM, fail. ref #1: the specific barcode reader hw model is: http://www.rakuten.co.jp/fksystem/702994/613735/ Here is the "bt full": Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0xb7a6d6d0 (LWP 4704)] updateSlaveDeviceCoords (master=0x995c258, pDev=0x99e87f8) at ../../dix/getevents.c:168 168 ../../dix/getevents.c: No such file or directory. in ../../dix/getevents.c (gdb) backtrace full #0 updateSlaveDeviceCoords (master=0x995c258, pDev=0x99e87f8) at ../../dix/getevents.c:168 scr = (ScreenPtr) 0x0 i = <value optimized out> lastSlave = <value optimized out> #1 0x080a0958 in GetKeyboardValuatorEvents (events=0x95ad238, pDev=0x99e87f8, type=2, key_code=13, first_valuator=0, num_valuators=0, valuators=0x0) at ../../dix/getevents.c:541 numEvents = <value optimized out> ms = <value optimized out> sym = 52 kbp = <value optimized out> #2 0x080a0cda in GetKeyboardEvents (events=0x95ad238, pDev=0x99e87f8, type=2, key_code=13) at ../../dix/getevents.c:743 No locals. #3 0x080d817b in xf86PostKeyboardEvent (device=0x99e87f8, key_code=13, is_down=1) at ../../../../hw/xfree86/common/xf86Xinput.c:931 nevents = <value optimized out> i = <value optimized out> pointer = (DeviceIntPtr) 0x995be98 #4 0xb58893db in EvdevReadInput (pInfo=0x99b6de0) at ../../src/evdev.c:256 ev = {time = {tv_sec = 1241755265, tv_usec = 788288}, type = 1, code = 5, value = 1} len = <value optimized out> value = 1 dx = 0 dy = 0 abs = 0 button = 0 pEvdev = (EvdevPtr) 0x99e7ce0 #5 0x080c7da7 in xf86SigioReadInput (fd=30, closure=0x99b6de0) at ../../../../hw/xfree86/common/xf86Events.c:311 errno_save = 11 sigstate = 1 #6 0x080b82cc in xf86SIGIO (sig=29) at ../../../../../hw/xfree86/os-support/linux/../shared/sigio.c:114 i = 1 ready = {fds_bits = {1073741824, 0 <repeats 31 times>}} to = {tv_sec = 0, tv_usec = 0} save_errno = 11 r = 1 #7 <signal handler called> No symbol table info available. #8 0xb80c6430 in __kernel_vsyscall () No symbol table info available. #9 0xb7d5e77d in ___newselect_nocancel () from /lib/tls/i686/cmov/libc.so.6 No locals. #10 0x081329f0 in WaitForSomething (pClientsReady=0x99b3398) at ../../os/WaitFor.c:228 i = <value optimized out> waittime = {tv_sec = 59, tv_usec = 249118} wt = (struct timeval *) 0xbfbe3600 timeout = <value optimized out> clientsReadable = {fds_bits = {0 <repeats 32 times>}} clientsWritable = {fds_bits = {163428176, -1213807560, 163429268, 136208372, 163428200, 157825752, 157825752, 157950132, 2, 32, 2, -1210183692, -1210179264, 163431936, -1078053544, -1211157066, -1210179264, 163431936, 163431928, 136208372, 163431936, 163153512, -1078053528, 135499809, 163431936, 136208372, -1078053464, 134696004, 163431936, 23069101, -1078053464, 4096}} curclient = <value optimized out> selecterr = 2264 nready = <value optimized out> devicesReadable = {fds_bits = {163428176, -1235542028, -1078053720, -1235570038, 163428176, 163428176, -1078053720, 135499809, -1231418896, 157825752, 163428200, -1232039351, 163428176, -1231312192, -1211159436, 134688279, 162560600, 157830496, -1211159436, 136208372, 163429260, 157825752, -1078053640, 135788002, 163428176, 136274600, 163431936, -1210179264, 1, 32, -1078053576, -1213853672}} now = 429526 someReady = 0 #11 0x0808d2be in Dispatch () at ../../dix/dispatch.c:367 result = 0 client = (ClientPtr) 0x9b079d0 nready = -1 start_tick = 360 #12 0x080722ed in main (argc=10, argv=0xbfbe3754, envp=0x0) at ../../dix/main.c:397 i = <value optimized out> alwaysCheckForInput = {0, 1}
Created attachment 25633 [details] xorg.log from the system with the barcode reader
Created attachment 25634 [details] xorg.log.old from the system with the barcode reader
Created attachment 25635 [details] lspci -vvnn from the system with the barcode reader
Created attachment 25636 [details] lsusb -v from the system with the barcode reader
Created attachment 25637 [details] xorg.conf from the system with the barcode reader
Created attachment 25638 [details] GDB "bt full" showing the xserver SEGV that the barcode reader causes
When the barcode reader hw is attached /var/log/messages show this: May 2 22:19:01 kumo kernel: [21888.413149] usb 2-1: USB disconnect, address 2 May 2 22:19:16 kumo kernel: [21903.328012] usb 6-2: new low speed USB device using uhci_hcd and address 2 May 2 22:19:16 kumo kernel: [21903.503092] usb 6-2: configuration #1 chosen from 1 choice May 2 22:19:17 kumo kernel: [21903.931545] input: Guest Generic DE64-401 as /devices/pci0000:00/0000:00:1d.0/usb6/6-2/6-2:1.0/input/input7 May 2 22:19:17 kumo kernel: [21903.944051] cypress 0003:04B4:DE64.0004: input,hidraw3: USB HID v1.00 Keyboard [Guest Generic DE64-401] on usb-0000:00:1d.0-2/input0
This particular barcode reader previosuly worked well using Ubuntu 8.04 hardy, which shipped the following versions: xserver-xorg-core 1.4.1~git20080131-1ubuntu9.2 xserver-xorg-input-evdev 1.2.0-1ubuntu2 Ubuntu 9.04 jaunty where the SEGV is confirmed, uses these versions: xserver-xorg-core 1.6.0-0ubuntu14 xserver-xorg-input-evdev 2.1.1-1ubuntu4 So this is a regression. Versions of X server and evdev in various distro releases: https://launchpad.net/ubuntu/+source/xserver-xorg-input-evdev https://launchpad.net/ubuntu/+source/xorg-server
please attach the output of evtest against the device file. It'll help creating a software emulation of the device to reproduce the bug. http://people.freedesktop.org/~whot/evtest.c
Created attachment 25788 [details] evtest output Peter and Martin, please find evtest output attached, according to Martin's very detailed instructions: sudo ./evtest /dev/input/event7 > output.txt
Created attachment 25860 [details] evtest output of a working barcode reader Not sure if this could be of any help, but this is the evtest output of a working barcode reader (this one : http://item.rakuten.co.jp/fksystem/z-3021/ )
Peter, is there anything else you need for this bug? Will you be able to re-create the SEGV based on the data Mathieu has supplied? It looks like updateSlaveDeviceCoords() is calling miPointerGetScreen() which returns NULL and then updateSlaveDeviceCoords() derefs that pointer trying to get the width of the screen. I'm guessing there should be a proper Screen associated with the barcode reader device?
No, I can reproduce the bug with this information. Trickier than expected, I think it triggered 5 different bugs already, some in evdev, some in xserver.
FWIW, git master from evdev and xserver now run stable with this device. This could be interesting to cherry-pick back...
Terrific! Thanks a lot. In which X version(s) is the fix likely to ship? For potential cherry picking, do you have any SHA1's to recommend? @Mathieu, if you're comfortable building X from source, it would be nice to get the fix confirmed.
(In reply to comment #15) > Terrific! Thanks a lot. In which X version(s) is the fix likely to ship? For > potential cherry picking, do you have any SHA1's to recommend? not yet, I need to go through all the patches I pushed over the last weeks. There was at least one or two in evdev and a few in the server. All the fixes will be in 1.7 though.
Thanks Peter. > @Mathieu, if you're comfortable building X from source I'm afraid I'd prefer to wait for a more easy way, like a package...
Ok so, let's keep an eye on the xserver package for karmic (which I think will get updated to the 1.7 bits eventually). Once that's out you can just download and boot and ISO and test from that live CD: https://launchpad.net/ubuntu/+source/xorg-server
OK, I will check with Ubuntu Karmic then.
I'm closing this bug as FIXED. It works with current git but cherry-picking them back to 1.6.x is likely not happening. Sorry.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.