Skip to content

vulkan: avoid importing a file descriptor that has already been consumed - #2866

Open
joselopeqti wants to merge 3 commits into
KhronosGroup:mainfrom
joselopeqti:fix_file_descriptor_ownership
Open

joselopeqti wants to merge 3 commits into
KhronosGroup:mainfrom
joselopeqti:fix_file_descriptor_ownership

Conversation

@joselopeqti

@joselopeqti joselopeqti commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

The specification for CL_EXTERNAL_MEMORY_HANDLE_OPAQUE_FD_KHR describes the ownership transfer for the file descriptor:

For these extensions, importing memory from a file descriptor transfers ownership of the file descriptor from the application to the OpenCL implementation. The application must not perform any operations on the file descriptor after a successful import. The imported memory object holds a reference to its payload.

Therefore, if the first import is successful, that fd should belong to the OpenCL implementation and the application should not use it again to import the memory.
This change moves the successful imports to the end of the test, so the file descriptor ownership is correct.

@joselopeqti joselopeqti changed the title vulkan: duplicate file descriptor to import multiple times vulkan: duplicate file descriptor to import it multiple times Oct 29, 2026
Comment thread test_conformance/vulkan/test_vulkan_api_consistency.cpp Outdated
Comment thread test_conformance/vulkan/test_vulkan_api_consistency.cpp Outdated
@joselopeqti joselopeqti changed the title vulkan: duplicate file descriptor to import it multiple times vulkan: avoid importing a file descriptor that has already been consumed Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants