diff --git a/wine-5.7-thread-context.patch b/wine-5.7-thread-context.patch new file mode 100644 index 0000000..894e35b --- /dev/null +++ b/wine-5.7-thread-context.patch @@ -0,0 +1,62 @@ +From c3fac6e36caab168974dd04a60ae1bbb1a0fd919 Mon Sep 17 00:00:00 2001 +From: Jacek Caban +Date: Sat, 25 Apr 2020 21:13:33 +0200 +Subject: [PATCH] server: Fix setting context flags in get_thread_context. + +Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49011 +Signed-off-by: Jacek Caban +Signed-off-by: Alexandre Julliard +--- + dlls/kernel32/tests/thread.c | 15 +++++++++++++++ + server/thread.c | 2 +- + 2 files changed, 16 insertions(+), 1 deletion(-) + +diff --git a/dlls/kernel32/tests/thread.c b/dlls/kernel32/tests/thread.c +index b6a65a4207..e068797ff5 100644 +--- a/dlls/kernel32/tests/thread.c ++++ b/dlls/kernel32/tests/thread.c +@@ -1175,6 +1175,20 @@ static void test_SetThreadContext(void) + CloseHandle( thread ); + } + ++static void test_GetThreadContext(void) ++{ ++ CONTEXT ctx; ++ BOOL ret; ++ ++ memset(&ctx, 0xcc, sizeof(ctx)); ++ ctx.ContextFlags = CONTEXT_DEBUG_REGISTERS; ++ ret = GetThreadContext(GetCurrentThread(), &ctx); ++ ok(ret, "GetThreadContext failed: %u\n", GetLastError()); ++ ok(ctx.ContextFlags == CONTEXT_DEBUG_REGISTERS, "ContextFlags = %x\n", ctx.ContextFlags); ++ ok(!ctx.Dr0, "Dr0 = %x\n", ctx.Dr0); ++ ok(!ctx.Dr1, "Dr0 = %x\n", ctx.Dr0); ++} ++ + static void test_GetThreadSelectorEntry(void) + { + LDT_ENTRY entry; +@@ -2452,6 +2466,7 @@ + #ifdef __i386__ + test_SetThreadContext(); + test_GetThreadSelectorEntry(); ++ test_GetThreadContext(); + test_NtSetLdtEntries(); + #endif + test_QueueUserWorkItem(); +diff --git a/server/thread.c b/server/thread.c +index cfdf42c756..7c1c1108eb 100644 +--- a/server/thread.c ++++ b/server/thread.c +@@ -1848,7 +1848,7 @@ DECL_HANDLER(get_thread_context) + { + assert( reply->self ); + memset( context, 0, sizeof(context_t) ); +- context->cpu = thread_context->regs.cpu; ++ context->cpu = thread->process->cpu; + if (req->flags & system_flags) + { + get_thread_context( thread, context, req->flags & system_flags ); +-- +2.20.1 + diff --git a/wine.spec b/wine.spec index 6c3b39b..0f3c530 100644 --- a/wine.spec +++ b/wine.spec @@ -42,7 +42,7 @@ Name: wine Version: 5.7 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A compatibility layer for windows applications License: LGPLv2+ @@ -72,6 +72,8 @@ Source109: wine-oleview.desktop Source150: wine.appdata.xml # wine bugs +# https://bugs.winehq.org/show_bug.cgi?id=49011 +Patch100: wine-5.7-thread-context.patch # desktop dir Source200: wine.menu @@ -690,6 +692,7 @@ patches/patchinstall.sh DESTDIR="`pwd`" --all sed -i -e 's!^loader server: libs/port libs/wine tools.*!& include!' Makefile.in %endif # 0%{?wine_staging} +%patch100 -p1 -b.thread-context %build @@ -2301,6 +2304,9 @@ fi %endif %changelog +* Sat May 02 2020 Michael Cronenworth 5.7-2 +- fix crash in wineserver affecting many apps and games (RHBZ#1829956) + * Sun Apr 26 2020 Michael Cronenworth 5.7-1 - version update