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

オープン
#1,641 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

@mdboom がすでに取り組んでいます。

2026年8月17日 から。

  • #1669 @mdboom による — マージされずにクローズ

評価

この issue はまだ評価されていません。

説明

bug cuda.bindings P1

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.

主要言語
Cython
スター
3.4k
フォーク
329
平均マージ
1日 21時間
マージ済み PR(30日)
113

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NVIDIA/cuda-python のほかの issue

NVIDIA/cuda-python の issue をすべて見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。