Open stolk opened 3 years ago
I've built it from source... valgrind finds invalid read when I press the trigger of the Steam Controller.
==544980== Invalid read of size 4
==544980== at 0x492A9DA: HandleHat (SDL_sysjoystick.c:648)
==544980== by 0x492A9DA: HandleInputEvents (SDL_sysjoystick.c:766)
==544980== by 0x492A9DA: SDL_SYS_JoystickUpdate (SDL_sysjoystick.c:811)
==544980== by 0x48A0CEF: SDL_JoystickUpdate_REAL (SDL_joystick.c:684)
==544980== by 0x48976C4: SDL_PumpEvents_REAL (SDL_events.c:406)
==544980== by 0x48976C4: SDL_WaitEventTimeout_REAL (SDL_events.c:436)
==544980== by 0x48976C4: SDL_PollEvent_REAL (SDL_events.c:418)
==544980== by 0x40291F: sim (investickgator.c:296)
==544980== by 0x4026E0: main (investickgator.c:458)
==544980== Address 0x9750870 is 0 bytes after a block of size 16 alloc'd
==544980== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==544980== by 0x492A5B7: allocate_hatdata (SDL_sysjoystick.c:433)
==544980== by 0x492A5B7: ConfigJoystick (SDL_sysjoystick.c:555)
==544980== by 0x492A5B7: SDL_SYS_JoystickOpen (SDL_sysjoystick.c:616)
==544980== by 0x48A0446: SDL_JoystickOpen_REAL (SDL_joystick.c:133)
==544980== by 0x402987: sim (investickgator.c:306)
==544980== by 0x4026E0: main (investickgator.c:458)
This is probably a SDL 2.0.4 bug.
After upgrade to SDL 2.0.14, valgrind does not trigger on SDL, nor does it segfault.
When running the prebuilt binaries from github assets, on Linux, pressing a trigger buttons on Steam Controller: