thcrap icon indicating copy to clipboard operation
thcrap copied to clipboard

thcrap_loader hangs on Wine

Open tactikauan opened this issue 1 year ago • 1 comments

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.

tactikauan avatar Jan 04 '24 01:01 tactikauan

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

32th-System avatar Jan 05 '24 00:01 32th-System