We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3924 - Access violation reading location 0x0000000000000000 when disconnecting from Windows 10 RDP.
Summary: Access violation reading location 0x0000000000000000 when disconnecting from ...
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: audio (show other bugs)
Version: 2.0.6
Hardware: x86 Windows 10
: P2 critical
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-27 14:41 UTC by superfury
Modified: 2018-08-08 14:23 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description superfury 2017-10-27 14:41:46 UTC
When I try to disconnect from Windows 10 RDP(running my SDL(2, although compilable with SDL1.2 as well)-based emulator like it always does), the SDL2.dll crashes(SDL 2.0.7 from libsdl.org now, although the official SDL 2.0.6 on libsdl.org had the exact same problem)?

The message says(from Microsoft Visual Studio Community 2015 Version 14.0.25431.01 Update 3):
Exception thrown at 0x000000006C82634B (SDL2.dll) in UniPCemu_x64.exe: 0xC0000005: Access violation reading location 0x0000000000000000.

This happens every time I disconnect from the remote RDP session while the SDL2 app is running? It seems to occur within one of the SDL2's own threads?

Location: [0x8BA4] SDL2.dll thread
Stack frame:
6c82634b
6c7448f9
6c7b3847
6c82d85a

That's with the MinGW SDL2 x64 dll.

Now, trying with the Visual C++ x64 SDL2 and SDL2_net dlls:

It seems to crash within something to do with audio buffers?

Stack frame:
WASAPI_GetDeviceBuf() at SDL_wasapi.c line 515
SDL_RunAudio
SDL_RunThread
RunThread

So this seems to be a problem of it crashing due to the audio buffer of the remote device that takes over the PC(my phone in this case) disconnecting, leaving the audio device invalid?

The buffer variable is NULL(zeroed)?

I'm using the vanilla SDL2.dll/SDL2_net.dll from libsdl.org 2.0.7.
Comment 1 superfury 2017-11-07 21:18:27 UTC
Just tested it some more. It not only happens when disconnecting from RDP, but when connecting too. So every time the audio device (dis)connects(and the app doesn't use the related events).
Comment 2 superfury 2017-11-07 22:06:20 UTC
(In reply to superfury from comment #1)
> Just tested it some more. It not only happens when disconnecting from RDP,
> but when connecting too. So every time the audio device (dis)connects(and
> the app doesn't use the related events).

Just confirmed against SDL2-2.0.5, which doesn't crash at all.
Comment 3 Ryan C. Gordon 2018-08-08 14:23:50 UTC
This was fixed awhile ago when we made the WASAPI code more robust, and the patch in https://hg.libsdl.org/SDL/rev/16bb2e8488b8 fixes some final RDP-related crashes.

--ryan.