We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 786

Summary: d-pad on playstation controller causes segfault in SDL games
Product: SDL Reporter: twilightinzero
Component: joystickAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED DUPLICATE QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P2 CC: icculus
Version: 1.2.13Keywords: target-1.2.14
Hardware: x86   
OS: Linux   

Description twilightinzero 2009-08-29 20:19:09 UTC
Hi. In all SDL applications that make use of the joystick, when I press any direction on the directional pad when the controller is in analog mode, the application quits with a segmentation fault.

When the controller is not in analog mode, the d-pad is mapped to axes 0 and 1 and it works correctly. When it is in analog mode, the left analog stick has axes 0 and 1, the right analog stick has axes 2 and 3, and the d-pad has axes 4 and 5. It doesn't matter if I switch to analog mode before starting the application, or while running the application.

I spent several hours working with a developer for FCE Ultra, and he narrowed it down to SDL's JoystickUpdate function. He could not assist me further, as he doesn't know SDL's internals.

Here is a backtrace of the problem occuring in FCE Ultra:

#0  0xb7dc671d in EV_HandleEvents () from /usr/lib/libSDL-1.2.so.0
#1  0xb7dc6cdd in SDL_SYS_JoystickUpdate () from /usr/lib/libSDL-1.2.so.0
#2  0xb7d9f5f0 in SDL_JoystickUpdate () from /usr/lib/libSDL-1.2.so.0
#3  0xb7d744de in SDL_PumpEvents () from /usr/lib/libSDL-1.2.so.0
#4  0xb7d749f7 in SDL_PollEvent () from /usr/lib/libSDL-1.2.so.0
#5  0x080d96a8 in FCEUD_UpdateInput () at src/drivers/sdl/input.cpp:720
#6  0x080e0fcb in DoFun (frameskip=0) at src/drivers/sdl/sdl.cpp:241
#7  0x080e2133 in main (argc=2, argv=0xbfb9c3e4) at src/drivers/sdl/sdl.cpp:732

lsusb identifies the controller adapter like so:

ID 0925:8866 Lakeview Research WiseGroup Ltd, MP-8866 Dual Joypad
Comment 1 Ryan C. Gordon 2009-09-13 16:33:31 UTC
Tagging this bug with "target-1.2.14" so we can try to resolve it for SDL 1.2.14.

Please note that we may choose to resolve it as WONTFIX. This tag is largely so we have a comprehensive wishlist of bugs to examine for 1.2.14 (and so we can close bugs that we'll never fix, rather than have them live forever in Bugzilla).

--ryan.
Comment 2 Ryan C. Gordon 2009-09-27 22:33:07 UTC
Taking bug.

--ryan.
Comment 3 Sam Lantinga 2009-09-27 23:58:10 UTC
twilightzero, this bug is already reported and we've got some open troubleshooting steps in bug 575.  Can you take a look and see if you can add anything there?

Thanks!

*** This bug has been marked as a duplicate of bug 575 ***