Repository navigation
fix infinite loop in terminator_EnumeratePhysicalDeviceGroups - #2050
Merged
charles-lunarg merged 2 commits intoOct 10, 2026
Merged
Conversation
The per-driver counting loop advances icd_term at the bottom of the body, so the two count-query error paths retried the same driver for ever. Advance before the continue, and fold the same shape in loader_get_fullpath into its file-exists check.
|
Author aizu-m not on autobuild list. Waiting for curator authorization before starting CI build. |
1 similar comment
|
Author aizu-m not on autobuild list. Waiting for curator authorization before starting CI build. |
charles-lunarg
approved these changes
Oct 8, 2026
charles-lunarg
left a comment
Collaborator
There was a problem hiding this comment.
Very good to prevent these infinite loops. Thanks!
|
CI Vulkan-Loader build queued with queue ID 150577. |
|
CI Vulkan-Loader build # 3805 running. |
|
CI Vulkan-Loader build # 3805 passed. |
Seems GCC wants to be extra sure that snprintf isn't writing to a nullptr, so add in an extra check for it.
|
CI Vulkan-Loader build queued with queue ID 152341. |
|
CI Vulkan-Loader build queued with queue ID 152358. |
|
CI Vulkan-Loader build # 3809 running. |
|
CI Vulkan-Loader build # 3809 passed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found by grepping loader.c for
continueinside awhileloop that advances its iterator at the bottom of the body. Two hits. One test driver, itsvkEnumeratePhysicalDevicescount query returningVK_ERROR_INITIALIZATION_FAILED:The counting loop does
icd_term = icd_term->nextat the bottom. Both error pathscontinueabove it, so the failing driver is queried again straight away. The trampoline holdsloader_lockthe whole time, so anything else taking that lock stops behind the spin. A 1.0 driver reaches theEnumeratePhysicalDevicesbranch because it exposes novkEnumeratePhysicalDeviceGroups.loader_get_fullpathis the other hit:continueon a negativesnprintfreturn skipsdir = next_dir. Folded that check into the file-exists test so the loop always advances.Regression test added. It spins for ever before the change and passes after.