Joystick segfault (with workaround)

Hello,

I am experience a segfault when I use either the D-pad or thumb joystick on a
gamepad.

I recently upgraded to openSUSE 11.3. which includes SDL 1.2.14-23.3. I have
run test/testjoystick in a debugger and have determined that the segfault
occurs in SDL_JoystickUpdate() or specifically linux/SDL_sysjoystick.c.

I have download the SDL 1.2.14 source and compiled the testjoystick program
and get the following output:
There are 1 joysticks attached
Joystick 0: Saitek P990 Dual Analog Pad
axes: 1
balls: 0
hats: 0
buttons: 14

I previously had openSUSE 11.1 which included SDL 1.2.13-104.1. I download the
source RPM of SDL for openSUSE 11.1 and compile SDL and the testjoystick
program. The testjoystick (from SDL 1.2.13-104.1) gives the following output:
There are 1 joysticks attached
Joystick 0: Saitek P990 Dual Analog Pad
axes: 4
balls: 0
hats: 1
buttons: 14

As you can see, SDL 1.2.13 correctly sees 4 axes and 1 hat whereas SDL 1.2.14
sees only 1 axis and no hats.

When I replace the joystick/ directory in the SDL 1.2.14 source with the same
directory from the SDL 1.2.13 source (and recompile), testjoystick reports the
correct information (as above) and the test window doesn’t segfault.

Is this enough information to have this issue fixed? If not, please let me
know what other information I should send along.

Cheers,

Alvin

There is one more silly test. Have you tried SDL 1.2.14 on openSUSE 11.1?

Still not sure why an older version of SDL would run your joystick app
better regardless of the kernel, but the Linux kernel is ever
changing. Drivers can break. Maybe your driver gets the short end of
stick.

You can add your own joystick mapping to SDL_sysjoystick.c without
replacing it completely, if you like. Then that way you can make a
patch.On Wed, Jul 28, 2010 at 8:51 PM, Alvin Beach wrote:

Hello,

I am experience a segfault when I use either the D-pad or thumb joystick on a
gamepad.

I recently upgraded to openSUSE 11.3. which includes SDL 1.2.14-23.3. I have
run test/testjoystick in a debugger and have determined that the segfault
occurs in SDL_JoystickUpdate() or specifically linux/SDL_sysjoystick.c.

I have download the SDL 1.2.14 source and compiled the testjoystick program
and get the following output:
? ? ? ?There are 1 joysticks attached
? ? ? ?Joystick 0: Saitek P990 Dual Analog Pad
? ? ? ? ? ? ? axes: 1
? ? ? ? ? ? ?balls: 0
? ? ? ? ? ? ? hats: 0
? ? ? ? ? ?buttons: 14

I previously had openSUSE 11.1 which included SDL 1.2.13-104.1. I download the
source RPM of SDL for openSUSE 11.1 and compile SDL and the testjoystick
program. The testjoystick (from SDL 1.2.13-104.1) gives the following output:
? ? ? ?There are 1 joysticks attached
? ? ? ?Joystick 0: Saitek P990 Dual Analog Pad
? ? ? ? ? ? ? axes: 4
? ? ? ? ? ? ?balls: 0
? ? ? ? ? ? ? hats: 1
? ? ? ? ? ?buttons: 14

As you can see, SDL 1.2.13 correctly sees 4 axes and 1 hat whereas SDL 1.2.14
sees only 1 axis and no hats.

When I replace the joystick/ directory in the SDL 1.2.14 source with the same
directory from the SDL 1.2.13 source (and recompile), testjoystick reports the
correct information (as above) and the test window doesn’t segfault.

Is this enough information to have this issue fixed? If not, please let me
know what other information I should send along.

Cheers,

Alvin


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Hello,

I am experience a segfault when I use either the D-pad or thumb joystick
on a gamepad.

I recently upgraded to openSUSE 11.3. which includes SDL 1.2.14-23.3. I
have run test/testjoystick in a debugger and have determined that the
segfault occurs in SDL_JoystickUpdate() or specifically
linux/SDL_sysjoystick.c.

When I replace the joystick/ directory in the SDL 1.2.14 source with the
same directory from the SDL 1.2.13 source (and recompile), testjoystick
reports the correct information (as above) and the test window doesn’t
segfault.

Is this enough information to have this issue fixed? If not, please let
me know what other information I should send along.

Cheers,

Alvin
There is one more silly test. Have you tried SDL 1.2.14 on openSUSE 11.1?

Still not sure why an older version of SDL would run your joystick app
better regardless of the kernel, but the Linux kernel is ever
changing. Drivers can break. Maybe your driver gets the short end of
stick.

You can add your own joystick mapping to SDL_sysjoystick.c without
replacing it completely, if you like. Then that way you can make a
patch.

Unfortunately, I no longer have access to openSUSE 11.1. Using kompare, there
are quite a few changes to the joystick files and the joystick/linux file.

There is a custom entry for an other Saitek joystick. Perhaps there is just
something up with the Saitek joysticks? I could create another entry (and
patch) for the Saitek P990, but I would think the bug I’m experience could
eventually effect others. So a custom entry would not be overall useful in the
end.

I’m hoping to find some time so that I can figure out where the bug lies in
the SDL 1.2.14 version of the files. Perhaps, with any luck, fix it and submit
a patch.

Cheers,

Alvin> On Wed, Jul 28, 2010 at 8:51 PM, Alvin Beach <@Alvin_Beach> wrote:

On Thursday 29 Jul 2010 12:42:20 Jeremiah wrote:

Le Thu, 29 Jul 2010 13:55:51 -0300
Alvin Beach a ?crit:

Hello,

Unfortunately, I no longer have access to openSUSE 11.1. Using kompare, there
are quite a few changes to the joystick files and the joystick/linux file.

There is a custom entry for an other Saitek joystick. Perhaps there is just
something up with the Saitek joysticks? I could create another entry (and
patch) for the Saitek P990, but I would think the bug I’m experience could
eventually effect others. So a custom entry would not be overall useful in the
end.

I’m hoping to find some time so that I can figure out where the bug lies in
the SDL 1.2.14 version of the files. Perhaps, with any luck, fix it and submit
a patch.

I have the very same joystick, and I never encountered this problem.
Just tried with SDL-1.2 tip from hg repo:

There are 1 joysticks attached
Joystick 0: Saitek P990 Dual Analog Pad
axes: 4
balls: 0
hats: 1
buttons: 14

Maybe there is some stuff specific to your setup that makes it crash.
In gdb, could you have a look at the back trace (bt command) to check
precisely where it crashes, and what are the variables.–
Patrice Mandin
WWW: http://pmandin.atari.org/
Programmeur Linux, Atari
Sp?cialit?: D?veloppement, jeux

“who writes the code, decides”

You could also produce a full core dump for us. I just made this
tutorial video for those that don’t know how:

http://www.ttyshare.com/rec/nobodyspecial/105220170/On Sat, Jul 31, 2010 at 5:09 AM, Patrice Mandin <mandin.patrice at orange.fr> wrote:

Maybe there is some stuff specific to your setup that makes it crash.
In gdb, could you have a look at the back trace (bt command) to check
precisely where it crashes, and what are the variables.


http://codebad.com/