question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Validation layer: fall through/loss of error in two-call idiom

See original GitHub issue

The generated code for two-call idiom calls is producing a static analysis warning “Value stored to ‘xr_result’ is never read”. which is because it’s just falling through after setting xr_result instead of returning it or otherwise accumulating the error.

The code in question looks like:

        // Optional array must be non-NULL when viewCapacityInput is non-zero
        if (0 != viewCapacityInput && nullptr == views) {
            CoreValidLogMessage(gen_instance_info, "VUID-xrEnumerateViewConfigurationViews-views-parameter",
                                VALID_USAGE_DEBUG_SEVERITY_ERROR, "xrEnumerateViewConfigurationViews",
                                objects_info,
                                "Command xrEnumerateViewConfigurationViews param views is NULL, but viewCapacityInput is greater than 0");
            xr_result = XR_ERROR_VALIDATION_FAILURE;
        }
        // Non-optional pointer/array variable that needs to not be NULL
        if (nullptr == viewCountOutput) {
            CoreValidLogMessage(gen_instance_info, "VUID-xrEnumerateViewConfigurationViews-viewCountOutput-parameter",
                                VALID_USAGE_DEBUG_SEVERITY_ERROR, "xrEnumerateViewConfigurationViews", objects_info,
                                "Invalid NULL for uint32_t \"viewCountOutput\" which is not "
                                "optional and must be non-NULL");
            return XR_ERROR_VALIDATION_FAILURE;
        }

This is also triggering a later null dereference, when e.g. in the GenValidUsageInputsXrEnumerateSwapchainImages function, that warning is printed, but then we go through to iterate the null container, etc.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:18 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
bradgrantham-lunargcommented, Feb 27, 2020

I said:

I’m not sure why it doesn’t just return xr_result right away. Maybe I should just change any case that sets the result to just return instead.

You said:

so I think now we should return here instead of just setting xr_result

I’m glad you agree with me. I’ll look into the generator.

0reactions
rpavlikcommented, Jun 1, 2020

Yep, sorry I missed it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Validation Error less than training error? - Cross Validated
In my case - batch-norm layers were the culprits. When I deleted them - training loss became similar to validation loss.
Read more >
The OpenXR Specification - Khronos Registry
If the validation layer detects a problem, it issues an error message that can ... A two-call idiom may be employed, first calling...
Read more >
GSM 04.08 - Version 5.0.0 - ETSI
Mobile radio interface layer 3 specification. (GSM 04.08). ETSI. European Telecommunications Standards Institute. ETSI Secretariat.
Read more >
System Error Messages Guide For Access and Edge Routers ...
Code Explanation Fatal 0x8000 Signal loss Yes 0x4000 Hard error Yes ... a reply to another layer of ET-Analytics feature's software stack.
Read more >
DGW Software Configuration Guide - Media5 Corporation
From the Severity drop-down list, for each service, ... Network-layer protocol phase: The Mediatrix unit negotiates an IP address.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found