Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/index.php/Reporting_Bug_Guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#23577 - [xf86-input-joystick] Segmentation fault upon startup

Attached to Project: Arch Linux
Opened by Paul McCartney (stinke) - Sunday, 03 April 2011, 18:18 GMT
Last edited by Jan de Groot (JGC) - Friday, 18 November 2011, 09:36 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Jan de Groot (JGC)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Segmentation fault upon startup

Additional info:
* package version(s)
* config and/or log files etc.


Steps to reproduce:

XOrg Config
//////////////////////////////////////////////////////////////////////////////////////////

Section "InputDevice"
Identifier "Joystick1"

Driver "joystick"
Option "Device" "/dev/input/by-id/usb-Jess_Technology_Co.__Ltd._USB_Game_Controller-event-joystick"
# Option "Device" "/dev/input/js0"

Option "DebugLevel" "0" #"3"
Option "StartKeysEnabled" "True"
Option "StartMouseEnabled" "True"
Option "SendCoreEvents" "false"

Option "AutoRepeat" "200 4"

Option "MapAxis1" "mode=relative keyhigh=114 keylow=113 deadzone=1000 axis=0.2"
Option "MapAxis2" "mode=relative keylow=111 keyhigh=116 deadzone=1000 axis=0.2"

Option "MapButton1" "key=36" # Return
Option "MapButton2" "key=53" # X
Option "MapButton3" "key=9" # Escape
Option "MapButton5" "key=21" # Volume Plus
Option "MapButton7" "key=20" # Volume Minus
Option "MapButton9" "key=54" # C - options in XMBC
EndSection

XOrg output
//////////////////////////////////////////////////////////////////////////////////////////

This is a pre-release version of the X server from The X.Org Foundation.
It is not supported in any way.
Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.
Select the "xorg" product for bugs you find in this release.
Before reporting bugs in pre-release versions please check the
latest version in the X.Org Foundation git repository.
See http://wiki.x.org/wiki/GitPage for git access instructions.

X.Org X Server 1.10.0.901 (1.10.1 RC 1)
Release Date: 2011-03-29
X Protocol Version 11, Revision 0
Build Operating System: Linux 2.6.37-ARCH x86_64
Current Operating System: Linux gray 2.6.38-ARCH #1 SMP PREEMPT Wed Mar 30 08:47:36 CEST 2011 x86_64
Kernel command line: root=/dev/sda1
Build Date: 29 March 2011 09:11:14AM

Current version of pixman: 0.20.2
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Sun Apr 3 21:48:04 2011
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using config directory: "/etc/X11/xorg.conf.d"
(EE) Failed to load module "fbdev" (module does not exist, 0)

Backtrace:
0: /usr/bin/X (xorg_backtrace+0x26) [0x49f3e6]
1: /usr/bin/X (0x400000+0x60b69) [0x460b69]
2: /lib/libpthread.so.0 (0x7fa490240000+0xf750) [0x7fa49024f750]
3: /lib/libc.so.6 (strlen+0x11) [0x7fa48f222541]
4: /lib/libc.so.6 (__strdup+0x16) [0x7fa48f222296]
5: /usr/bin/X (xf86AddNewOption+0x21) [0x473c71]
6: /usr/bin/X (xf86OptionListDuplicate+0x31) [0x473e61]
7: /usr/lib/xorg/modules/input/joystick_drv.so (0x7fa48cfc3000+0x3976) [0x7fa48cfc6976]
8: /usr/lib/xorg/modules/input/joystick_drv.so (0x7fa48cfc3000+0x19ee) [0x7fa48cfc49ee]
9: /usr/bin/X (0x400000+0x7b191) [0x47b191]
10: /usr/bin/X (InitInput+0x52) [0x46e392]
11: /usr/bin/X (0x400000+0x22ac6) [0x422ac6]
12: /lib/libc.so.6 (__libc_start_main+0xed) [0x7fa48f1c6f6d]
13: /usr/bin/X (0x400000+0x22ded) [0x422ded]
Segmentation fault at address 0x8

Fatal server error:
Caught signal 11 (Segmentation fault). Server aborting


Please consult the The X.Org Foundation support
at http://wiki.x.org
for help.
Please also check the log file at "/var/log/Xorg.0.log" for additional information.

xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error
This task depends upon

Closed by  Jan de Groot (JGC)
Friday, 18 November 2011, 09:36 GMT
Reason for closing:  Fixed
Additional comments about closing:  fixed in xf86-input-joystick 1.6.0-3 (current git master).
Comment by Jelle van der Waa (jelly) - Sunday, 03 April 2011, 21:38 GMT
did you start dbus, else what window manager are you trying to launch and mv the xorg.conf and try again.

Did you install your graphic cards driveR?
Comment by Jan de Groot (JGC) - Monday, 04 April 2011, 09:11 GMT
This is a bug in the joystick driver, not in xorg-server.
Comment by Jan de Groot (JGC) - Monday, 04 April 2011, 09:24 GMT
Can you attach the complete Xorg.0.log instead of pasting only the parts you did above?
Comment by Paul McCartney (stinke) - Monday, 04 April 2011, 17:29 GMT
DBus is started. I run XBMC on that machine thus the joystick.
I tried to comment out all / single option lines without success.
The crash does not take place when I completely disable the joystick
input device.
Comment by Paul McCartney (stinke) - Monday, 04 April 2011, 19:10 GMT
DBus is started. I run XBMC on that machine thus the joystick.
I tried to comment out all / single option lines without success.
The crash does not take place when I completely disable the joystick
input device.
Comment by Paul McCartney (stinke) - Friday, 03 June 2011, 10:29 GMT
Okay, I rolled this up a little.

I have:
extra/xorg-server 1.10.2-1 (xorg)
extra/xorg-server-common 1.10.2-1
extra/xf86-input-joystick 1.6.0-1

Backtrace:
0: /usr/bin/X (xorg_backtrace+0x26) [0x49f546]
1: /usr/bin/X (0x400000+0x60cf9) [0x460cf9]
2: /lib/libpthread.so.0 (0x7feb4a086000+0xf750) [0x7feb4a095750]
3: /lib/libc.so.6 (strlen+0x11) [0x7feb49062541]
4: /lib/libc.so.6 (__strdup+0x16) [0x7feb49062296]
5: /usr/bin/X (xf86AddNewOption+0x21) [0x473db1]
6: /usr/lib/xorg/modules/input/joystick_drv.so (0x7feb46e1e000+0x3f7d) [0x7feb46e21f7d]
7: /usr/lib/xorg/modules/input/joystick_drv.so (0x7feb46e1e000+0x21ac) [0x7feb46e201ac]
8: /usr/bin/X (0x400000+0x7b341) [0x47b341]
9: /usr/bin/X (InitInput+0x52) [0x46e4d2]
10: /usr/bin/X (0x400000+0x22b46) [0x422b46]
11: /lib/libc.so.6 (__libc_start_main+0xed) [0x7feb49006f6d]
12: /usr/bin/X (0x400000+0x22e6d) [0x422e6d]
Segmentation fault at address 0x8

Approach:
I dumped the options parameters passed to xf86AddNewOption
in xf86-input-joystick-1.6.0/src/jstk_key.c->jstkKeyboardHotplug(InputInfoPtr pInfo, int flags)

.. the pInfo->options list has this entry:
SendcoreEvents=(null)

strdup in xf86AddNewOption doesn't like that.
As far as I can tell my xorg.conf is perfectly fine however.
Just so see if thats the only issue I remove the option from the options list
while printing it out.

Anyways..

with this fix X doesn't crash anymore but X tells me
I didn't supply a driver option (!). True; It's not in
the options dump but is needed by the
NewInputDeviceRequest(iopts, attrs, &dev) function.

So I do a
xf86AddNewOption(o, "Driver","Joystick");
... and everything works perfectly.

Summary:
- X (/whoever) is passing the SendcoreEvents without a value in the InputInfoPtr option to jstkKeyboardHotplug
- The Driver option is not passed along so that NewInputDeviceRequest(iopts, attrs, &dev) fails.

I added my patched up file with outputs in the Xorg.0.log

Loading...