http://bugs.winehq.org/show_bug.cgi?id=59178 Bug ID: 59178 Summary: Genshin Impact requires ntdll threadpool handling dead workers to not hang on exit Product: Wine Version: 11.0-rc3 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: ntdll Assignee: wine-bugs@list.winehq.org Reporter: mkrsym1@gmail.com Distribution: --- On exit, the game Genshin Impact calls CloseThreadpoolCleanupGroupMembers from a DllMain receiving DLL_PROCESS_DETACH. At that point all threads except the one that called ExitProcess are already dead, so if there was some callback running on the threadpool when the threads were getting killed, the object will get stuck with num_running_callbacks above 0, therefore cleanup will wait for it forever, and the game process will never exit. If you want to reproduce this in-game (100GB download warning), you will have to disconnect internet for it to start (reasons; not a Wine bug), afterwards you should wait a little for it to submit something on the threadpool and then use the game exit button. About 80% of the time, you are going to hit this specific issue and the game will never terminate, the process getting stuck with 1 thread forever waiting and about 1.2 GB of RAM usage. I have tested this behavior on actual Windows using test programs and am attaching them. Both test programs do not hang on Windows, but hang on Wine. test.c and pool_lib.c: "finished sleep" never gets printed on both Windows and Wine, as the worker thread dies (which confirms that worker threads do indeed die during process exit on Windows too). However on Wine, it later proceeds to hang after "closing threadpool", while on Windows, it terminates normally with "threadpool closed". test_term.c: "callback terminating itself" is printed on both Windows and Wine, same behavior with getting stuck on "closing threadpool" on Wine as above. These test cases show that Windows is somehow able to handle threadpool worker threads dying, and does not get stuck on CloseThreadpoolCleanupGroupMembers afterwards. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.