Repository navigation
parse driverVersion through valuedouble in parse_device_configuration - #2051
Merged
charles-lunarg merged 1 commit intoOct 10, 2026
Merged
Conversation
cJSON's valueint saturates at INT_MAX, so a settings file device_configuration naming a driverVersion above it (any NVIDIA driver from the 512 series on) can never match the enumerated device and the device is dropped. Read the number through valuedouble with a range check, and print driverVersion with %u at its log sites.
|
User aizu-m not on autobuild list. Waiting for curator authorization before starting CI build. |
1 similar comment
|
User aizu-m not on autobuild list. Waiting for curator authorization before starting CI build. |
|
CI Vulkan-Loader build queued with queue ID 152300. |
|
CI Vulkan-Loader build # 3807 running. |
|
CI Vulkan-Loader build # 3807 passed. |
charles-lunarg
approved these changes
Oct 10, 2026
charles-lunarg
left a comment
Collaborator
There was a problem hiding this comment.
Well, that goes to show how annoying mixing signed and unsigned types can be.
For years signed would have been fine, then one driver's version was large enough to exceed it.
Thanks for catching and fixing it.
Contributor
Author
|
Thanks for the merge, glad this one landed. |
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.
Chased a report of a configured device vanishing from enumeration. The loader's own warning gave it away:
The settings file said 2307751936, which is NVIDIA 550.54.0 with the major release packed into the top ten bits. parse_device_configuration reads the number through cJSON's valueint, and parse_number saturates valueint at INT_MAX. driverVersion is a uint32_t. Every NVIDIA driver from the 512 series on packs to a value above INT_MAX, so the equality check in loader_apply_settings_device_configurations can never match; once no configuration matches, vkEnumeratePhysicalDevices returns VK_ERROR_INITIALIZATION_FAILED.
Read the value through valuedouble with a [0, UINT32_MAX] range check instead, the same validation shape parse_uuid_array applies to its bytes. The driverVersion log sites used %d and printed these versions as negative numbers; switched to %u.
The new test fails before the change (configured device hidden, enumeration fails) and passes after.