PixarAnimationStudios / OpenUSD

Universal Scene Description

Home Page:http://www.openusd.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unhandled exception (usd_tf.dll)

alexwennstrom opened this issue · comments

Description of Issue

Trivial c++ test program fails to run:

#include <fstream>
#include <iostream>

#include <pxr/usd/usd/stage.h>

int main(int argc, const char **argv) {

    auto stage = pxr::UsdStage::CreateInMemory("simple.usda");
    std::string result;
    stage->GetRootLayer()->ExportToString(&result);
    std::cout << result << std::endl;

  return 0;
}

Result:
Exception thrown at 0x00007FFEC23D3269 (usd_tf.dll) in usdimp.exe: 0xC0000005: Access violation reading location 0x0000003A45D15BFA.
No idea how to proceed.

Steps to Reproduce

  1. built usd according to instructions
  2. spent almost a working day to make a test program to build with VS code and CMake
  3. copied /lib/usd to executable folder
  4. debug from VS code

System Information (OS, Hardware)

Windows 11

Package Versions

1.38.7

Build Flags

[main] Building folder: usdimp 
[build] Starting build
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --build c:/dev/usdimp/build --config Debug --target ALL_BUILD -j 34 --
[build] MSBuild version 17.7.2+d6990bcfa for .NET Framework
[build]   main.cpp
[build]   TBB Warning: tbb/task.h is deprecated. For details, please see Deprecated Features appendix in the TBB reference manual.
[build]   usdimp.vcxproj -> C:\dev\usdimp\build\Debug\usdimp.exe
[driver] Build completed: 00:00:03.972
[build] Build finished with exit code 0

After enabling TF_DEBUG=*
I get this output when runing the exe manualy in a terminal:

pxrInternal_v0_24__pxrReserved__::Tf_DebugSymbolRegistry::_Register: USD_STAGE_OPEN
pxrInternal_v0_24__pxrReserved__::Tf_DebugSymbolRegistry::_Register: USD_STAGE_INSTANTIATION_TIME
pxrInternal_v0_24__pxrReserved__::Tf_DebugSymbolRegistry::_Register: USD_VALIDATE_VARIABILITY
pxrInternal_v0_24__pxrReserved__::Tf_DebugSymbolRegistry::_Register: USD_VALUE_RESOLUTION
TfRegistryManager: running 7 functions for TfEnum
TfRegistryManager: running 13 functions for TfType
TfRegistryManager: running 9 functions for Tf_EnvSettingRegistry
TfRegistryManager: running 0 functions for VtValue
SdfLayer::FindOrOpen('≡}x»Ç☺', '< <target: usd> >')

I would guess that '≡}x»Ç☺' is a hashed string?

Filed as internal issue #USD-9648

When I build a release coniguration instead of debug everything works fine. A debug build gives all kind of strange errors.