[BUG]: `register()` accepts a mismatched UUID under `python -O`
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
Hướng nghiên cứu
Bắt đầu với DeviceMemoryResource.register(), PinnedMemoryResource.register() và đường dẫn MP_register được mô tả trong issue. Tái hiện sự không khớp bằng cả python và python -O, sau đó kiểm tra phần kiểm tra UUID. Hoàn tất khi cả hai điểm vào đều nhất quán từ chối UUID không khớp và giữ nguyên UUID của resource.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is this a duplicate?
- I confirmed there appear to be no duplicate issues for this bug and that I agree to the Code of Conduct
Type of Bug
Silent Failure
Component
cuda.core
Describe the bug
DeviceMemoryResource.register() and PinnedMemoryResource.register() check that the UUID they are given matches the resource's own with a bare assert in MP_register, so the check is absent whenever CPython runs with -O. The call then registers the resource under the other key and rewrites the resource's UUID, and mr.uuid reports the new value from then on.
How to Reproduce
import uuid
from cuda.core import Device, DeviceMemoryResource, DeviceMemoryResourceOptions
dev = Device(); dev.set_current()
mr = DeviceMemoryResource(dev, DeviceMemoryResourceOptions(ipc_enabled=True))
try:
mr.register(uuid.UUID("00000000-0000-0000-0000-000000000001"))
except AssertionError:
print("rejected")
else:
print("accepted, uuid is now", mr.uuid)
$ python repro.py
rejected
$ python -O repro.py
accepted, uuid is now 00000000-0000-0000-0000-000000000001
Expected behavior
register() should reject a UUID that is not the resource's own whether or not CPython was started with -O. Assertions are removed under -O, so the check as written does not exist in an optimized interpreter and the resource silently takes on the other key instead of raising.
Operating System
Ubuntu 26.04 LTS
nvidia-smi output
Tue Aug 25 15:01:31 2026
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 595.84 Driver Version: 595.84 CUDA Version: 13.2 |
+-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA GeForce RTX 3050 ... Off | 00000000:01:00.0 Off | N/A |
| N/A 59C P3 749W / 30W | 11MiB / 4096MiB | 8% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
- Ngôn ngữ chính
- Cython
- Star
- 3.4k
- Fork
- 334
- Merge trung bình
- 1 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 123
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của NVIDIA/cuda-python
-
triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
NVIDIA/cuda-python#3015 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
NVIDIA/cuda-python#2952 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[DOC]: cuda.core 1.1.1 note misstates program cache permissionsCó thể đã có người làm @leofang đã nhận 11 ngày trước. Đang mởdocumentation P1
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
NVIDIA/cuda-python#2717 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[DOC]: `PinnedMemoryResource.allocate` documents no parametersCó thể đã có người làm @Andy-Jost đã nhận 11 ngày trước. Đang mởcuda.core documentation P1
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 90/100
NVIDIA/cuda-python#2712 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG]: LocatedHeaderDir is mutable, so callers can poison the cached header-directory lookupCó thể đã có người làm @rwgk đã nhận 11 ngày trước. Đang mởtriage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
NVIDIA/cuda-python#2646 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của NVIDIA/cuda-python
Issue tương tự
-
bug llm translation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
jellyfin/jellyfin-mpv-shim#800 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Michigan 2025 senior interest, dividends and capital gains deduction limits are uprated, not the published amountsCó thể đã có người làm @PavelMakarchuk đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
PolicyEngine/policyengine-us#9826 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
P4: low query
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
jeffknupp/association#336 ·