[BUG]: `register()` accepts a mismatched UUID under `python -O`
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
Direzione di ricerca
Inizia con DeviceMemoryResource.register(), PinnedMemoryResource.register() e il percorso MP_register descritto nell’issue. Riproduci la discrepanza sia con python sia con python -O, quindi esamina il controllo dell’UUID. Il lavoro è completato quando entrambi i punti di ingresso rifiutano in modo coerente un UUID non corrispondente e preservano l’UUID della risorsa.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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 |
+-----------------------------------------+------------------------+----------------------+
- Lingua principale
- Cython
- Stelle
- 3.4k
- Fork
- 329
- Merge medio
- 1g 22h
- PR unite (30g)
- 117
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di NVIDIA/cuda-python
-
bug cuda.core
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
NVIDIA/cuda-python#2886 · 1 commento ·
-
triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
NVIDIA/cuda-python#2717 ·
-
triage
Difficoltà 1/5 1-3 ore Idoneità per principianti 90/100
NVIDIA/cuda-python#2712 ·
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
NVIDIA/cuda-python#2646 · 1 reazione ·
-
cuda.core triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
NVIDIA/cuda-python#2435 · 1 commento ·
Tutte le issue di NVIDIA/cuda-python
Issue simili
-
Replayed reasoning items send "content": null, which the Responses API schema does not permit Apertabug CLI custom-model
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
bug confirmed issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
open-webui/open-webui#30750 · 1 commento ·
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
danielmiessler/LifeOS#2234 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100