From 7bcdf586708338cd9ffcb853602a2494c2d1f73a Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Tue, 17 Nov 2015 16:42:40 +0100 Subject: [PATCH 2/2] Workaround with infinite loop while walking along the stack frames on wine64. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721 --- dbus/dbus-sysdeps-win.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c index 8146272..9d2fea9 100644 --- a/dbus/dbus-sysdeps-win.c +++ b/dbus/dbus-sysdeps-win.c @@ -2413,6 +2413,7 @@ _dbus_delete_file (const DBusString *filename, static void dump_backtrace_for_thread (HANDLE hThread) { + ADDRESS old_address; STACKFRAME sf; CONTEXT context; DWORD dwImageType; @@ -2429,6 +2430,7 @@ static void dump_backtrace_for_thread (HANDLE hThread) DPRINTF ("Backtrace:\n"); + _DBUS_ZERO (old_address); _DBUS_ZERO (context); context.ContextFlags = CONTEXT_FULL; @@ -2488,6 +2490,18 @@ static void dump_backtrace_for_thread (HANDLE hThread) DWORD dwDisplacement; IMAGEHLP_MODULE moduleInfo; + /* + on Wine64 version 1.7.54, we get an infinite number of stack entries + pointing to the same stack frame (_start+0x29 in ) + see bug https://bugs.winehq.org/show_bug.cgi?id=39606 + */ +#ifndef __i386__ + if (old_address.Offset == sf.AddrPC.Offset) + { + break; + } +#endif + pSymbol->SizeOfStruct = sizeof(SYMBOL_INFO); pSymbol->MaxNameLen = MAX_SYM_NAME; @@ -2513,6 +2527,7 @@ static void dump_backtrace_for_thread (HANDLE hThread) DPRINTF (" in %s", moduleInfo.ModuleName); } DPRINTF ("\n"); + old_address = sf.AddrPC; } ResumeThread (hThread); } -- 1.8.4.5