OpenUSD icon indicating copy to clipboard operation
OpenUSD copied to clipboard

UsdStageRefPtr generation gives runtime error.

Open alejandronespereira opened this issue 2 years ago • 4 comments

Description of Issue

UsdStageRefPtr ends execution on Visual Studio

Steps to Reproduce

  1. VS 2022 and Build tools for 2017
  2. Build OpenUSD as specified in the instructions
  3. Make a small binary and execute it from VS.
  4. The code pxr::UsdStageRefPtr stage = pxr::UsdStage::CreateNew(outputPath); or pxr::SdfLayerRefPtr layer = pxr::SdfLayer::CreateAnonymous(".usda"); to create an anonymous stage breaks the execution with a return code -1073741819. No exception is thrown, the program simply exits with that error code.

System Information (OS, Hardware)

Windows 10. Visual Studio 2022 Build tools 2017 (v141) or Build tools 2022 (v143)

Package Versions

Build Flags

alejandronespereira avatar Sep 09 '23 19:09 alejandronespereira

Filed as internal issue #USD-8679

jesschimein avatar Sep 11 '23 15:09 jesschimein

Sorry for the delay here, @alejandronespereira ... we;ve never heard of this one before - were you able to work through it? We will soon be moving forward our supported version of VS, but still a ways away from VS 2022

spiffmon avatar Apr 08 '24 22:04 spiffmon

FWIW SideFX has been building USD with VS 2022 for quite a while without any issues. We don't use the standard build scripts, but it all just boils down to running CMake. And you can see every deviation we make from "stock" USD here: https://github.com/sideeffects/USD/commits/dev_houdini20.5alpha/. Nothing jumps out as being relevant to VS 2022. So I suspect the problem is a run-time problem, not a build-time issue.

When I have seen crashes like this it is often related to the runtime loading multiple different instances of USD or plugins from multiple different builds of USD (because it shows up in multiple different locations in your PATH). But try turning on TF_DEBUG=* to generate lots of logging that might help narrow down the issue.

marktucker avatar Apr 09 '24 12:04 marktucker

Hi! I sadly didn't manage to fix it. I have forgotten most of it and (I am pretty sure) deleted it all already, so no chances on reproducing it.

Do not worry, I knew it was unrealistic to expect a solution to such a niche problem in that short notice ( I was working on a job application with a tight deadline) , so once I saw I could not solve it on my own, I moved to a new installation on a different computer and wrote this issue just to have it recorded for your project.

Cheers!

alejandronespereira avatar Apr 09 '24 14:04 alejandronespereira