Skip to content

Commit b98324c

Browse files
committed
test(cuda.core): skip PDL edge assert on bindings with #1804 UAF
Published cuda-bindings <13.3.0 (or <12.9.7 on 12.x) returns dangling CUgraphEdgeData from cuGraphGetEdges; also fix release-note RST indent.
1 parent ee0e37f commit b98324c

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

‎cuda_core/docs/source/release/1.2.0-notes.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ New features
2424
completed (programmatic dependent launch, PDL). Available starting with
2525
devices of compute capability 9.0.
2626
(`#2456 <https://github.com/NVIDIA/cuda-python/pull/2456>`__,
27-
`#1334 <https://github.com/NVIDIA/cuda-python/issues/1334>`__)
27+
`#1334 <https://github.com/NVIDIA/cuda-python/issues/1334>`__)
2828

2929
Fixes and enhancements
3030
----------------------

‎cuda_core/tests/graph/test_graph_builder.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
from cuda_python_test_helpers.marks import requires_module
1515
from helpers.graph_kernels import compile_common_kernels, compile_conditional_kernels
1616
from helpers.misc import try_create_condition
17+
from packaging.version import Version
1718

19+
import cuda.bindings
1820
from cuda.core import Device, LaunchConfig, LegacyPinnedMemoryResource, Program, ProgramOptions, launch
1921
from cuda.core.graph import GraphBuilder, GraphDefinition
2022
from cuda.core.graph._graph_builder import (
@@ -733,6 +735,13 @@ def _assert_programmatic_dependency_edge(graph_definition):
733735
"""
734736
from cuda.bindings import driver
735737

738+
# cuda.bindings before 13.3.0 (before 12.9.7 on the 12.x branch) returned
739+
# CUgraphEdgeData wrappers backed by a scratch buffer that was freed before the
740+
# call returned, so every field reads back as freed heap memory (#1804).
741+
version = Version(cuda.bindings.__version__)
742+
if version < Version("13.3.0" if version.major >= 13 else "12.9.7"):
743+
pytest.skip(f"cuda.bindings {version} returns dangling graph edge data (#1804)")
744+
736745
h_graph = graph_definition.handle
737746
if driver.CUDA_VERSION >= 13000:
738747
get_edges = driver.cuGraphGetEdges

0 commit comments

Comments
 (0)