http://bugs.winehq.org/show_bug.cgi?id=58420
--- Comment #7 from pipcet@protonmail.com --- Created attachment 78899 --> http://bugs.winehq.org/attachment.cgi?id=78899 LD_PRELOAD workaround for all CPUs; this assumes all unaligned XSAVEs are due to this specific Cygwin code sequence
This works for AMD CPUs as well as Intel, and it doesn't have the race condition. It does, however, assume that all unaligned xsave64 instructions are due to the specific Cygwin code sequence, and messes around with the Cygwin stack (and stack pointer!) in a specific way which would break all other applications.
Note that this code does not yet inspect siginfo before it dereferences %rip. If %rip is invalid or not readable, we'll get a recursive segfault and a stack overflow.