Skip to content

cuda.core: reject a mismatched UUID in register() - #2698

Open
fedonman wants to merge 1 commit into
NVIDIA:mainfrom
fedonman:fix-ipc-register-uuid-mismatch
Open

cuda.core: reject a mismatched UUID in register()#2698
fedonman wants to merge 1 commit into
NVIDIA:mainfrom
fedonman:fix-ipc-register-uuid-mismatch

Conversation

@fedonman

Copy link
Copy Markdown
Contributor

MP_register checked the caller's UUID against the resource's own with a bare assert, which is removed under python -O. This raises ValueError instead, before the registry insertion, and adds a regression test over both IPC-enabled resource types.

tests/memory_ipc/test_errors.py::test_register_rejects_non_ipc_memory_resource PASSED [ 33%]
tests/memory_ipc/test_errors.py::test_register_rejects_mismatched_uuid[DeviceMR] PASSED [ 66%]
tests/memory_ipc/test_errors.py::test_register_rejects_mismatched_uuid[PinnedMR] PASSED [100%]
================= 3 passed, 17 deselected, 1 warning in 1.70s ==================

MP_register validated the caller's UUID against the resource's own with
a bare assert. Assertions are removed under python -O, so an optimized
interpreter accepted a mismatched key, registered the resource under it
and rewrote the resource's UUID, leaving mr.uuid reporting the new
value.

Raise ValueError instead, before the registry insertion, so the check
holds regardless of interpreter flags.

Closes NVIDIA#2697

Signed-off-by: Vyron Vasileiadis <hi@fedonman.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the cuda.core Everything related to the cuda.core module label Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.core Everything related to the cuda.core module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant