Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API dump layer breaks hello_xr on Linux #162

Closed
rpavlik opened this issue Feb 27, 2020 · 11 comments
Closed

API dump layer breaks hello_xr on Linux #162

rpavlik opened this issue Feb 27, 2020 · 11 comments
Assignees
Labels
bug Something isn't working in layers synced to gitlab Synchronized to OpenXR internal GitLab

Comments

@rpavlik
Copy link
Contributor

rpavlik commented Feb 27, 2020

I'm using release 1.0.6 installed on Debian Buster, with some monado build set as active runtime. Running hello_xr -g vulkan on its own works fine. It also works fine if I set XR_ENABLE_API_LAYERS to XR_APILAYER_LUNARG_core_validation. However. if I set that same variable to XR_APILAYER_LUNARG_api_dump, the application quits immediately. Here is the log:
newlog.txt

cc @Wallbraker

@rpavlik rpavlik added bug Something isn't working in layers labels Feb 27, 2020
@bradgrantham-lunarg
Copy link

I'll try to get a linux system set up, Buster installed, and Monado built. In the meantime, can you help me possibly debug this a little? In the app, does it give any indication of failure? Like xrGetVulkanGraphicsRequirementsKHR returns an error? It looks like the app decides to terminate and call xrDestroyInstance after calling GetVulkanGraphicsRequirements, so I'm hoping the apidump layer just didn't return status correctly or maybe doesn't understand Vulkan properly or something.

@rpavlik
Copy link
Contributor Author

rpavlik commented Feb 27, 2020

Looks like stdout and stderr got a little interleaved: I think this part is meaningful from the app:

[10:58:16.455][Error  ] XrResult failure [XR_ERROR_VALIDATION_FAILURE]
    Origin: pfnGetVulkanInstanceExtensionsKHR(instance, systemId, 0, &extensionNamesSize, nullptr)
    Source: ./src/tests/hello_xr/graphicsplugin_vulkan.cpp:1263

It may do this on Windows (oculus desktop) too, I just haven't tried.

Hopefully it's just a misunderstanding by the api dump layer - I know MS has found some issues with that layer and other platform-related things.

@bradgrantham-lunarg
Copy link

Great, thank you! Yeah, it sounds like it's not Linux specific. Maybe I can make apidump fail on Windows just by calling xrGetVulkanGraphicsRequirementsKHR

@bradgrantham-lunarg
Copy link

ApiDumpLayerRecordContent() never gets called (no output) so probably an exception is thrown.
buffer is nullptr for this call (first of two-call idiom, I think?):

        contents.emplace_back("char*", "buffer", buffer);

That's a std::tuple of three std::string, and string(nullptr) is undefined behavior, so probably the std library just threw an exception. I suppose a possible change is to have "buffer" generated as (buffer ? buffer : "(nullptr)") or some such. I'll look into the generator.

@rpavlik
Copy link
Contributor Author

rpavlik commented Feb 27, 2020

Oh interesting. The old "std::string(nullptr)" rears its head again, perhaps, go figure

@rpavlik-bot
Copy link
Collaborator

An issue (number 1323) has been filed to correspond to this issue in the internal Khronos GitLab.

If you have a Khronos account, you can access that issue at KHR:openxr/openxr#1323.

@rpavlik-bot rpavlik-bot added the synced to gitlab Synchronized to OpenXR internal GitLab label Mar 23, 2020
@bradgrantham-lunarg
Copy link

bradgrantham-lunarg commented Apr 7, 2020

@rpavlik - do you still have an environment that can test this?
KHR:openxr/openxr!1712

@rpavlik
Copy link
Contributor Author

rpavlik commented Apr 8, 2020

There's no particular environment needed - this now shows up in the packages even.

I have not tested it on Windows yet.

# This works
env XR_ENABLE_API_LAYERS=XR_APILAYER_LUNARG_core_validation hello_xr -g Vulkan

# This exits immediately
env XR_ENABLE_API_LAYERS=XR_APILAYER_LUNARG_api_dump hello_xr -g Vulkan

@bradgrantham-lunarg
Copy link

I've just run it on Windows and verified that the nullptr passed in to xrGetVulkanInstanceExtensionsKHR is printed as "(nullptr)".

@rpavlik
Copy link
Contributor Author

rpavlik commented May 5, 2020

Merged in GitLab, will be in next release.

rpavlik added a commit that referenced this issue May 29, 2020
-   Registry
    -   Add an author ID, and reserve a vendor extension for Huawei.
        (OpenXR-Docs/#46)
    -   Reserve vendor extensions for future LunarG overlay and input
        focus functionality. (internal MR 1720)
    -   Reserve vendor extensions for Microsoft. (internal MR 1723)
    -   Add XR_EXT_hand_tracking multi-vendor extension. (internal MR
        1554, internal issue 1266, internal issue 1267, internal issue
        1268, internal issue 1269)
    -   Add XR_HUAWEI_controller_interaction vendor extension.
        (OpenXR-Docs/#47)
    -   Add XR_MNDX_egl_enable provisional vendor extension.
        (OpenXR-Docs/#48)
    -   Add XR_MSFT_spatial_graph_bridge vendor extension. (internal MR
        1730)
    -   Add XR_MSFT_secondary_view_configuration and
        XR_MSFT_first_person_observer vendor extensions. (internal MR
        1731)
    -   Add XR_MSFT_hand_mesh_tracking vendor extension. (internal MR
        1736)
    -   Fix missing space in XML definition of
        XrSpatialAnchorCreateInfoMSFT. (internal MR 1742, internal issue
        1351, OpenXR-SDK-Source/#187)
    -   Update a number of contacts for author/vendor tags. (internal MR
        1788, internal issue 1326)
-   SDK
    -   Replaced usage of the _DEBUG macro with NDEBUG. (internal MR
        1756)
    -   Allow disabling of std::filesystem usage via CMake, and detect
        if it’s available and what its requirements are.
        (OpenXR-SDK-Source/#192, OpenXR-SDK-Source/#188)
    -   CI: Modifications to Azure DevOps build pipeline. Now builds UWP
        loader DLLs in addition to Win32 loader DLLs. No longer builds
        static loader libraries due to linkability concerns. Re-arranged
        release artifact zip to distinguish architecture from 32-bit or
        64-bit.
    -   Loader: Replace global static initializers with functions that
        return static locals. With this change, code that includes
        OpenXR doesn’t have to page in this code and initialize these
        during startup. (OpenXR-SDK-Source/#173)
    -   Loader: Unload runtime when xrCreateInstance fails. (internal MR
        1778)
    -   Loader: Add “info”-level debug messages listing all the places
        that we look for the OpenXR active runtime manifest.
        (OpenXR-SDK-Source/#190)
    -   Validation Layer: Fix crash in dereferencing a nullptr optional
        array handle when the count > 0. (internal MR 1709,
        OpenXR-SDK-Source/#161, internal issue 1322)
    -   Validation Layer: Fix static analysis error and possible loss of
        validation error. (internal MR 1715, OpenXR-SDK-Source/#160,
        internal issue 1321)
    -   Validation Layer: Simplify some generated code, and minor
        performance improvements. (OpenXR-SDK-Source/#176)
    -   API Dump Layer: Fix crash in dereferencing a nullptr while
        constructing a std::string. (internal MR 1712,
        OpenXR-SDK-Source/#162, internal issue 1323)
    -   hello_xr: Fix releasing a swapchain image with the incorrect
        image layout. (internal MR 1755)
    -   hello_xr: Prefer VK_LAYER_KHRONOS_validation over
        VK_LAYER_LUNARG_standard_validation when available. (internal MR
        1755)
    -   hello_xr: Optimizations to D3D12 plugin to avoid GPU pipeline
        stall. (internal MR 1770) (OpenXR-SDK-Source/#175)
    -   hello_xr: Fix build with Vulkan headers 1.2.136.
        (OpenXR-SDK-Source/#181, OpenXR-SDK-Source/#180, internal issue
        1347)
    -   hello_xr: Fix build with Visual Studio 16.6.
        (OpenXR-SDK-Source/#186, OpenXR-SDK-Source/#184)
@rpavlik
Copy link
Contributor Author

rpavlik commented May 31, 2020

Fix released in 1.0.9

@rpavlik rpavlik closed this as completed May 31, 2020
rhabacker pushed a commit to rhabacker/OpenXR-SDK-Source that referenced this issue Nov 16, 2022
-   Registry
    -   Add an author ID, and reserve a vendor extension for Huawei.
        (OpenXR-Docs/KhronosGroup#46)
    -   Reserve vendor extensions for future LunarG overlay and input
        focus functionality. (internal MR 1720)
    -   Reserve vendor extensions for Microsoft. (internal MR 1723)
    -   Add XR_EXT_hand_tracking multi-vendor extension. (internal MR
        1554, internal issue 1266, internal issue 1267, internal issue
        1268, internal issue 1269)
    -   Add XR_HUAWEI_controller_interaction vendor extension.
        (OpenXR-Docs/KhronosGroup#47)
    -   Add XR_MNDX_egl_enable provisional vendor extension.
        (OpenXR-Docs/KhronosGroup#48)
    -   Add XR_MSFT_spatial_graph_bridge vendor extension. (internal MR
        1730)
    -   Add XR_MSFT_secondary_view_configuration and
        XR_MSFT_first_person_observer vendor extensions. (internal MR
        1731)
    -   Add XR_MSFT_hand_mesh_tracking vendor extension. (internal MR
        1736)
    -   Fix missing space in XML definition of
        XrSpatialAnchorCreateInfoMSFT. (internal MR 1742, internal issue
        1351, OpenXR-SDK-Source/KhronosGroup#187)
    -   Update a number of contacts for author/vendor tags. (internal MR
        1788, internal issue 1326)
-   SDK
    -   Replaced usage of the _DEBUG macro with NDEBUG. (internal MR
        1756)
    -   Allow disabling of std::filesystem usage via CMake, and detect
        if it’s available and what its requirements are.
        (OpenXR-SDK-Source/KhronosGroup#192, OpenXR-SDK-Source/KhronosGroup#188)
    -   CI: Modifications to Azure DevOps build pipeline. Now builds UWP
        loader DLLs in addition to Win32 loader DLLs. No longer builds
        static loader libraries due to linkability concerns. Re-arranged
        release artifact zip to distinguish architecture from 32-bit or
        64-bit.
    -   Loader: Replace global static initializers with functions that
        return static locals. With this change, code that includes
        OpenXR doesn’t have to page in this code and initialize these
        during startup. (OpenXR-SDK-Source/KhronosGroup#173)
    -   Loader: Unload runtime when xrCreateInstance fails. (internal MR
        1778)
    -   Loader: Add “info”-level debug messages listing all the places
        that we look for the OpenXR active runtime manifest.
        (OpenXR-SDK-Source/KhronosGroup#190)
    -   Validation Layer: Fix crash in dereferencing a nullptr optional
        array handle when the count > 0. (internal MR 1709,
        OpenXR-SDK-Source/KhronosGroup#161, internal issue 1322)
    -   Validation Layer: Fix static analysis error and possible loss of
        validation error. (internal MR 1715, OpenXR-SDK-Source/KhronosGroup#160,
        internal issue 1321)
    -   Validation Layer: Simplify some generated code, and minor
        performance improvements. (OpenXR-SDK-Source/KhronosGroup#176)
    -   API Dump Layer: Fix crash in dereferencing a nullptr while
        constructing a std::string. (internal MR 1712,
        OpenXR-SDK-Source/KhronosGroup#162, internal issue 1323)
    -   hello_xr: Fix releasing a swapchain image with the incorrect
        image layout. (internal MR 1755)
    -   hello_xr: Prefer VK_LAYER_KHRONOS_validation over
        VK_LAYER_LUNARG_standard_validation when available. (internal MR
        1755)
    -   hello_xr: Optimizations to D3D12 plugin to avoid GPU pipeline
        stall. (internal MR 1770) (OpenXR-SDK-Source/KhronosGroup#175)
    -   hello_xr: Fix build with Vulkan headers 1.2.136.
        (OpenXR-SDK-Source/KhronosGroup#181, OpenXR-SDK-Source/KhronosGroup#180, internal issue
        1347)
    -   hello_xr: Fix build with Visual Studio 16.6.
        (OpenXR-SDK-Source/KhronosGroup#186, OpenXR-SDK-Source/KhronosGroup#184)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working in layers synced to gitlab Synchronized to OpenXR internal GitLab
Projects
None yet
Development

No branches or pull requests

3 participants