UsdStageRefPtr generation gives runtime error.
Description of Issue
UsdStageRefPtr ends execution on Visual Studio
Steps to Reproduce
- VS 2022 and Build tools for 2017
- Build OpenUSD as specified in the instructions
- Make a small binary and execute it from VS.
- The code
pxr::UsdStageRefPtr stage = pxr::UsdStage::CreateNew(outputPath);orpxr::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
Filed as internal issue #USD-8679
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
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.
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!