https://bugs.winehq.org/show_bug.cgi?id=53556
--- Comment #1 from Brendan McGrath brendan@redmandi.com --- Created attachment 72920 --> https://bugs.winehq.org/attachment.cgi?id=72920 Experimental Fix
I've played with an experimental fix (attached) which does not move the $rsp register, but does try to keep the backtrace within the CFI consistent.
This does fix the segfault, but I'm not sure what it breaks. It also only fixes the x86_64 instruction set.
I also had to remove a call to exit_process in NtTerminateProcess, otherwise it seems the libraries were being removed prior to the completion of the thread termination (causing the return code of 56?). So whilst I needed this for the x86_64 instruction set, this change will likely negatively impact the other instruction sets.