Piotr Caban : ntdll: Try to handle write watches while we're on the signal stack (x86_64).

Alexandre Julliard julliard at winehq.org
Thu Oct 3 16:44:01 CDT 2019


Module: wine
Branch: master
Commit: fd60406e91aab94033ad62dc3e00fe9a1a2d6aa6
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=fd60406e91aab94033ad62dc3e00fe9a1a2d6aa6

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Thu Oct  3 20:54:26 2019 +0200

ntdll: Try to handle write watches while we're on the signal stack (x86_64).

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/signal_x86_64.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c
index d8fcc54743..6508654e77 100644
--- a/dlls/ntdll/signal_x86_64.c
+++ b/dlls/ntdll/signal_x86_64.c
@@ -2876,6 +2876,15 @@ static void segv_handler( int signal, siginfo_t *siginfo, void *sigcontext )
     struct stack_layout *stack;
     ucontext_t *ucontext = sigcontext;
 
+    stack = (struct stack_layout *)(RSP_sig(ucontext) & ~15);
+
+    /* check for exceptions on the signal stack caused by write watches */
+    if (TRAP_sig(ucontext) == TRAP_x86_PAGEFLT && is_inside_signal_stack( stack ) &&
+        !virtual_handle_fault( siginfo->si_addr, (ERROR_sig(ucontext) >> 1) & 0x09, TRUE ))
+    {
+        return;
+    }
+
     /* check for page fault inside the thread stack */
     if (TRAP_sig(ucontext) == TRAP_x86_PAGEFLT)
     {




More information about the wine-cvs mailing list