thpatch / thcrap

Touhou Community Reliant Automatic Patcher
https://www.thpatch.net
The Unlicense
558 stars 41 forks source link

thcrap_loader.exe hangs after quitting game under wine #156

Open plotasse opened 2 years ago

plotasse commented 2 years ago

Hi ! Annoying Linux user here. Wine version is 6.16 (Staging). Sorry if I should have reported this to the wine devs instead.

Since an update a few months ago (I think ?) the thcrap_loader.exe process always stays even after the game is closed. There is no visible window, only the process seems to hang in the background.

So far I don't think this is game related, it happens with EoSD, DDC, LoLK, even with ULiL (to try a non-TSA game).

I have found this in the output from wine:

wine: Call from 7B010F76 to unimplemented function msvcp140.dll.?_Throw_C_error@std@@YAXH@Z, aborting

So I tried installing vcrun2019, and it turns out the process does exit when using microsoft's DLLs (but this is not an ideal solution).

Here are the log files when running touhou 6, waiting for the menu, and choosing quit. (I see no difference apart from offsets but well here they are anyway)

Thanks for your time, please tell me if you need more info.

brliron commented 2 years ago

Hi, and sorry for the slow answer. Can you reproduce the problem, and send thcrap_log.1.txt? thcrap_loader.exe and the patched game have different log files. thcrap_log.txt is the newest, thcrap_log.1.txt is the one just before that, thcrap_log.2.txt is the one before thcrap_log.1.txt etc. And because thcrap_loader.txt is started before 東方紅魔郷.exe, its log file would be thcrap_loader.1.txt (unless you use vpatch, which adds another process in the middle, in which case it would be thcrap_log.2.txt).

b65535 commented 2 years ago

The thcrap_loader.exe process also stays for me after closing the game. I use Wine 6.17 (via PlayOnLinux). Tested with Touhou 8.

I don't see anything unusual in the logs:

thcrap_log.txt thcrap_log.1.txt

brliron commented 2 years ago

Both logs are from a game. If I had to guess, you ran Touhou 8 2 times, without re-running thcrap_loader between them, which pushed the thcrap_loader log file further away. I should try to reproduce it on my Linux laptop whenever I have some time, it seems like everyone using wine have this problem.

plotasse commented 2 years ago

Okay sorry I didn't know about the multiple log files (I do use vpatch, and the problem persists without it)

here is with the problem thcrap_log.txt thcrap_log.1.txt thcrap_log.2.txt

here with native msvcp140.dll workaround thcrap_log.txt thcrap_log.1.txt thcrap_log.2.txt

b65535 commented 2 years ago

Both logs are from a game. If I had to guess, you ran Touhou 8 2 times, without re-running thcrap_loader between them, which pushed the thcrap_loader log file further away.

Here are the logs with thcrap_loader but I don't think they are helpful: thcrap_log.2.txt thcrap_log.3.txt

b65535 commented 2 years ago

As a side note: When using Wine via PlayOnLinux, PlayOnLinux kills all remaining thcrap_loader.exe processes when PlayOnLinux is closed. Closing only the thcrap_loader window (without closing PlayOnLinux) doesn't kill the thcrap_loader.exe process.