Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault when usb gamepad is plugged in #15

Closed
orbea opened this issue Mar 3, 2016 · 2 comments
Closed

Segmentation fault when usb gamepad is plugged in #15

orbea opened this issue Mar 3, 2016 · 2 comments

Comments

@orbea
Copy link

orbea commented Mar 3, 2016

When trying to start jfsw with an usb xbox 360 controller plugged in, I get a segmentation fault. I don't need it for jfsw and can just unplug it, but I felt this was worth mentioning anyways... :)

os: Slackware64-current
jfsw-54912c4_2016.02.20_master-x86_64-1_git

Reading symbols from jfsw...done.
(gdb) run
Starting program: /usr/games/jfsw 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffebec2700 (LWP 17114)]
[New Thread 0x7fffeb6c1700 (LWP 17115)]
Added /usr/share/games/jfsw/ to search path.
Added /usr/games/ to search path.
Added /home/orbea/.jfsw/ to search path.

BUILD engine by Ken Silverman (http://www.advsys.net/ken)
Additional improvements by Jonathon Fowler (http://www.jonof.id.au)
and other contributors. See BUILDLIC.TXT for terms.

64-bit word size. Built Mar  2 2016.

Initialising SDL2 system interface (compiled with SDL version 2.0.4, runtime version 2.0.4)
Loading system OpenGL library
Detecting video modes:
  - 1600x900 8-bit fullscreen
  - 1440x900 8-bit fullscreen
  - 1366x768 8-bit fullscreen
  - 1280x1024 8-bit fullscreen
  - 1280x960 8-bit fullscreen
  - 1280x800 8-bit fullscreen
  - 1280x720 8-bit fullscreen
  - 1152x864 8-bit fullscreen
  - 1024x768 8-bit fullscreen
  - 800x600 8-bit fullscreen
  - 640x480 8-bit fullscreen
  - 640x400 8-bit fullscreen
  - 512x384 8-bit fullscreen
  - 480x360 8-bit fullscreen
  - 400x300 8-bit fullscreen
  - 320x240 8-bit fullscreen
  - 320x200 8-bit fullscreen
  - 640x480 24-bit fullscreen
  - 720x400 24-bit fullscreen
  - 800x600 24-bit fullscreen
  - 1024x768 24-bit fullscreen
  - 1152x864 24-bit fullscreen
  - 1280x1024 24-bit fullscreen
  - 1680x1050 24-bit fullscreen
  - 1600x900 8-bit windowed
  - 1440x900 8-bit windowed
  - 1366x768 8-bit windowed
  - 1280x1024 8-bit windowed
  - 1280x960 8-bit windowed
  - 1280x800 8-bit windowed
  - 1280x720 8-bit windowed
  - 1152x864 8-bit windowed
  - 1024x768 8-bit windowed
  - 800x600 8-bit windowed
  - 640x480 8-bit windowed
  - 640x400 8-bit windowed
  - 512x384 8-bit windowed
  - 480x360 8-bit windowed
  - 400x300 8-bit windowed
  - 320x240 8-bit windowed
  - 320x200 8-bit windowed
  - 1600x900 24-bit windowed
  - 1440x900 24-bit windowed
  - 1366x768 24-bit windowed
  - 1280x1024 24-bit windowed
  - 1280x960 24-bit windowed
  - 1280x800 24-bit windowed
  - 1280x720 24-bit windowed
  - 1152x864 24-bit windowed
  - 1024x768 24-bit windowed
  - 800x600 24-bit windowed
  - 640x480 24-bit windowed
  - 640x400 24-bit windowed
  - 512x384 24-bit windowed
  - 480x360 24-bit windowed
  - 400x300 24-bit windowed
  - 320x240 24-bit windowed
  - 320x200 24-bit windowed
Scanning for GRP files...
Detected registered GRP
SHADOW WARRIOR(tm) Version 1.2
Copyright (c) 1997 3D Realms Entertainment



Type 'SW -?' for command line options.

2 joystick(s) found
  1. (null)

Thread 1 "jfsw" received signal SIGSEGV, Segmentation fault.
0x00007ffff7b1f6de in SDL_JoystickName_REAL () from /usr/lib64/libSDL2-2.0.so.0
(gdb) bt full
#0  0x00007ffff7b1f6de in SDL_JoystickName_REAL () at /usr/lib64/libSDL2-2.0.so.0
#1  0x00007ffff7b16a3d in SDL_JoystickName () at /usr/lib64/libSDL2-2.0.so.0
#2  0x00000000004facff in initinput ()
#3  0x00000000004a99af in CONTROL_Startup ()
#4  0x0000000000462fd5 in InitSetup ()
#5  0x000000000041be86 in InitGame ()
#6  0x000000000041f199 in Control ()
#7  0x000000000041f4a5 in app_main ()
#8  0x0000000000405205 in main ()
@orbea orbea changed the title Segmentation fault when usb gamepad is plugged in. Segmentation fault when usb gamepad is plugged in Mar 3, 2016
@orbea
Copy link
Author

orbea commented Jun 29, 2017

jfsw-2017.03.25_8fc2d54_master-x86_64-1_git

I no longer have the gamepad which caused this issue. Additionally the two gamepads I do still have (usb xbone and ps3) do not crash jfsw individually, but will if they are both plugged in simultaneously. Here is an updated backtrace.

Reading symbols from jfsw...done.
(gdb) run
Starting program: /usr/games/jfsw 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffe7184700 (LWP 11877)]

Thread 1 "jfsw" received signal SIGSEGV, Segmentation fault.
0x00007ffff7b14425 in ?? () from /usr/lib64/libSDL2-2.0.so.0
(gdb) bt
#0  0x00007ffff7b14425 in  () at /usr/lib64/libSDL2-2.0.so.0
#1  0x00000000004fa238 in initinput () at src/sdlayer2.c:328
#2  0x00000000004a797d in CONTROL_Startup (which=which@entry=controltype_keyboardandmouse, TimeFunction=TimeFunction@entry=0x4612a0 <GetTime>, ticspersecond=ticspersecond@entry=140) at jfmact/control.c:914
#3  0x0000000000461335 in InitSetup () at src/setup.c:120
#4  0x000000000041aae6 in InitGame () at src/game.c:954
#5  0x000000000041dd19 in Control () at src/game.c:2904
#6  0x000000000041e116 in app_main (argc=1, argv=0x7fffffffe218)
    at src/game.c:4089
#7  0x00000000004044cf in main (argc=<optimized out>, argv=<optimized out>)
    at src/sdlayer2.c:199
(gdb) bt full
#0  0x00007ffff7b14425 in  () at /usr/lib64/libSDL2-2.0.so.0
#1  0x00000000004fa238 in initinput () at src/sdlayer2.c:328
        i = <optimized out>
        j = 1
#2  0x00000000004a797d in CONTROL_Startup (which=which@entry=controltype_keyboardandmouse, TimeFunction=TimeFunction@entry=0x4612a0 <GetTime>, ticspersecond=ticspersecond@entry=140) at jfmact/control.c:914
#3  0x0000000000461335 in InitSetup () at src/setup.c:120
#4  0x000000000041aae6 in InitGame () at src/game.c:954
        i = <optimized out>
#5  0x000000000041dd19 in Control () at src/game.c:2904
#6  0x000000000041e116 in app_main (argc=1, argv=0x7fffffffe218)
    at src/game.c:4089
        i = <optimized out>
        cnt = <optimized out>
        firstnet = <optimized out>
#7  0x00000000004044cf in main (argc=<optimized out>, argv=<optimized out>)
    at src/sdlayer2.c:199
        r = <optimized out>
(gdb) t a a f

Thread 2 (Thread 0x7fffe7184700 (LWP 11877)):
#0  0x00007ffff71a27cb in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib64/libpthread.so.0

Thread 1 (Thread 0x7ffff7fbbb80 (LWP 11873)):
#0  0x00007ffff7b14425 in ?? () from /usr/lib64/libSDL2-2.0.so.0

@jonof
Copy link
Owner

jonof commented Nov 26, 2018

Thanks. I just checked the current codebase with four controllers plugged in simultaneously (PS4, PS3, X360, Logitech Rumblepad 2) and it doesn't crash for me, so the changes I made back in April this year to change over to the SDL2 game controller API would have solved it.

@jonof jonof closed this as completed Nov 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants