Skip to content

clCopyImage: clean up image resources on failure#2667

Open
xinjin01 wants to merge 1 commit intoKhronosGroup:mainfrom
xinjin01:clcopyimage-resource-cleanup
Open

clCopyImage: clean up image resources on failure#2667
xinjin01 wants to merge 1 commit intoKhronosGroup:mainfrom
xinjin01:clcopyimage-resource-cleanup

Conversation

@xinjin01
Copy link
Copy Markdown
Contributor

The clCopyImage failure paths did not always release image resources promptly. If verification failed after mapping the destination image, the test returned before unmapping it. The image creation helpers also held raw cl_mem handles after clCreateImage(), so later setup failures could bypass cleanup.

This could retain image-backed resources across repeated failing formats and drive the test into OOM.

Fix this by unmapping the verification mapping before returning on ompare failure, and by taking ownership of created images with clMemWrapper immediately so later failures release them through RAII.

The clCopyImage failure paths did not always release image resources
promptly. If verification failed after mapping the destination image,
the test returned before unmapping it. The image creation helpers also
held raw cl_mem handles after clCreateImage(), so later setup failures
could bypass cleanup.

This could retain image-backed resources across repeated failing
formats and drive the test into OOM.

Fix this by unmapping the verification mapping before returning on
ompare failure, and by taking ownership of created images with
clMemWrapper immediately so later failures release them through RAII.

Signed-off-by: Xin Jin <xin.jin@arm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants