On Thu Aug 3 11:26:38 2023 +0000, Giovanni Mascellani wrote:
Do we mess up with TLS registers on threads that do not have a TEB?
We don't. And the thing works for native threads. When it breaks is when there is a Wine thread which has TLS register altered. That is supposed to be restored first with init_handler(). With this patch which tries NtCurrentTeb() before init_handler() segv_handler crashes for Wine thread in pthread_getspecific. And for native thread init_handler can't work.