SDL Joystick plug / unplug twice game crash

Reporter: time-killer-games  |  Status: open  |  Last Modified: July 26, 2020, 05:25:47 PM
>Describe the bug

sdl joystick crashes when plug/unplug twice in during one running game instance

Steps To Reproduce

Steps to reproduce the behavior:

  1. run this project: joystick_test.zip
  2. plug joystick
  3. unplug joystick
  4. plug joystick
  5. unplug.

Crashes


owner@owner-PC MINGW32 ~
$ gdb C:/msys64/tmp/egm6909206236972493678.exe
GNU gdb (GDB) 9.1
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-msys".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Traceback (most recent call last):
  File "<string>", line 3, in <module>
ModuleNotFoundError: No module named 'libstdcxx'
/etc/gdbinit:6: Error in sourced command file:
Error while executing Python code.
Reading symbols from C:/msys64/tmp/egm6909206236972493678.exe...
r(gdb) run
Starting program: /tmp/egm6909206236972493678.exe
warning: `/c/Windows/SYSTEM32/ntdll.dll': Shared library architecture i386:x86-64 is not compatible with target architecture i386.
warning: `/c/Windows/SYSTEM32/wow64.dll': Shared library architecture i386:x86-64 is not compatible with target architecture i386.
warning: `/c/Windows/SYSTEM32/wow64win.dll': Shared library architecture i386:x86-64 is not compatible with target architecture i386.
warning: `/c/Windows/SYSTEM32/wow64cpu.dll': Shared library architecture i386:x86-64 is not compatible with target architecture i386.
warning: dll path for "WOW64_IMAGE_SECTION" can not be evaluated
warning: Could not load shared library symbols for WOW64_IMAGE_SECTION.
Do you need "set solib-search-path" or "set sysroot"?
warning: dll path for "WOW64_IMAGE_SECTION" can not be evaluated
warning: Could not load shared library symbols for WOW64_IMAGE_SECTION.
Do you need "set solib-search-path" or "set sysroot"?
warning: dll path for "NOT_AN_IMAGE" can not be evaluated
warning: Could not load shared library symbols for NOT_AN_IMAGE.
Do you need "set solib-search-path" or "set sysroot"?
warning: dll path for "NOT_AN_IMAGE" can not be evaluated
warning: Could not load shared library symbols for NOT_AN_IMAGE.
Do you need "set solib-search-path" or "set sysroot"?
[New Thread 2496.0x1590]
[New Thread 2496.0x1a90]
[New Thread 2496.0x1644]
[New Thread 2496.0x8b0]
[New Thread 2496.0x1248]
[New Thread 2496.0xf50]
[New Thread 2496.0x1458]
[Thread 2496.0x8b0 exited with code 0]
[New Thread 2496.0x2d8]
[New Thread 2496.0x1954]
[New Thread 2496.0x145c]
[New Thread 2496.0xebc]
[Thread 2496.0xebc exited with code 0]
[New Thread 2496.0x166c]

Thread 1 received signal SIGSEGV, Segmentation fault.
0x0000002b in ?? ()
(gdb) bt
#0  0x0000002b in ?? ()
#1  0x0037a598 in ?? ()
#2  0x0037ab38 in ?? ()
(gdb) quit
A debugging session is active.

        Inferior 1 [process 2496] will be killed.

Quit anyway? (y or n) y

owner@owner-PC MINGW32 ~
$ gdb C:/msys64/tmp/egm3111799878713421980.exe
GNU gdb (GDB) 9.1
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-msys".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Traceback (most recent call last):
  File "<string>", line 3, in <module>
ModuleNotFoundError: No module named 'libstdcxx'
/etc/gdbinit:6: Error in sourced command file:
Error while executing Python code.
Reading symbols from C:/msys64/tmp/egm3111799878713421980.exe...
(gdb) run
Starting program: /tmp/egm3111799878713421980.exe
warning: `/c/Windows/SYSTEM32/ntdll.dll': Shared library architecture i386:x86-64 is not compatible with target architecture i386.
warning: `/c/Windows/SYSTEM32/wow64.dll': Shared library architecture i386:x86-64 is not compatible with target architecture i386.
warning: `/c/Windows/SYSTEM32/wow64win.dll': Shared library architecture i386:x86-64 is not compatible with target architecture i386.
warning: `/c/Windows/SYSTEM32/wow64cpu.dll': Shared library architecture i386:x86-64 is not compatible with target architecture i386.
warning: dll path for "WOW64_IMAGE_SECTION" can not be evaluated
warning: Could not load shared library symbols for WOW64_IMAGE_SECTION.
Do you need "set solib-search-path" or "set sysroot"?
warning: dll path for "WOW64_IMAGE_SECTION" can not be evaluated
warning: Could not load shared library symbols for WOW64_IMAGE_SECTION.
Do you need "set solib-search-path" or "set sysroot"?
warning: dll path for "NOT_AN_IMAGE" can not be evaluated
warning: Could not load shared library symbols for NOT_AN_IMAGE.
Do you need "set solib-search-path" or "set sysroot"?
warning: dll path for "NOT_AN_IMAGE" can not be evaluated
warning: Could not load shared library symbols for NOT_AN_IMAGE.
Do you need "set solib-search-path" or "set sysroot"?
[New Thread 600.0xfac]
[New Thread 600.0x12ec]
[New Thread 600.0xc88]
[New Thread 600.0xd04]
[New Thread 600.0x49c]
[New Thread 600.0x1424]
[Thread 600.0xd04 exited with code 0]
[New Thread 600.0x162c]
[New Thread 600.0x1a2c]
[New Thread 600.0xf6c]
[New Thread 600.0x1008]
[New Thread 600.0x11f0]
[Thread 600.0x11f0 exited with code 0]
[New Thread 600.0x1404]

Thread 1 received signal SIGSEGV, Segmentation fault.
0x0000002b in ?? ()
(gdb) useless af

Expected behavior

uhm, no crash?

Game files & Screenshots

provided in steps to reproduce. create a new font and draw_set_font(font_0) to remove dumbass blocking error

ENIGMA Configuration:

  • Windows, possibly linux but idgaf about that platform rn
  • SDL

Additional context

fuck joo bitch !!! tested both master and my pr #2090 which doesn't fix it btw

The same exact joystick code from my pr does not crash when built as a gm dll so the problem is a regression robert created when he changed where joystick_update was called, it needs to be called every step you dumb dumb :P GMS2 project you may test for yourself in GMS2 to see the same code from my pr doesn't crash so robert you a stinky butt poopy head !!! joystick.zip

Please sign in to post comments, or you can view this issue on GitHub.