Skip to content

rocr: IPC: Manage IPC socket thread lifetime#3256

Merged
JeniferC99 merged 3 commits into
developfrom
users/shwetak/IPCSocketThread
Feb 25, 2026
Merged

rocr: IPC: Manage IPC socket thread lifetime#3256
JeniferC99 merged 3 commits into
developfrom
users/shwetak/IPCSocketThread

Conversation

@shwetagkhatri
Copy link
Copy Markdown
Contributor

Track IPC socket server thread handle
Join/close thread during runtime unload to clear ASan-reported leaks

Motivation

Technical Details

JIRA ID

Test Plan

Test Result

Submission Checklist

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the ROCR runtime’s IPC (DMA-buf) Unix socket server lifecycle management by tracking the socket server thread handle and joining/closing it during Runtime::Unload() to address ASan-reported thread/handle leaks.

Changes:

  • Store the IPC socket server thread handle when creating the socket server thread.
  • Initialize the new thread-handle member in Runtime::Runtime().
  • Join and close the IPC socket server thread during Runtime::Unload().

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp Tracks the IPC socket server thread handle and joins/closes it during runtime unload.
projects/rocr-runtime/runtime/hsa-runtime/core/inc/runtime.h Adds a os::Thread member to persist the IPC socket server thread handle.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp
Comment thread projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp
radhaksri added a commit to ROCm/TheRock that referenced this pull request Feb 13, 2026
Cherry-picked commit from ROCm/rocm-systems#3256:
- rocr: IPC: Manage IPC socket thread lifetime
@shwetagkhatri shwetagkhatri force-pushed the users/shwetak/IPCSocketThread branch from c6e50f0 to 4e1206b Compare February 20, 2026 04:44
@shwetagkhatri shwetagkhatri force-pushed the users/shwetak/IPCSocketThread branch from 4e1206b to aa3c8e4 Compare February 23, 2026 19:56
Track IPC socket server thread handle
Join/close thread during runtime unload to clear ASan-reported leaks
… on thread failure

The bind() and listen() error paths returned without closing the
socket fd and leaking it. Thread-creation failure also left stale
entries in ipc_sock_server_conns_. Clean up properly in all three
cases.
@shwetagkhatri shwetagkhatri force-pushed the users/shwetak/IPCSocketThread branch from 2f4056a to 94f67e3 Compare February 24, 2026 03:23
@JeniferC99 JeniferC99 merged commit 801be09 into develop Feb 25, 2026
31 of 34 checks passed
@JeniferC99 JeniferC99 deleted the users/shwetak/IPCSocketThread branch February 25, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants