On Sun Jan 14 16:10:35 2024 +0000, Dāvis Mosāns (davispuh) wrote:
Hmm that's weird, it fails 100% of time for me if I include it:
diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c index 0c69287c15b..c938dbe37c4 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -4508,7 +4508,7 @@ static void test_continue(void) ~0x4000~ Nested task flag - not changing - breaks Wine = 0x8d5 */ - 0x48, 0x81, 0x34, 0x24, 0xd5, 0x08, 0x00, 0x00, /* xorq $0x8d5, (%rsp) */ + 0x48, 0x81, 0x34, 0x24, 0xd5, 0x0c, 0x00, 0x00, /* xorq $0xcd5, (%rsp) */ 0x9d, /* popf */ /* invoke NtContinue... */ @@ -4540,6 +4540,8 @@ static void test_continue(void) 0xc3 /* ret */ }; + printf("entering test_continue()\n"); + if (!pRtlCaptureContext) { win_skip("RtlCaptureContext is not available.\n"); @@ -4574,6 +4576,7 @@ static void test_continue(void) "wrong xmm%u %08I64x%08I64x/%08I64x%08I64x\n", i, *(&contexts.before.Xmm0.High + i*2), *(&contexts.before.Xmm0.Low + i*2), *(&contexts.after.Xmm0.High + i*2), *(&contexts.after.Xmm0.Low + i*2) ); + printf("leaving test_continue()\n"); #undef COMPARE }
$ ./wine64 dlls/ntdll/tests/x86_64-windows/ntdll_test.exe exception exception.c:3849: exception: 00012345 flags:0 addr:00007FFFFEAA0010 context: Rip:00007FFFFEAA0010 exception.c:3960: Test marked todo: Frame handler called exception.c:3962: Test marked todo: UnhandledExceptionFilter wasn't called exception.c:3849: exception: 80000003 flags:0 addr:00007FFFFEAA0010 context: Rip:00007FFFFEAA0010 exception.c:3960: Test marked todo: Frame handler called exception.c:3962: Test marked todo: UnhandledExceptionFilter wasn't called exception.c:3849: exception: c0000008 flags:0 addr:00007FFFFEAA0010 context: Rip:00007FFFFEAA0010 exception.c:3960: Test marked todo: Frame handler called exception.c:3962: Test marked todo: UnhandledExceptionFilter wasn't called entering test_continue() 0154:err:seh:call_stack_handlers invalid frame 00007FFFFE0FDE78 (00007FFFFE102000-00007FFFFE300000) 0154:err:seh:call_stack_handlers invalid frame 00007FFFFE0FCB28 (00007FFFFE102000-00007FFFFE300000) 0154:err:seh:NtRaiseException Exception frame is not in stack limits => unable to dispatch exception.
and without it
exception.c:3849: exception: 00012345 flags:0 addr:00007FFFFEAA0010 context: Rip:00007FFFFEAA0010 exception.c:3960: Test marked todo: Frame handler called exception.c:3962: Test marked todo: UnhandledExceptionFilter wasn't called exception.c:3849: exception: 80000003 flags:0 addr:00007FFFFEAA0010 context: Rip:00007FFFFEAA0010 exception.c:3960: Test marked todo: Frame handler called exception.c:3962: Test marked todo: UnhandledExceptionFilter wasn't called exception.c:3849: exception: c0000008 flags:0 addr:00007FFFFEAA0010 context: Rip:00007FFFFEAA0010 exception.c:3960: Test marked todo: Frame handler called exception.c:3962: Test marked todo: UnhandledExceptionFilter wasn't called entering test_continue() leaving test_continue() [...]
Maybe it's some compiler flag? I'm on Arch Linux with mingw-w64-gcc 13.1.0 and it builds with
x86_64-w64-mingw32-gcc -c -o dlls/ntdll/tests/x86_64-windows/exception.o ../dlls/ntdll/tests/exception.c -Idlls/ntdll/tests -I../dlls/ntdll/tests \ -Iinclude -I../include -I../include/msvcrt -D_MSVCR_VER=0 -D__WINESRC__ -D__WINE_PE_BUILD -Wall \ -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers -Winit-self \ -Wno-packed-not-aligned -Wshift-overflow=2 -Wstrict-prototypes -Wtype-limits \ -Wunused-but-set-parameter -Wvla -Wwrite-strings -Wpointer-arith -Wlogical-op -Wabsolute-value \ -Wenum-conversion -Wformat-overflow -Wnonnull -mcx16 -mcmodel=small -gdwarf-4 -g -O2
You're right. My test was flawed. sorry.
This is actually a wine bug. `__wine_syscall_dispatcher` does execute `cld` but only for NT syscalls with 7 or mlre arguments.