Alexandre Julliard : ntdll: Handle page faults in signal handler on i386.

Alexandre Julliard julliard at winehq.org
Thu Sep 12 16:28:56 CDT 2019


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Sep 12 20:36:50 2019 +0200

ntdll: Handle page faults in signal handler on i386.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/signal_i386.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c
index 9511255754..587940c032 100644
--- a/dlls/ntdll/signal_i386.c
+++ b/dlls/ntdll/signal_i386.c
@@ -1913,11 +1913,7 @@ static void WINAPI raise_segv_exception( EXCEPTION_RECORD *rec, CONTEXT *context
     case EXCEPTION_ACCESS_VIOLATION:
         if (rec->NumberParameters == 2)
         {
-            if (!(rec->ExceptionCode = virtual_handle_fault( (void *)rec->ExceptionInformation[1],
-                                                             rec->ExceptionInformation[0], FALSE )))
-                goto done;
-            if (rec->ExceptionCode == EXCEPTION_ACCESS_VIOLATION &&
-                rec->ExceptionInformation[0] == EXCEPTION_EXECUTE_FAULT)
+            if (rec->ExceptionInformation[0] == EXCEPTION_EXECUTE_FAULT)
             {
                 ULONG flags;
                 NtQueryInformationProcess( GetCurrentProcess(), ProcessExecuteFlags,
@@ -2066,10 +2062,12 @@ static void segv_handler( int signal, siginfo_t *siginfo, void *sigcontext )
         }
         break;
     case TRAP_x86_PAGEFLT:  /* Page fault */
-        stack->rec.ExceptionCode = EXCEPTION_ACCESS_VIOLATION;
         stack->rec.NumberParameters = 2;
         stack->rec.ExceptionInformation[0] = (get_error_code(context) >> 1) & 0x09;
         stack->rec.ExceptionInformation[1] = (ULONG_PTR)siginfo->si_addr;
+        if (!(stack->rec.ExceptionCode = virtual_handle_fault( (void *)stack->rec.ExceptionInformation[1],
+                                                               stack->rec.ExceptionInformation[0], FALSE )))
+            return;
         break;
     case TRAP_x86_ALIGNFLT:  /* Alignment check exception */
         /* FIXME: pass through exception handler first? */




More information about the wine-cvs mailing list