KhronosGroup / KhronosGroup/Vulkan-Tools
junk characters, sporadic illegal JSON, in vulkaninfo -j VkVideoCapabilitiesKHR
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 493
- Forks
- 202
- Avg merge
- 1h 37m
- Merged PRs (30d)
- 4
Description
Observed with vulkaninfoSDK from SDK 1.4.313.1. Does not appear with SDK 1.3.280.0. To date, only observed on Windows-AMD platforms, tcwinamd2, tcwinamd6, and tcwinamd7.
Install SDK 1.4.313.1, then run:
> C:\VulkanSDK\1.4.313.1\Bin\vulkaninfoSDK.exe -j
A file should be created in the current working directory, e.g. VP_VULKANINFO_AMD_Radeon_RX_6800_2_0_283.json. Examine that file, looking for fields "stdHeaderVersion"; they will always appear in a blcok for VkVideoCapabilitiesKHR, e.g.:
{
"capabilities": {
...
"videoProfiles": [
{
...
"capabilities": {
"VkVideoCapabilitiesKHR": {
...
"stdHeaderVersion": {
"extensionName": "VK_STD_vulkan_video_codec_h264_decode",
"specVersion": 4194304
}
},
...
},
...
Many such instances will appear in the profile (32 in the profile provided). In the attached file, I found these entries for extensionName and specVersion:
- 9 instances of
VK_STD_vulkan_video_codec_h264_decodeversion 4194304 - 1 instance of
^Aversion 2987434120 - 7 instances of
""(empty string) version 0 - 8 instances of
VK_STD_vulkan_video_codec_h265_decodeversion 4194304 - 1 instance of
HR_depth_stencil_resolveversion 1264536406 - 1 instance of
m32\\DrivP^A\\°I^Aversion 0 - 1 instance of
]version 2176 - 1 instance of
8¶O<8c>7version 2958819328 - 1 instance of `helper_invocation" version 1836020833
- 1 instance of
Lßó|ù^?version 2958819664 - 1 instance of
^Qversion 2959936704
Many of these appear to be simply wrong, with random values that could likely be symptoms of sporadic failure or the use of uninitialized memory.
The control characters in the JSON strings are strictly illegal, and will raise an error at parsing time, rendering these files useless.
This also demonstrates that the JSON encoder being used to create this file is not robust - if it receives unprintable control characters, it should encode them with the \uXXXX escape.
Finally, a new test case should be added to the vulkaninfo testing that can detect this error.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing vulkaninfoSDK.exe -j with SDK 1.4.313.1 on the reported Windows-AMD platforms and inspect the VkVideoCapabilitiesKHR serialization path and JSON encoder. The issue names no source file or existing test; done means valid escaped JSON, correct extensionName and specVersion values, and a regression test that detects the failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100