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

Section 2.9: Do runtimes have to detect invalid handles or not? #6

Closed
pH5 opened this issue Mar 23, 2019 · 2 comments
Closed

Section 2.9: Do runtimes have to detect invalid handles or not? #6

pH5 opened this issue Mar 23, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@pH5
Copy link

pH5 commented Mar 23, 2019

In the fundamentals chapter it is stated that:

2.9. Handles
Runtimes are not required to detect invalid handles. Usage of an invalid handle may result in undefined behavior.
All functions that take a handle parameter may return XR_ERROR_HANDLE_INVALID.

This looks like runtimes are allowed to just cast internal object pointers to handles and to leave invalid handle detection to the validation layers. But in several function descriptions the opposite is stated, for example:

7.3.3. xrCreateActionSpace
The runtime must return XR_ERROR_HANDLE_INVALID if the action provided in action is not a valid action.

Is it must or may? Are runtimes required to implement invalid handle detection or not?

@brycehutchings
Copy link

This, among other inconsistencies you've seen, is the result of back-and-forth design decisions in this area. The current intent was that runtimes are not required to validate handles (i.e. undefined behavior). Like you suggest, these musts should be mays or the sentence should be removed entirely. The intent is that developers use the validation layer to ensure the application is correctly written (e.g. only using valid handles).

@rpavlik rpavlik added the bug Something isn't working label Jul 30, 2019
@rpavlik
Copy link
Contributor

rpavlik commented Jul 30, 2019

This was clarified in 1.0.0 to be consistent: runtimes may detect invalid handles.

image

@rpavlik rpavlik closed this as completed Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants