NVIDIA / NVIDIA/cuda-python

BUG: API function calls do not cleanup correctly when a Python exception is thrown

Aperta
#1,641 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@mdboom ci sta già lavorando.

Dal 17/8/2026.

  • #1669 di @mdboom — chiusa senza merge
bug cuda.bindings P1
Lingua principale
Cython
Stelle
3.4k
Fork
329
Merge medio
1g 23h
PR unite (30g)
116

Descrizione

In driver, runtime and nvrtc, function calls may not clean up correctly if a Python exception is thrown during Python-to-C argument conversion.

Some argument types require cleanup upon exiting the function. For example, a Python sequence is serialized into a heap-allocated C array that must be free'd before exiting the function. Once the C array is allocated, an exception thrown by the conversion of a subsequence argument will cause the array to never be freed.

Traditionally in C, one would use a goto label to handle cleanup in complex, multi-argument functions. Since we use Cython, we can instead use try/finally. If a major performance impact is measured of that, we may need to use a cleanup helper function (which could be called from all exit paths) instead.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.