NVIDIA / NVIDIA/cuda-python

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

Abierto
#1,641 0 comentarios 0 reacciones 1 asignado Ver en GitHub

@mdboom ya está trabajando en esto.

Desde el 17/8/2026.

  • #1669 de @mdboom — cerrado sin fusionar
bug cuda.bindings P1
Lenguaje dominante
Cython
Estrellas
3.4k
Forks
329
Merge medio
1 d 21 h
PR fusionados (30 d)
113

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.