Skip to content

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

@lunarpapillo

Description

@lunarpapillo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions