KhronosGroup / KhronosGroup/Vulkan-Tools

junk characters, sporadic illegal JSON, in vulkaninfo -j VkVideoCapabilitiesKHR

Open
#1,143 5 comments 0 reactions 0 assignees View on GitHub

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_decode version 4194304
  • 1 instance of ^A version 2987434120
  • 7 instances of "" (empty string) version 0
  • 8 instances of VK_STD_vulkan_video_codec_h265_decode version 4194304
  • 1 instance of HR_depth_stencil_resolve version 1264536406
  • 1 instance of m32\\DrivP^A\\°I^A version 0
  • 1 instance of ] version 2176
  • 1 instance of 8¶O<8c>7 version 2958819328
  • 1 instance of `helper_invocation" version 1836020833
  • 1 instance of Lßó|ù^? version 2958819664
  • 1 instance of ^Q version 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.