Skip to content

Fix a double-free bug#2112

Open
mdboom wants to merge 3 commits into
NVIDIA:mainfrom
mdboom:double-free
Open

Fix a double-free bug#2112
mdboom wants to merge 3 commits into
NVIDIA:mainfrom
mdboom:double-free

Conversation

@mdboom
Copy link
Copy Markdown
Contributor

@mdboom mdboom commented May 19, 2026

This is part of my experimentation with using an LLM agent for static analysis.

Fixes a double-free in the generated setters for list-valued struct members
(e.g. CUlaunchConfig.attrs, CUDA_MEM_ALLOC_NODE_PARAMS.accessDescs,
external-semaphore and batch-mem-op node parameter arrays, and their runtime
counterparts). Assigning an empty list freed the internal buffer but left
the cached pointer non-NULL, so a subsequent assignment or __dealloc__
would call free() again on the dangling pointer.

@mdboom mdboom self-assigned this May 19, 2026
@mdboom mdboom added bug Something isn't working P0 High priority - Must do! cuda.bindings Everything related to the cuda.bindings module labels May 19, 2026
@mdboom mdboom requested a review from Andy-Jost May 19, 2026 22:19
@github-actions
Copy link
Copy Markdown

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: So the new tests would break without this fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cuda.bindings Everything related to the cuda.bindings module P0 High priority - Must do!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants