Ticket #808 (closed Defect: fixed)

Opened 6 months ago

Last modified 6 months ago

Core client leaks thread handles on Windows

Reported by: Nicolas Assigned to: davea
Priority: Minor Milestone: Undetermined
Component: Client - Daemon Version: 6.2.19
Keywords: Cc:

Description

This BOINC client started 47 hours ago (on a reboot). Process Explorer shows boinc.exe has almost 270 thread handles open. Of those, 5 are handles for threads of the client itself. All the rest are invalid handles. Procexp shows lines like "<Non-existent process>(960): 3432", where 960 is the PID (not matching any current process) and 3432 is the thread ID in that process.

This seems to be a handle leak when BOINC starts science apps.

Change History

12/24/08 07:14:35 changed by Nicolas

Windows API documentation for CreateProcess and CreateProcessAsUser say: "Handles in PROCESS_INFORMATION must be closed with CloseHandle when they are no longer needed."

The PROCESS_INFORMATION structure contains both thread and process handles.

ACTIVE_TASK::cleanup_task in app.cpp is closing the process handle but not the thread handle. In fact, the thread handle is not stored by ACTIVE_TASK::start anywhere, so there is no way cleanup_task could close it.

12/24/08 07:15:31 changed by Nicolas

  • summary changed from BOINC 6.2 leaks thread handles to Core client leaks thread handles on Windows.

I have only tested 6.2.19, but the relevant code in trunk doesn't seem to have changed, so I assume it happens on all versions.

12/24/08 15:19:42 changed by davea

  • status changed from new to closed.
  • resolution set to fixed.

(In [16743]) - client, Win: don't leak thread handlers

fixes #808


If this page is incomplete or incorrect, please edit it or add it to the wiki to-do list. To do this, you must be logged in; click Login or Register above.