https://bugs.winehq.org/show_bug.cgi?id=50558
Bug ID: 50558 Summary: ntdll-Dealloc_Thread_Stack cause memory leak for C# game Product: Wine-staging Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: major Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: trufanovan@gmail.com CC: leslie_alistair@hotmail.com, z.figura12@gmail.com Distribution: ---
I've traced down a memory leak in one game to the ntdll-Dealloc_Thread_Stack in wine-staging. No other wine versions or staging patches cause such problem. I've reproduced it on actual wine master branch from github with `./staging/patchinstall.py ntdll-Dealloc_Thread_Stack`
The game is "Delta's Shadow" released in 2020. Demo is available at https://zxonline.net/game/deltas-shadow/ Its Windows version is written in C# with SDL. The memory leaks every time game plays SFX and only in this case. A music doesn't cause leak. I've asked the author: music is played via SDL and SFX is played with System.Media.SoundPlayer::Play(). It looks like this class is just calls PlaySound function from winmm.dll and pass a stream with WAV into it. And this somehow and ups in ntdll.
So, to reproduce the problem: 1. Install wine-staging 2. Install the demo 3. Launch game in wine-staging 4. Press ALt+Enter to switch the game into a windowed mode and launch Task manager to see the RAM it consumes. 5. Start pressing W and S keys (Up and Down) in game main menu to produce a menu item change SFX.
Result: Game RAM usage grows each time you press the key and don't decrease later.
Expected: No significant RAM usage change.