Skip to content

loader: Propagate OOM from loader_add_to_ext_list in two call sites#1911

Merged
charles-lunarg merged 1 commit into
KhronosGroup:mainfrom
kaushalrog:fix/enumerate-extensions-oom
Jun 1, 2026
Merged

loader: Propagate OOM from loader_add_to_ext_list in two call sites#1911
charles-lunarg merged 1 commit into
KhronosGroup:mainfrom
kaushalrog:fix/enumerate-extensions-oom

Conversation

@kaushalrog

Copy link
Copy Markdown

loader_add_to_ext_list() returns VkResult and documents that VK_ERROR_OUT_OF_HOST_MEMORY signals allocation failure, but two call sites discarded the return value entirely:

  1. loader_read_layer_json() – when appending an instance extension from a layer's JSON manifest the OOM path silently drops the extension and continues. The device-extension block directly below it correctly checks the analogous loader_add_to_dev_ext_list() return value; bring instance-extension parsing in line with it.

  2. terminator_EnumerateInstanceExtensionProperties() – when merging implicit-layer extensions into the local list the return value was ignored. On allocation failure the function continues with an incomplete list and returns VK_SUCCESS to the application, violating the Vulkan spec guarantee that a successful count query returns the full set of available extensions.

Capture the return value in both sites and propagate VK_ERROR_OUT_OF_HOST_MEMORY via the existing 'goto out' paths.

Fixes: silent OOM swallowing in loader_read_layer_json
Fixes: silent OOM swallowing in terminator_EnumerateInstanceExtensionProperties
Reviewed-by: (pending)

loader_add_to_ext_list() returns VkResult and documents that
VK_ERROR_OUT_OF_HOST_MEMORY signals allocation failure, but two call
sites discarded the return value entirely:

1. loader_read_layer_json() – when appending an instance extension from
   a layer's JSON manifest the OOM path silently drops the extension and
   continues.  The device-extension block directly below it correctly
   checks the analogous loader_add_to_dev_ext_list() return value;
   bring instance-extension parsing in line with it.

2. terminator_EnumerateInstanceExtensionProperties() – when merging
   implicit-layer extensions into the local list the return value was
   ignored.  On allocation failure the function continues with an
   incomplete list and returns VK_SUCCESS to the application, violating
   the Vulkan spec guarantee that a successful count query returns the
   full set of available extensions.

Capture the return value in both sites and propagate
VK_ERROR_OUT_OF_HOST_MEMORY via the existing 'goto out' paths.

Fixes: silent OOM swallowing in loader_read_layer_json
Fixes: silent OOM swallowing in terminator_EnumerateInstanceExtensionProperties
Reviewed-by: (pending)
@ci-tester-lunarg

Copy link
Copy Markdown

Author kaushalrog not on autobuild list. Waiting for curator authorization before starting CI build.

1 similar comment
@ci-tester-lunarg

Copy link
Copy Markdown

Author kaushalrog not on autobuild list. Waiting for curator authorization before starting CI build.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 752281.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3496 running.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3496 passed.

@charles-lunarg charles-lunarg merged commit 0fdc7a4 into KhronosGroup:main Jun 1, 2026
46 checks passed
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.

3 participants