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

Access Violation on SDL_PollEvent after init, delay and quit of joystick subsystem #1734

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments


Copy link

@SDLBugzilla SDLBugzilla commented Feb 10, 2021

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 2.0.3
Reported for operating system, platform: Windows 7, x86_64

Comments on the original bug report:

On 2015-01-05 22:59:20 +0000, Jan Klass wrote:

Created attachment 1983
Minimal program for reproducability - leads to access violation

Not sure if this is limited to the joystick subsystem,
but I created a minimal program for reproducibility,
which is attached.

The issue occurs with my gamepad Razer Onza (an xbox-style gamepad) plugged in.
On initialization, the gamepad is being recognized.
After quitting the subsystem, the poll will receive the joystick added event,
which it instantly handles itself, calling SDL_SYS_JoystickDetect again,
which this time calls IDirectInput8_EnumDevices with dinput = NULL (after it was released on quit).
This seems to lead to an access violation within said function, which I have no source for.

The issue was originally noticed on ET:Legacy, after its switch from SDL1 to SDL2 (2.71 RC4 to 2.71a).
The issue I reported is available at
and also includes stack traces of the issue there.

However, for reproducibility and program flow,
the attached example is probably easier to work with.
The issue only occurs with the delay before the subsystem quit call.

On 2015-01-05 23:02:13 +0000, Jan Klass wrote:

I tested this with ET:Ls lib repository 2.0.3 version of SDL
a self-compiled debug version of 2.0.3 also from their source

and then downloaded and compiled from HG 817656bd36ec from

The issue occurred in all three occasions.

On 2016-10-07 23:33:19 +0000, Sam Lantinga wrote:

Fixed, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant