KhronosGroup / KhronosGroup/OpenXR-SDK-Source

Validation layer catch(...) behavior is confusing

Open
#266 4 comments 0 reactions 0 assignees View on GitHub
synced to gitlab
Dominant language
Python
Stars
825
Forks
306
Avg merge
1d 23h
Merged PRs (30d)
1

Description

I recently encountered behavior in SteamVR where [`xrAttachSessionActionSets` would sometimes throw C++ exceptions](https://steamcommunity.com/app/250820/discussions/8/3059617763557427211/). While this may be a bug in SteamVR (throwing exceptions through a C ABI is obviously not well-defined), my investigation was slowed by the validation layers' silent, blanket conversion of all caught exceptions to `XR_ERROR_VALIDATION_FAILURE`, giving the appearance that specific application misbehavior had been detected, although no diagnostics were produced. This was further confounded by (I presume) C++ ABI details causing the exceptions to only be caught in release builds of the layers.

Ideally, the validation layer should only catch its own exceptions, by e.g. inheriting them from a private base class, and then `catch`ing that base class by reference.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the validation layer's exception handling around xrAttachSessionActionSets and inspect how caught exceptions become XR_ERROR_VALIDATION_FAILURE. Determine how layer-owned exceptions are identified and how external C++ exceptions currently reach the catch block. Done means external exceptions are not silently reported as validation failures and the layer's own failures retain their intended result.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
api
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.