thcrap
thcrap copied to clipboard
thcrap_loader hangs on Wine
The thcrap_loader process keeps running after closing the game on Wine. The issue is present since the 2023-08-17 release and affects all versions of Wine/Proton.
From my debugging, this thread seems to get stuck:
https://github.com/thpatch/thcrap/blob/bc6d09f301ed7da20336b7974911a7b03fee4ae5/thcrap_update/src/loader_update.cpp#L712
Looking at the function, it gets blocked on this call to ReadFile
:
https://github.com/thpatch/thcrap/blob/bc6d09f301ed7da20336b7974911a7b03fee4ae5/thcrap_update/src/loader_update.cpp#L600-L604
Apparently Wine doesn't support async reads on mailslots.
Damn. A developer suggested having one single shared buffer to keep all the data shared between multiple processes, and signaling the update_wrapper_patch
using an event, rather than relying on the mailslot system. I guess we'll have to do this after all