adobe / USD-Fileformat-plugins

A collection of USD fileformat plugins
298 stars 22 forks source link

pxr::Tftoken global destructor can cause a freeze in C++. #21

Closed MasayaNikaido closed 3 months ago

MasayaNikaido commented 3 months ago

Static TfToken is unsafe. These codes have direct static TfToken definitions.

I think it would be better to use the Static Token macros or pxr::Tftoken::Immortal.

Platform and Version

Logs taken while reproducing problem

CallStack

ntdll.dll!NtDelayExecution() + 20 bytes Unknown
ntdll.dll!RtlDelayExecution() + 67 bytes    Unknown
KernelBase.dll!SwitchToThread() + 27 bytes  Unknown
usd_ms.dll!pxrInternal_v0_23__pxrReserved__::TfToken::_PossiblyDestroyRep() + 212 bytes Unknown
fileformatUtils.dll!adobe::usd::Resolver::populateCache() + 2439 bytes  Unknown
fileformatUtils.dll!adobe::usd::Resolver::populateCache() + 5454 bytes  Unknown
fileformatUtils.dll!adobe::usd::Resolver::populateCache() + 1303 bytes  Unknown
fileformatUtils.dll!adobe::usd::Resolver::populateCache() + 1279 bytes  Unknown
fileformatUtils.dll!adobe::usd::Resolver::populateCache() + 1279 bytes  Unknown
fileformatUtils.dll!00007ffb3da8c5e2()  Unknown
ucrtbase.dll!__sys_nerr() + 691 bytes   Unknown
ucrtbase.dll!_o_free() + 222 bytes  Unknown
ucrtbase.dll!_execute_onexit_table() + 61 bytes Unknown
fileformatUtils.dll!00007ffb3da809fd()  Unknown
fileformatUtils.dll!00007ffb3da80b22()  Unknown
ntdll.dll!RtlActivateActivationContextUnsafeFast() + 303 bytes  Unknown
ntdll.dll!LdrShutdownProcess() + 374 bytes  Unknown
ntdll.dll!RtlExitUserProcess() + 173 bytes  Unknown
kernel32.dll!ExitProcess() + 11 bytes   Unknown
kwblackstone commented 3 months ago

Thanks for bringing this to our attention, we will do an audit of all non-trivial globals.

kwblackstone commented 3 months ago

These specific cases are fixed in v1.0.4 with some more fixes on the way. Please reopen if you are still having issues.