Open pablode opened 1 month ago
Attached with VS debugger:
Exception thrown at 0x00007FFE9BA5436E (usd_hdMtlx.dll) in python.exe: 0xC0000005: Access violation reading location 0x0000000000000000.
Crashes on mac as well, during this recursion in _AddStrippedSurfaceNode
.
// If hdNode is connected to the surfaceshader node, recursively call
// this function to make sure that surfaceshader node is added to
// the mxDocument
if (mxTypeDesc == mx::Type::SURFACESHADER) {
auto const& hdConnectedPath = connIt.second.front().upstreamNode;
auto const& hdConnectedNode = hdNetwork.nodes.at(hdConnectedPath);
mx::NodePtr mxConnectedNode =
_AddStrippedSurfaceNode(mxDocument, hdConnectedPath.GetName(),
hdConnectedNode, hdNetwork);
mx::InputPtr mxInput =
mxNode->addInput(mxInput->getName(), mxInput->getType());
mxInput->setConnectedNode(mxConnectedNode);
}
#0 0x000000010b9c3610 in std::__1::__shared_count::__release_shared[abi:ue170006]() [inlined] at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/__memory/shared_ptr.h:173
#1 0x000000010b9c35f0 in std::__1::__shared_weak_count::__release_shared[abi:ue170006]() [inlined] at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/__memory/shared_ptr.h:214
#2 0x000000010b9c35f0 in std::__1::shared_ptr<MaterialX_v1_38_10::Document>::~shared_ptr[abi:ue170006]() [inlined] at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/__memory/shared_ptr.h:773
#3 0x000000010b9c35ec in std::__1::shared_ptr<MaterialX_v1_38_10::Document>::~shared_ptr[abi:ue170006]() [inlined] at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/__memory/shared_ptr.h:771
#4 0x000000010b9c35ec in pxrInternal_v0_24__pxrReserved__::_AddStrippedSurfaceNode(std::__1::shared_ptr<MaterialX_v1_38_10::Document>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, pxrInternal_v0_24__pxrReserved__::HdMaterialNode2 const&, pxrInternal_v0_24__pxrReserved__::HdMaterialNetwork2 const&) (.cold.1) at /Users/nporcino/dev/usd-github-meshula/pxr/imaging/hdSt/materialXFilter.cpp:692
#5 0x000000010b8f4970 in std::__1::shared_ptr<MaterialX_v1_38_10::Document>::~shared_ptr[abi:ue170006]() [inlined] ()
#6 0x000000010b8f4968 in pxrInternal_v0_24__pxrReserved__::_AddStrippedSurfaceNode(std::__1::shared_ptr<MaterialX_v1_38_10::Document>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, pxrInternal_v0_24__pxrReserved__::HdMaterialNode2 const&, pxrInternal_v0_24__pxrReserved__::HdMaterialNetwork2 const&) at /Users/nporcino/dev/usd-github-meshula/pxr/imaging/hdSt/materialXFilter.cpp:692
#7 0x000000010b8f373c in pxrInternal_v0_24__pxrReserved__::_IsTransparentShader(pxrInternal_v0_24__pxrReserved__::HdMaterialNetwork2 const&, pxrInternal_v0_24__pxrReserved__::HdMaterialNode2 const&) at /Users/nporcino/dev/usd-github-meshula/pxr/imaging/hdSt/materialXFilter.cpp:748
#8 0x000000010b8e9334 in pxrInternal_v0_24__pxrReserved__::_GetMaterialTag(pxrInternal_v0_24__pxrReserved__::HdMaterialNetwork2 const&, pxrInternal_v0_24__pxrReserved__::HdMaterialNode2 const&) [inlined] at /Users/nporcino/dev/usd-github-meshula/pxr/imaging/hdSt/materialXFilter.cpp:807
#9 0x000000010b8e918c in pxrInternal_v0_24__pxrReserved__::HdSt_ApplyMaterialXFilter(pxrInternal_v0_24__pxrReserved__::HdMaterialNetwork2*, pxrInternal_v0_24__pxrReserved__::SdfPath const&, pxrInternal_v0_24__pxrReserved__::HdMaterialNode2 const&, pxrInternal_v0_24__pxrReserved__::SdfPath const&, std::__1::vector<pxrInternal_v0_24__pxrReserved__::HdSt_MaterialParam, std::__1::allocator<pxrInternal_v0_24__pxrReserved__::HdSt_MaterialParam>>*, pxrInternal_v0_24__pxrReserved__::HdStResourceRegistry*) at /Users/nporcino/dev/usd-github-meshula/pxr/imaging/hdSt/materialXFilter.cpp:1439
#10 0x000000010b8cfb48 in pxrInternal_v0_24__pxrReserved__::HdStMaterialNetwork::ProcessMaterialNetwork(pxrInternal_v0_24__pxrReserved__::SdfPath const&, pxrInternal_v0_24__pxrReserved__::HdMaterialNetworkMap const&, pxrInternal_v0_24__pxrReserved__::HdStResourceRegistry*) at /Users/nporcino/dev/usd-github-meshula/pxr/imaging/hdSt/materialNetwork.cpp:1106
#11 0x000000010b8cbd8c in pxrInternal_v0_24__pxrReserved__::HdStMaterial::Sync(pxrInternal_v0_24__pxrReserved__::HdSceneDelegate*, pxrInternal_v0_24__pxrReserved__::HdRenderParam*, unsigned int*) at /Users/nporcino/dev/usd-github-meshula/pxr/imaging/hdSt/material.cpp:206
#12 0x000000010b297bf8 in pxrInternal_v0_24__pxrReserved__::Hd_PrimTypeIndex<pxrInternal_v0_24__pxrReserved__::HdSprim>::SyncPrims(pxrInternal_v0_24__pxrReserved__::HdChangeTracker&, pxrInternal_v0_24__pxrReserved__::HdRenderParam*, pxrInternal_v0_24__pxrReserved__::HdRenderDelegate*) at /Users/nporcino/dev/usd-github-meshula/pxr/imaging/hd/primTypeIndex.cpp:410
#13 0x000000010b2cd42c in pxrInternal_v0_24__pxrReserved__::HdRenderIndex::SyncAll(std::__1::vector<std::__1::shared_ptr<pxrInternal_v0_24__pxrReserved__::HdTask>, std::__1::allocator<std::__1::shared_ptr<pxrInternal_v0_24__pxrReserved__::HdTask>>>*, std::__1::unordered_map<pxrInternal_v0_24__pxrReserved__::TfToken, pxrInternal_v0_24__pxrReserved__::VtValue, pxrInternal_v0_24__pxrReserved__::TfToken::HashFunctor, std::__1::equal_to<pxrInternal_v0_24__pxrReserved__::TfToken>, std::__1::allocator<std::__1::pair<pxrInternal_v0_24__pxrReserved__::TfToken const, pxrInternal_v0_24__pxrReserved__::VtValue>>>*) at /Users/nporcino/dev/usd-github-meshula/pxr/imaging/hd/renderIndex.cpp:1405
#14 0x000000010b2168c8 in pxrInternal_v0_24__pxrReserved__::HdEngine::Execute(pxrInternal_v0_24__pxrReserved__::HdRenderIndex*, std::__1::vector<std::__1::shared_ptr<pxrInternal_v0_24__pxrReserved__::HdTask>, std::__1::allocator<std::__1::shared_ptr<pxrInternal_v0_24__pxrReserved__::HdTask>>>*) at /Users/nporcino/dev/usd-github-meshula/pxr/imaging/hd/engine.cpp:107
#15 0x0000000107e78d38 in pxrInternal_v0_24__pxrReserved__::UsdImagingGLEngine::_Execute(pxrInternal_v0_24__pxrReserved__::UsdImagingGLRenderParams const&, std::__1::vector<std::__1::shared_ptr<pxrInternal_v0_24__pxrReserved__::HdTask>, std::__1::allocator<std::__1::shared_ptr<pxrInternal_v0_24__pxrReserved__::HdTask>>>) [inlined] at /Users/nporcino/dev/usd-github-meshula/pxr/usdImaging/usdImagingGL/engine.cpp:1599
#16 0x0000000107e78d28 in pxrInternal_v0_24__pxrReserved__::UsdImagingGLEngine::RenderBatch(std::__1::vector<pxrInternal_v0_24__pxrReserved__::SdfPath, std::__1::allocator<pxrInternal_v0_24__pxrReserved__::SdfPath>> const&, pxrInternal_v0_24__pxrReserved__::UsdImagingGLRenderParams const&) at /Users/nporcino/dev/usd-github-meshula/pxr/usdImaging/usdImagingGL/engine.cpp:436
#17 0x0000000107e79cb0 in pxrInternal_v0_24__pxrReserved__::UsdImagingGLEngine::Render(pxrInternal_v0_24__pxrReserved__::UsdPrim const&, pxrInternal_v0_24__pxrReserved__::UsdImagingGLRenderParams const&) at /Users/nporcino/dev/usd-github-meshula/pxr/usdImaging/usdImagingGL/engine.cpp:461
Filed as internal issue #USD-9868
Description of Issue
Opening the specific file below with any USD tooling (usdview, usdrecord, ...) leads to a SEGFAULT.
Steps to Reproduce
(Note: the files are originally from https://github.com/stehrani3d/MaterialEggs. mtl.usdc has been patched to account for a MaterialX validation error.)
System Information (OS, Hardware)
OS: Windows 10 GPU: NVIDIA GeForce RTX 2060
Package Versions
OpenUSD v24.05
Build Flags
python build_scripts/build_usd.py --prman --prman-location "C:/Program Files/Pixar/RenderManProServer-26.1" --openimageio --opencolorio INSTALL --build-args OpenImageIO,"-DOIIO_BUILD_TOOLS=ON"