On Tue Apr 11 16:44:00 2023 +0000, Rémi Bernon wrote:
As a simpler approach, I've changed this to avoid calling `pthread_exit` only in the `abort_thread` case. Instead, it calls `select` to block indefinitely and wait for the process to exit. This should hopefully happen soon enough, as `abort_thread` is most often called from `SIGQUIT` when `wineserver` terminates a process. Then it is maybe not, for the cases where `abort_thread` is called on thread or process init errors, but these should not generally happen anyway, or in the case where `NtTerminateThread` is called. This leaks any thread resources and stack until the process exit, but I think that was already the case as it doesn't go through the `exit_thread` cooperative cleanup. In general, this should hopefully solve most crashes, and the only ones remaining would be caused by `exit_thread` being called from a thread which has faulted in a syscall and left some cleanup handlers registered. I guess we can consider that this isn't supposed to happen.
Maybe I should've kept the longjmp? Its removal doesn't seem to be causing much trouble but I'm not sure exactly which unwind it was there for.
In any case would something like that (blocking the threads) be better than returning from their functions?