Opened 17 years ago
Closed 17 years ago
#808 closed Defect (fixed)
Core client leaks thread handles on Windows
| Reported by: | Nicolas | Owned by: | 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 (3)
comment:1 Changed 17 years ago by
comment:2 Changed 17 years ago by
| Summary: | BOINC 6.2 leaks thread handles → 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.
comment:3 Changed 17 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |

Windows API documentation for
CreateProcessandCreateProcessAsUsersay: "Handles inPROCESS_INFORMATIONmust be closed withCloseHandlewhen they are no longer needed."The
PROCESS_INFORMATIONstructure contains both thread and process handles.ACTIVE_TASK::cleanup_taskinapp.cppis closing the process handle but not the thread handle. In fact, the thread handle is not stored byACTIVE_TASK::startanywhere, so there is no waycleanup_taskcould close it.