Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_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#16402 - [sdl] 1.2.13-3 segfaults on certain joystick inputs

Attached to Project: Arch Linux
Opened by John Regan (saxindustries) - Wednesday, 30 September 2009, 04:59 GMT
Last edited by Allan McRae (Allan) - Friday, 23 October 2009, 00:07 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Allan McRae (Allan)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
sdl has a bug with certain joysticks/pads that allow switching between an analog mode and digital mode, such as PlayStation 2 controllers (via USB adaptor). When the joypad is in analog mode, SDL produces a segfault when any direction on the digital pad is pressed. When in digital mode, the pad works fine (but the analog joysticks are inactive).

As far as I can tell, it is a known bug upstream, the current fix is to define NO_LOGICAL_JOYSTICKS in CFLAGS.

I'm not sure how many joysticks this affects, nor do I know if the current fix will break functionality with other joysticks. Also, the only system I have is x86_64, so I'm not sure if this affects other architectures or not (as far as I can tell, it does).

I've been able to rebuild the sdl package on my x86_64 machine by editing the PKGBUILD file and adding -DNO_LOGICAL_JOYSTICKS to my CFLAGS. After rebuilding, all my joystick-using programs work with the joystick set to analog mode.


Additional info:
* package version(s)
sdl 1.2.13-3 from extra

Steps to reproduce:
Load any joystick using program.
Set joystick to digital mode: joypad works fine.
Set joystick to analog mode, press a direction on the digital pad: segmentation fault.

Again, I'm not sure if this is something that arch should add to CFLAGS or not. Here's the relevant bits of the PKGBUILD file:
#original
build() {
cd ${srcdir}/SDL-${pkgver}
patch -Np1 -i $srcdir/sdl-1.2.13-dynaminc-esd.patch
./configure --prefix=/usr --disable-nasm --enable-alsa --enable-esd --with-x --disable-rpath
make || return 1
make DESTDIR=${pkgdir} install
}

#with NO_LOGICAL_JOYSTICKS
build() {
cd ${srcdir}/SDL-${pkgver}
CFLAGS="$CFLAGS -DNO_LOGICAL_JOYSTICKS"
patch -Np1 -i $srcdir/sdl-1.2.13-dynaminc-esd.patch
./configure --prefix=/usr --disable-nasm --enable-alsa --enable-esd --with-x --disable-rpath
make || return 1
make DESTDIR=${pkgdir} install
}

building like this produces a build of SDL with no segfaults on my joystick in analog mode.
This task depends upon

Closed by  Allan McRae (Allan)
Friday, 23 October 2009, 00:07 GMT
Reason for closing:  Fixed
Comment by John Regan (saxindustries) - Wednesday, 30 September 2009, 05:49 GMT
Sorry, I forgot to include this in the initial ticket: here's SDL's entry on their bugzilla.

http://bugzilla.libsdl.org/show_bug.cgi?id=575
Comment by Allan McRae (Allan) - Thursday, 01 October 2009, 13:41 GMT
Hmm... I think this may break a lot of other joysticks, so I do not think I will "fix" this. Hopefully upstream comes with a patch.
Comment by Allan McRae (Allan) - Thursday, 22 October 2009, 13:09 GMT
Status with sdl 1.2.14?
Comment by John Regan (saxindustries) - Thursday, 22 October 2009, 19:17 GMT
Looks like it works! I updated to SDL 1.2.14 and everything's working smoothly.

Loading...