diff --git a/README.md b/README.md index 473d8bfc..b7513b4e 100644 --- a/README.md +++ b/README.md @@ -39,13 +39,14 @@ Wine. All those differences are also documented on the Included bug fixes and improvements ----------------------------------- -**Bug fixes and features included in the next upcoming release [18]:** +**Bug fixes and features included in the next upcoming release [19]:** * Add stub for D3DXTessellateNPatches * Add stubs for D3DCompile2 and D3DCompileFromFile * Add stubs for d3dx10_43.D3DX10CreateEffectFromFileA/W ([Wine Bug #27739](https://bugs.winehq.org/show_bug.cgi?id=27739)) * Add support for ThreadQuerySetWin32StartAddress info class ([Wine Bug #8277](https://bugs.winehq.org/show_bug.cgi?id=8277)) * Add wined3d detection for GeForce GT 425M ([Wine Bug #35054](https://bugs.winehq.org/show_bug.cgi?id=35054)) +* Avoid race-conditions with long running threadpool tasks * Check architecture before trying to load libraries ([Wine Bug #38021](https://bugs.winehq.org/show_bug.cgi?id=38021)) * Export additional OpenAL32 functions ([Wine Bug #38972](https://bugs.winehq.org/show_bug.cgi?id=38972)) * Fake success in kernel32.SetFileCompletionNotificationModes ([Wine Bug #38960](https://bugs.winehq.org/show_bug.cgi?id=38960)) diff --git a/debian/changelog b/debian/changelog index 77e1ffa6..d478d938 100644 --- a/debian/changelog +++ b/debian/changelog @@ -26,6 +26,7 @@ wine-staging (1.7.48) UNRELEASED; urgency=low * Added patch to implement dbghelp.UnDecorateSymbolNameW. * Added patch to add wined3d detection of GeForce GT 425M. * Added patch to use video memory for rendering targets if possible. + * Added patch to avoid race-conditions with long running threadpool tasks. * Removed patch to allow to enable/disable InsertMode in wineconsole settings (accepted upstream). * Removed patch to improve IoGetDeviceObjectPointer stub to appease SecuROM diff --git a/patches/ntdll-Threadpool/0001-ntdll-Mark-newly-spawned-worker-threads-as-busy-to-a.patch b/patches/ntdll-Threadpool/0001-ntdll-Mark-newly-spawned-worker-threads-as-busy-to-a.patch new file mode 100644 index 00000000..fabefacb --- /dev/null +++ b/patches/ntdll-Threadpool/0001-ntdll-Mark-newly-spawned-worker-threads-as-busy-to-a.patch @@ -0,0 +1,66 @@ +From b6b846e842cf3d526dfe7b0a4a3f61a6139ab587 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Wed, 29 Jul 2015 20:57:24 +0200 +Subject: ntdll: Mark newly spawned worker threads as busy to avoid problems + with long-running tasks. + +--- + dlls/ntdll/threadpool.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/dlls/ntdll/threadpool.c b/dlls/ntdll/threadpool.c +index ad4951f..8605a22 100644 +--- a/dlls/ntdll/threadpool.c ++++ b/dlls/ntdll/threadpool.c +@@ -379,6 +379,8 @@ NTSTATUS WINAPI RtlQueueWorkItem( PRTL_WORK_ITEM_ROUTINE function, PVOID context + struct rtl_work_item *item; + NTSTATUS status; + ++ TRACE( "%p %p %u\n", function, context, flags ); ++ + item = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(*item) ); + if (!item) + return STATUS_NO_MEMORY; +@@ -1716,6 +1718,7 @@ static NTSTATUS tp_threadpool_lock( struct threadpool **out, TP_CALLBACK_ENVIRON + { + interlocked_inc( &pool->refcount ); + pool->num_workers++; ++ pool->num_busy_workers++; + NtClose( thread ); + } + } +@@ -1915,6 +1918,7 @@ static void tp_object_submit( struct threadpool_object *object, BOOL signaled ) + { + interlocked_inc( &pool->refcount ); + pool->num_workers++; ++ pool->num_busy_workers++; + NtClose( thread ); + } + } +@@ -2070,6 +2074,7 @@ static void CALLBACK threadpool_worker_proc( void *param ) + TRACE( "starting worker thread for pool %p\n", pool ); + + RtlEnterCriticalSection( &pool->cs ); ++ pool->num_busy_workers--; + for (;;) + { + while ((ptr = list_head( &pool->pool ))) +@@ -2412,6 +2417,7 @@ NTSTATUS WINAPI TpCallbackMayRunLong( TP_CALLBACK_INSTANCE *instance ) + { + interlocked_inc( &pool->refcount ); + pool->num_workers++; ++ pool->num_busy_workers++; + NtClose( thread ); + } + } +@@ -2699,6 +2705,7 @@ BOOL WINAPI TpSetPoolMinThreads( TP_POOL *pool, DWORD minimum ) + + interlocked_inc( &this->refcount ); + this->num_workers++; ++ this->num_busy_workers++; + NtClose( thread ); + } + +-- +2.4.5 + diff --git a/patches/ntdll-Threadpool/definition b/patches/ntdll-Threadpool/definition new file mode 100644 index 00000000..29d27eed --- /dev/null +++ b/patches/ntdll-Threadpool/definition @@ -0,0 +1 @@ +Fixes: Avoid race-conditions with long running threadpool tasks diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 1996ae90..f6d9594d 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -179,6 +179,7 @@ patch_enable_all () enable_ntdll_ThreadQuerySetWin32StartAddress="$1" enable_ntdll_ThreadTime="$1" enable_ntdll_Threading="$1" + enable_ntdll_Threadpool="$1" enable_ntdll_User_Shared_Data="$1" enable_ntdll_WRITECOPY="$1" enable_ntdll_WinSqm="$1" @@ -617,6 +618,9 @@ patch_enable () ntdll-Threading) enable_ntdll_Threading="$2" ;; + ntdll-Threadpool) + enable_ntdll_Threadpool="$2" + ;; ntdll-User_Shared_Data) enable_ntdll_User_Shared_Data="$2" ;; @@ -3792,6 +3796,18 @@ if test "$enable_ntdll_Threading" -eq 1; then ) >> "$patchlist" fi +# Patchset ntdll-Threadpool +# | +# | Modified files: +# | * dlls/ntdll/threadpool.c +# | +if test "$enable_ntdll_Threadpool" -eq 1; then + patch_apply ntdll-Threadpool/0001-ntdll-Mark-newly-spawned-worker-threads-as-busy-to-a.patch + ( + echo '+ { "Sebastian Lackner", "ntdll: Mark newly spawned worker threads as busy to avoid problems with long-running tasks.", 1 },'; + ) >> "$patchlist" +fi + # Patchset ntdll-User_Shared_Data # | # | Modified files: @@ -4951,6 +4967,45 @@ if test "$enable_wined3d_CSMT_Helper" -eq 1; then ) >> "$patchlist" fi +# Patchset wined3d-Multisampling +# | +# | This patchset fixes the following Wine bugs: +# | * [#12652] Allow to override number of quality levels for D3DMULTISAMPLE_NONMASKABLE. +# | +# | Modified files: +# | * dlls/wined3d/directx.c, dlls/wined3d/wined3d_main.c, dlls/wined3d/wined3d_private.h +# | +if test "$enable_wined3d_Multisampling" -eq 1; then + patch_apply wined3d-Multisampling/0001-wined3d-Allow-to-specify-multisampling-AA-quality-le.patch + ( + echo '+ { "Austin English", "wined3d: Allow to specify multisampling AA quality levels via registry.", 1 },'; + ) >> "$patchlist" +fi + +# Patchset wined3d-resource_check_usage +# | +# | Modified files: +# | * dlls/wined3d/resource.c +# | +if test "$enable_wined3d_resource_check_usage" -eq 1; then + patch_apply wined3d-resource_check_usage/0001-wined3d-Silence-repeated-resource_check_usage-FIXME.patch + ( + echo '+ { "Erich E. Hoover", "wined3d: Silence repeated resource_check_usage FIXME.", 2 },'; + ) >> "$patchlist" +fi + +# Patchset wined3d-wined3d_swapchain_present +# | +# | Modified files: +# | * dlls/wined3d/swapchain.c +# | +if test "$enable_wined3d_wined3d_swapchain_present" -eq 1; then + patch_apply wined3d-wined3d_swapchain_present/0001-wined3d-Silence-repeated-wined3d_swapchain_present-F.patch + ( + echo '+ { "Sebastian Lackner", "wined3d: Silence repeated wined3d_swapchain_present FIXME.", 1 },'; + ) >> "$patchlist" +fi + # Patchset wined3d-Revert_PixelFormat # | # | This patchset fixes the following Wine bugs: @@ -4984,18 +5039,6 @@ if test "$enable_wined3d_Revert_PixelFormat" -eq 1; then ) >> "$patchlist" fi -# Patchset wined3d-wined3d_swapchain_present -# | -# | Modified files: -# | * dlls/wined3d/swapchain.c -# | -if test "$enable_wined3d_wined3d_swapchain_present" -eq 1; then - patch_apply wined3d-wined3d_swapchain_present/0001-wined3d-Silence-repeated-wined3d_swapchain_present-F.patch - ( - echo '+ { "Sebastian Lackner", "wined3d: Silence repeated wined3d_swapchain_present FIXME.", 1 },'; - ) >> "$patchlist" -fi - # Patchset wined3d-UnhandledBlendFactor # | # | Modified files: @@ -5008,18 +5051,6 @@ if test "$enable_wined3d_UnhandledBlendFactor" -eq 1; then ) >> "$patchlist" fi -# Patchset wined3d-resource_check_usage -# | -# | Modified files: -# | * dlls/wined3d/resource.c -# | -if test "$enable_wined3d_resource_check_usage" -eq 1; then - patch_apply wined3d-resource_check_usage/0001-wined3d-Silence-repeated-resource_check_usage-FIXME.patch - ( - echo '+ { "Erich E. Hoover", "wined3d: Silence repeated resource_check_usage FIXME.", 2 },'; - ) >> "$patchlist" -fi - # Patchset wined3d-Geforce_425M # | # | This patchset fixes the following Wine bugs: @@ -5047,21 +5078,6 @@ if test "$enable_wined3d_MESA_GPU_Info" -eq 1; then ) >> "$patchlist" fi -# Patchset wined3d-Multisampling -# | -# | This patchset fixes the following Wine bugs: -# | * [#12652] Allow to override number of quality levels for D3DMULTISAMPLE_NONMASKABLE. -# | -# | Modified files: -# | * dlls/wined3d/directx.c, dlls/wined3d/wined3d_main.c, dlls/wined3d/wined3d_private.h -# | -if test "$enable_wined3d_Multisampling" -eq 1; then - patch_apply wined3d-Multisampling/0001-wined3d-Allow-to-specify-multisampling-AA-quality-le.patch - ( - echo '+ { "Austin English", "wined3d: Allow to specify multisampling AA quality levels via registry.", 1 },'; - ) >> "$patchlist" -fi - # Patchset wined3d-CSMT_Main # | # | This patchset fixes the following Wine bugs: