Module: wine Branch: stable Commit: 46a8d39edc2f0e7b276accc2a9adcf969e4c2325 URL: https://source.winehq.org/git/wine.git/?a=commit;h=46a8d39edc2f0e7b276accc2a...
Author: Martin Storsjo martin@martin.st Date: Fri Apr 10 00:42:21 2020 +0300
ntdll: Properly return errors when failing to unwind.
If libunwind is unavailable, make libunwind_virtual_unwind return an error. Likewise if there was no PE exception info and we didn't try unwinding using libunwind, we need to return an error when realizing we were unable to unwind, instead of just warning and returning success.
This fixes hangs/infinite loops on crashes when unwinding fails.
Signed-off-by: Martin Storsjo martin@martin.st Signed-off-by: André Hentschel nerv@dawncrow.de Signed-off-by: Alexandre Julliard julliard@winehq.org (cherry picked from commit ea9f47a767c20cdda3d912708b789314f09f8e28) Signed-off-by: Michael Stefaniuc mstefani@winehq.org
---
dlls/ntdll/signal_arm64.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c index 6d72938809..d131160a76 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c @@ -597,8 +597,10 @@ static NTSTATUS libunwind_virtual_unwind( ULONG_PTR ip, ULONG_PTR *frame, CONTEX context->u.s.X24, context->u.s.X25, context->u.s.X26, context->u.s.X27 ); TRACE(" x28=%016lx fp=%016lx lr=%016lx sp=%016lx\n", context->u.s.X28, context->u.s.Fp, context->u.s.Lr, context->Sp ); -#endif return STATUS_SUCCESS; +#else + return STATUS_INVALID_DISPOSITION; +#endif }
@@ -645,7 +647,11 @@ static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEX return STATUS_SUCCESS; } } - else WARN( "exception data not found in %s\n", debugstr_w(module->BaseDllName.Buffer) ); + else + { + WARN( "exception data not found in %s\n", debugstr_w(module->BaseDllName.Buffer) ); + return STATUS_INVALID_DISPOSITION; + }
dispatch->EstablisherFrame = context->u.s.Fp; dispatch->LanguageHandler = NULL;