initialise lib_status on all failure paths in loader_scanned_icd_add - #2032
Merged
Merged
Conversation
|
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. |
|
CI Vulkan-Loader build queued with queue ID 111862. |
charles-lunarg
approved these changes
Sep 9, 2026
charles-lunarg
left a comment
Collaborator
There was a problem hiding this comment.
Those failure paths should probably set lib_status (with a unique error code). I know I didn't add them in the recent PR because I didn't want to go out of scope for the PR.
Initializing lib_status is a much better long term solution regardless so appreciate the PR!
|
CI Vulkan-Loader build # 3753 running. |
|
CI Vulkan-Loader build # 3753 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.
Chasing the recent lib_status work, I looked at how loader_icd_scan picks its rejection diagnostic:
loader_scanned_icd_add only writes *lib_status on some of the paths that return VK_ERROR_INCOMPATIBLE_DRIVER. Four of them do not:
A driver whose library loads but omits one of those entrypoints reaches one of these paths, and the caller then switches on an indeterminate value. The sibling paths were given a *lib_status just now, so this is a read of genuinely uninitialised stack rather than a stale-but-valid status, and the switch has no default to catch it.
Seed the out-parameter at entry so every return path leaves it defined. The specific paths still override it, so their diagnostics are unchanged.
The layer side is fine, its lib_status is a field of a calloc'd loader_layer_properties.