https://bugs.winehq.org/show_bug.cgi?id=47198
David Torok dt@zeroitlab.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dt@zeroitlab.com
--- Comment #90 from David Torok dt@zeroitlab.com --- Created attachment 66212 --> https://bugs.winehq.org/attachment.cgi?id=66212 Patch that adds more elaborate stub for NtDebugActiveProcess
From what I see, there are 2 parts to this issue.
1. The direct syscall. We are missing the corresponding nt thunk, which is the root cause here. I've attached a patch above to correct that.
2. Reading from %gs. This is a tougher one to solve, here are a few options I'm thinking of, without changing glibc: - Virtualizing %gs access, by setting it to PROT_NONE and catching SIGSEGV and emulating the instructions like we do for KUSER_SHARED_DATA. The downside to this is probably speed; otherwise this is a viable path. (but I prefer not slowing down wine) - Allocating a proper windows %gs segment and changing %gs on transitions. We already have a similar issue on ARM in the form of x18 collisions. (bug 38780) We can either wait for upstream to solve that and basically adopt the same for x86 or make something like that on our own for staging. One caveat is that the x18 PoC patch forces relays on, which breaks syscall hooking in chrome and various other apps, so the final implementation has to be more precise with the code path than just forcing relays on. I don't have a PoC patch for this issue (yet).