[PATCH 0/2] MR605: Fix two mach port leaks
Fix two mach port leaks that were leading to a crash in the Origin launcher during a long-running download. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/605
From: Tim Clem <tclem(a)codeweavers.com> --- dlls/ntdll/unix/signal_x86_64.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index 1c2db47c95d..88c517daecf 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -3052,7 +3052,10 @@ static void *mac_thread_gsbase(void) unsigned int info_count = THREAD_IDENTIFIER_INFO_COUNT; static int gsbase_offset = -1; - kern_return_t kr = thread_info(mach_thread_self(), THREAD_IDENTIFIER_INFO, (thread_info_t) &tiinfo, &info_count); + mach_port_t self = mach_thread_self(); + kern_return_t kr = thread_info(self, THREAD_IDENTIFIER_INFO, (thread_info_t) &tiinfo, &info_count); + mach_port_deallocate(mach_task_self(), self); + if (kr == KERN_SUCCESS) return (void*)tiinfo.thread_handle; if (gsbase_offset < 0) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/605
From: Tim Clem <tclem(a)codeweavers.com> --- dlls/ntdll/unix/system.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index 902b63c2b2f..83e0521a3c9 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -2624,8 +2624,9 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, { processor_cpu_load_info_data_t *pinfo; mach_msg_type_number_t info_count; + host_name_port_t host = mach_host_self (); - if (host_processor_info( mach_host_self (), + if (host_processor_info( host, PROCESSOR_CPU_LOAD_INFO, &cpus, (processor_info_array_t*)&pinfo, @@ -2641,6 +2642,8 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, } vm_deallocate (mach_task_self (), (vm_address_t) pinfo, info_count * sizeof(natural_t)); } + + mach_port_deallocate (mach_task_self (), host); } #elif defined(linux) { -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/605
On Mon Aug 8 17:26:04 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 tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details: The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=120698 Your paranoid android. === debian11 (32 bit WoW report) === ntdll: change.c:277: Test failed: should be ready ``` This is a false positive and is now known to the TestBot: https://bugs.winehq.org/show_bug.cgi?id=53533
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/605#note_5882
participants (3)
-
Francois Gouget (@fgouget) -
Tim Clem -
Tim Clem (@tclem)