Testing: kernel32:debugger, there's sometimes the following error: debugger.c:1760: Test failed: unexpected instruction pointer 778B2A0C
Current test code has a workaround when this happens on last thread, but this is clearly not sufficient.
Fix the test so that it grabs the thread context only in a place we're sure it's in stopped state at breakpoint instruction. (Current code likely catches cases where the thread is in bp signal handling).
Rewrote the test to be in more logical order.
From: Eric Pouech eric.pouech@gmail.com
Testing: kernel32:debugger, there's sometimes the following error: debugger.c:1760: Test failed: unexpected instruction pointer 778B2A0C
Current test code has a workaround when this happens on last thread, but this is clearly not sufficient.
Fix the test so that it grabs the thread context only in a place we're sure it's in stopped state at breakpoint instruction. (Current code likely catches cases where the thread is in bp signal handling).
Rewrote the test to be in more logical order.
Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=53143 --- dlls/kernel32/tests/debugger.c | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-)
diff --git a/dlls/kernel32/tests/debugger.c b/dlls/kernel32/tests/debugger.c index abd59c93f88..1dc5bd5fb46 100644 --- a/dlls/kernel32/tests/debugger.c +++ b/dlls/kernel32/tests/debugger.c @@ -318,16 +318,6 @@ static void set_thread_context_(unsigned line, struct debugger_context *ctx, str ok_(__FILE__,line)(ret, "SetThreadContext failed: %lu\n", GetLastError()); }
-static void fetch_process_context(struct debugger_context *ctx) -{ - struct debuggee_thread *thread; - - WINE_RB_FOR_EACH_ENTRY(thread, &ctx->threads, struct debuggee_thread, entry) - { - fetch_thread_context(thread); - } -} - #define WAIT_EVENT_TIMEOUT 20000 #define POLL_EVENT_TIMEOUT 200
@@ -1706,8 +1696,6 @@ static void test_debugger(const char *argv0)
if (sizeof(loop_code) > 1) { - struct debuggee_thread *prev_thread; - memset(buf, OP_BP, sizeof(buf)); memcpy(proc_code, &loop_code, sizeof(loop_code)); ret = WriteProcessMemory(pi.hProcess, mem, buf, sizeof(buf), NULL); @@ -1735,9 +1723,6 @@ static void test_debugger(const char *argv0) expect_breakpoint_exception(&ctx, thread_proc + 1); exception_cnt = 1;
- prev_thread = ctx.current_thread; - fetch_process_context(&ctx); - byte = 0xc3; /* ret */ ret = WriteProcessMemory(pi.hProcess, thread_proc + 1, &byte, 1, NULL); ok(ret, "WriteProcessMemory failed: %lu\n", GetLastError()); @@ -1746,6 +1731,10 @@ static void test_debugger(const char *argv0) { DEBUG_EVENT ev;
+ fetch_thread_context(ctx.current_thread); + ok(get_ip(&ctx.current_thread->ctx) == thread_proc + 2 + || broken(get_ip(&ctx.current_thread->ctx) == thread_proc), /* sometimes observed on win10 */ + "unexpected instruction pointer2 %p (%p)\n", get_ip(&ctx.current_thread->ctx), thread_proc); /* even when there are more pending events, they are not reported until current event is continued */ ret = WaitForDebugEvent(&ev, 10); ok(GetLastError() == ERROR_SEM_TIMEOUT, "WaitForDebugEvent returned %x(%lu)\n", ret, GetLastError()); @@ -1757,18 +1746,9 @@ static void test_debugger(const char *argv0) ctx.ev.u.Exception.ExceptionRecord.ExceptionCode); ok(ctx.ev.u.Exception.ExceptionRecord.ExceptionAddress == thread_proc + 1, "ExceptionAddress = %p\n", ctx.ev.u.Exception.ExceptionRecord.ExceptionAddress); - ok(get_ip(&prev_thread->ctx) == thread_proc + 2 - || broken(get_ip(&prev_thread->ctx) == thread_proc), /* sometimes observed on win10 */ - "unexpected instruction pointer %p\n", get_ip(&prev_thread->ctx)); - prev_thread = ctx.current_thread; exception_cnt++; }
- /* for some reason sometimes on Windows one thread has a different address. this is always the thread - * with the last reported exception, so we simply skip the check for the last exception unless it's the only one. */ - if (exception_cnt == 1) - ok(get_ip(&prev_thread->ctx) == thread_proc + 2, "unexpected instruction pointer %p\n", get_ip(&prev_thread->ctx)); - trace("received %u exceptions\n", exception_cnt);
for (;;)
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=127655
Your paranoid android.
=== w7u_2qxl (32 bit report) ===
kernel32: debugger.c:1017: Test failed: ole32.dll was not reported
=== w7u_adm (32 bit report) ===
kernel32: debugger.c:1017: Test failed: ole32.dll was not reported
=== w7u_el (32 bit report) ===
kernel32: debugger.c:1017: Test failed: ole32.dll was not reported
=== w10pro64 (32 bit report) ===
kernel32: debugger.c:671: Test failed: debugger reported 7 failures
On Thu Dec 15 16:47:18 2022 +0000, **** wrote:
Marvin replied on the mailing list:
Hi, It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated. The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=127655 Your paranoid android. === w7u_2qxl (32 bit report) === kernel32: debugger.c:1017: Test failed: ole32.dll was not reported === w7u_adm (32 bit report) === kernel32: debugger.c:1017: Test failed: ole32.dll was not reported === w7u_el (32 bit report) === kernel32: debugger.c:1017: Test failed: ole32.dll was not reported === w10pro64 (32 bit report) === kernel32: debugger.c:671: Test failed: debugger reported 7 failures
Strange, I have never seen the ole32 error before, neither in the MRs I looked at nor in the nightly WineTest results, except that one early November Windows 7 report. But Eric Pouech reports it happened again in a dummy patch he sent to the TestBot: https://testbot.winehq.org/JobDetails.pl?Key=127657
The '7 failures' issue happens regularly on Windows 11 except it's 4 failures there. But it happened once on w1064-tsign with 4294967271 failures. So maybe it is just random.
On Thu Dec 15 18:08:02 2022 +0000, Francois Gouget wrote:
Strange, I have never seen the ole32 error before, neither in the MRs I looked at nor in the nightly WineTest results, except that one early November Windows 7 report. But Eric Pouech reports it happened again in a dummy patch he sent to the TestBot: https://testbot.winehq.org/JobDetails.pl?Key=127657 The '7 failures' issue happens regularly on Windows 11 except it's 4 failures there. But it happened once on w1064-tsign with 4294967271 failures. So maybe it is just random.
The w1064-tsign failure is pretty different because it happened in the 'dbg,event,order' case and after a timeout to boot. However this 7 failures case is very similar to the Windows 11 one.