AcademySoftwareFoundation / OpenRV

Open source version of RV, the Sci-Tech award-winning media review and playback software.
Other
550 stars 127 forks source link

[Bug]: OCIO causes crashing unless reader threads set to 1 #463

Closed kenmcgaugh closed 1 month ago

kenmcgaugh commented 1 month ago

What happened?

Enabling OCIO causes RV to become very unstable. The frequency of the crashes increases with the complexity of the python code that loads and processes the config before running OCIO.SetCurrentConfig(config). In my case it crashes 75% of the time the moment it first tries to render a frame.

The crashng happens in the "IPGraph Eval" thread within the IPCore::OCIOIPNode::evaluate() method.

The only workaround I've found is to set the number of reading threads to 1.

List all the operating systems versions where this is happening

macOS 14.3

On what computer hardware is this happening?

Apple macbook pro M1 16GB

Relevant console log output

Sometimes it is just a Segmentation Fault. Other times it is something like:

RV (...) malloc: Heap corruption detected, free list is damaged at ...
*** Incorrect guard value: ...

Environment variables

DISPLAY=/private/tmp/com.apple.launchd.Ho7Xi9pMTK/org.xquartz:0 EDITOR=emacs GROUP=unknown HOME=/Users/ken HOST=legospace HOSTTYPE=unknown IOCIN_ARGS= --format RGB8_PLANAR --useChromaticities 0 --ioSize 61440 --ioMethod 2 --ioMaxAsync 16 IODPX_ARGS= --format RGB8_PLANAR --useChromaticities 0 --ioSize 61440 --ioMethod 2 --ioMaxAsync 16 IOEXR_ARGS= --rgbaOnly 0 --inherit 1 --noOneChannel 0 --readWindowIsDisplayWindow 0 --readWindow 3 --planar3channel 0 --stripAlpha 0 --convertYRYBY 0 --ioSize 61440 --ioMethod 3 --ioMaxAsync 16 IOJPEG_ARGS= --ioSize 61440 --ioMethod 0 --ioMaxAsync 16 IOTARGA_ARGS= --ioSize 61440 --ioMethod 2 --ioMaxAsync 16 IOTIFF_ARGS= --ioSize 61440 --ioMethod 2 LANG=C LC_ALL=C LOGNAME=ken MACHTYPE=unknown MOVIEFFMPEG_ARGS= --defaultFPS 24 MOVIEMISTIKA_ARGS= --format RGB8_PLANAR MU_MODULE_PATH=/Users/ken/Library/Application Support/RV/Mu:/Library/Application Support/RV/Mu:/Applications/RV.app/Contents/PlugIns/Mu OCIO=/Users/ken/Downloads/ocio_issue/config.ocio OIIO_LIBRARY_PATH=/Users/ken/Library/Application Support/RV/OIIO:/Library/Application Support/RV/OIIO:/Applications/RV.app/Contents/PlugIns/OIIO:/Applications/RV.app/Contents/PlugIns/OIIO ORIGINALLOCAL=en_NZ.UTF-8 OSTYPE=darwin OTIO_PLUGIN_MANIFEST_PATH=/Applications/RV.app/Contents/PlugIns/Python/../SupportFiles/otio_reader/manifest.json PATH=/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/usr/local/munki:/usr/local/munkireport:/opt/puppetlabs/bin:/Library/Frameworks/Python.framework/Versions/3.12/bin/ PWD=/Users/ken/Downloads/ocio_issue PYTHONPATH=/Users/ken/Library/Application Support/RV/Python:/Users/ken/Library/Application Support/RV/MediaLibrary:/Library/Application Support/RV/Python:/Library/Application Support/RV/MediaLibrary:/Applications/RV.app/Contents/PlugIns/Python:/Applications/RV.app/Contents/PlugIns/MediaLibrary QT_MAC_WANTS_BEST_RESOLUTION_OPENGL_SURFACE=0 QT_QUICK_BACKEND=software RV_APP_GTO_REFERENCE= RV_APP_INIT=/Applications/RV.app/Contents/Resources/English.lproj/rvrc.mu RV_APP_LICENSES_NOTES= RV_APP_MANUAL= RV_APP_MANUAL_HTML= RV_APP_MU_MANUAL= RV_APP_PYINIT=/Applications/RV.app/Contents/Resources/English.lproj/rvrc.py RV_APP_REFERENCE_MANUAL= RV_APP_REFERENCE_MANUAL_HTML= RV_APP_RELEASE_NOTES= RV_APP_RV=/Applications/RV.app/Contents/MacOS/RV RV_APP_RVIO=/Applications/RV.app/Contents/MacOS/rvio RV_APP_RV_SHORT_NAME=RV RV_APP_SDI_MANUAL= RV_APP_SDI_MANUAL_HTML= RV_DARK=1 RV_OS_VERSION_MAJOR=10 RV_OS_VERSION_MINOR=19 RV_OS_VERSION_REVISION=0 RV_OTIO_CHECKSUM=PDpnQkVYVFw+UA4IaQBSDFU8AVoJFBFXSkI5A1hbBgk5bUJGPgdUTBBeblMJC1JSbT1ERDkRQA5EXFJuAVULBQ== RV_PYTHONPATH_EXTERNAL= RV_SHOTGUN_AUTH_ALLOW_TOGGLE=1 RV_SHOTGUN_DEFAULT_LOGIN= RV_SHOTGUN_DEFAULT_SERVER_URL=https://shotgun.wetafx.co.nz/ SGTK_DEFAULT_AUTH_METHOD=app_session_launcher SHELL=/bin/tcsh SHLVL=2 SHOTGUN_API_CACERTS=/tmp/.rv_ca_file.pem SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.uElpMljAUj/Listeners SSL_CERT_FILE=/Applications/RV.app/Contents/lib/python3.10/site-packages/certifi/cacert.pem TANK_CURRENT_PC=/Applications/RV.app/Contents/src/sgtk/baked/plugin/bundle_cache/baked/tk-config-rv/v2.1.0-rc1 TERM=xterm-256color TERM_PROGRAM=Apple_Terminal TERM_PROGRAM_VERSION=453 TERM_SESSION_ID=05E3B9E3-7ED1-4085-995A-795845424C0B TK_AUTH_PRODUCT=RV TK_RV_MODE_NAME=sgtk_bootstrap TMPDIR=/var/folders/9z/cc23rvc90b9g0lqtps2f558h00037j/T/ TWK_APP_SUPPORT_PATH=/Users/ken/Library/Application Support/RV:/Library/Application Support/RV:/Network/Library/Application Support/RV:/Applications/RV.app/Contents/PlugIns TWK_APP_VERSION=2024.1.0 TWK_FB_PLUGIN_PATH=/Users/ken/Library/Application Support/RV/ImageFormats:/Library/Application Support/RV/ImageFormats:/Applications/RV.app/Contents/PlugIns/ImageFormats TWK_MEDIA_LIBRARY_PLUGIN_PATH=/Users/ken/Library/Application Support/RV/MediaLibrary:/Library/Application Support/RV/MediaLibrary:/Applications/RV.app/Contents/PlugIns/MediaLibrary TWK_MOVIE_PLUGIN_PATH=/Users/ken/Library/Application Support/RV/MovieFormats:/Library/Application Support/RV/MovieFormats:/Applications/RV.app/Contents/PlugIns/MovieFormats TWK_NODE_PLUGIN_PATH=/Users/ken/Library/Application Support/RV/Nodes:/Library/Application Support/RV/Nodes:/Applications/RV.app/Contents/PlugIns/Nodes TWK_OUTPUT_PLUGIN_PATH=/Users/ken/Library/Application Support/RV/Output:/Library/Application Support/RV/Output:/Applications/RV.app/Contents/PlugIns/Output TWK_PROFILE_PLUGIN_PATH=/Users/ken/Library/Application Support/RV/Profiles:/Library/Application Support/RV/Profiles:/Applications/RV.app/Contents/PlugIns/Profiles TWK_RVIO_SETUP=10413 USER=ken VENDOR=apple XPC_FLAGS=0x0 XPC_SERVICENAME=0 =/Applications/RV.app/Contents/MacOS/RV.real CFBundleIdentifier=com.apple.Terminal CF_USER_TEXT_ENCODING=0xCF1:0x0:0x0 **** Build Info **** OS: DARWIN Arch: Compiler: AppleClang

Extra information

No response

Code of Conduct

kenmcgaugh commented 1 month ago

My c++ is very rusty, but I see in the OCIOIPNode::evaluate() method that the QMutexLocker objects are instantiated anonymously like this: QMutexLocker( &this->m_lock ); Googling "anonymous objects in c++" leads me to believe that this code is not working as expected and should instead be something like: QMutexLocker mylock( &this->m_lock );