fix: SG-42334: Fix random crashes involving SoundTrackIPNode#1152
Merged
bernie-laberge merged 1 commit intoAcademySoftwareFoundation:mainfrom Mar 6, 2026
Conversation
a338bec to
0d20272
Compare
cedrik-fuoco-adsk
approved these changes
Feb 27, 2026
eloisebrosseau
approved these changes
Feb 27, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes random crashes in SoundTrackIPNode by adding synchronization around waveform framebuffer (m_fb) usage and by centralizing the default audio packet size into a shared constant.
Changes:
- Add mutex protection around
m_fballocation/restructure/clearing and re-checkm_fbunder lock before dereference inevaluateAudioTexture(). - Introduce
TWEAK_AUDIO_DEFAULT_PACKET_SIZE(2048) and replace hardcoded packet-size defaults across audio/cache/movie components. - Update
IPGraphto use the shared default packet size instead of platform-specific hardcoded defaults.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/lib/ip/IPCore/SoundTrackIPNode.cpp | Adds locking around framebuffer access/clear and re-checks m_fb before creating the waveform IPImage. |
| src/lib/ip/IPCore/IPGraph.cpp | Uses TWEAK_AUDIO_DEFAULT_PACKET_SIZE for m_audioPacketSize and includes TwkAudio/Audio.h. |
| src/lib/image/MovieRV_FBO/MovieRV_FBO/MovieRV_FBO.h | Replaces default audioPacketSize argument with TWEAK_AUDIO_DEFAULT_PACKET_SIZE. |
| src/lib/image/MovieRV_FBO/MovieRV_FBO.cpp | Updates member default m_audioPacketSize to TWEAK_AUDIO_DEFAULT_PACKET_SIZE. |
| src/lib/image/MovieRV/MovieRV/MovieRV.h | Replaces default audioPacketSize argument with TWEAK_AUDIO_DEFAULT_PACKET_SIZE. |
| src/lib/image/MovieRV/MovieRV.cpp | Updates member default m_audioPacketSize to TWEAK_AUDIO_DEFAULT_PACKET_SIZE. |
| src/lib/audio/TwkAudio/TwkAudio/Audio.h | Defines and documents TWEAK_AUDIO_DEFAULT_PACKET_SIZE (2048). |
| src/lib/audio/TwkAudio/AudioCache.cpp | Uses TWEAK_AUDIO_DEFAULT_PACKET_SIZE as the default cache packet size. |
Signed-off-by: Bernard Laberge <bernard.laberge@autodesk.com>
0d20272 to
e4613e0
Compare
75bfcc7
into
AcademySoftwareFoundation:main
20 checks passed
eloisebrosseau
pushed a commit
to eloisebrosseau/OpenRV
that referenced
this pull request
Apr 1, 2026
…SoftwareFoundation#1152) ### fix: SG-42334: Fix random crashes involving SoundTrackIPNode ### Linked issues NA ### Summarize your change. - Fixed race conditions in SoundTrackIPNode that caused random crashes due to unsynchronized access to m_fb across threads. - evaluateAudioTexture() now uses a short lock-around-read pattern to safely snapshot m_fb before use, and re-checks it under lock before dereferencing to construct the IPImage — guarding against propertyChanged() clearing m_fb on the main thread between the two access points. - propertyChanged() now acquires m_fblock before allocating or restructuring m_fb, preventing data races during waveform texture resize. - clearFB() now acquires m_fblock for the duration of the pixel clear and stats reset, making it fully thread-safe. Root Cause m_fb (the waveform framebuffer) was read and written from multiple threads without synchronization. evaluateAudioTexture() ran on the audio/render thread while propertyChanged() and clearFB() ran on the main thread. A m_fb pointer that was valid at the check could be freed mid-use, leading to use-after-free crashes. ### Describe the reason for the change. Random crashes had been reported originating from SoundTrackIPNode. ### Describe what you have tested and on which operating system. Successfully tested on macOS. Test Plan - Enable the Timeline Magnifier via the RV/Tools/Timeline Magnifier menu - Load media that contains audio - Play media with audio waveform display enabled and rapidly scrub / resize the timeline — no crash - Trigger property changes (e.g., resize the waveform panel) during active audio playback — no crash ### Add a list of changes, and note any that might need special attention during the review. ### If possible, provide screenshots. Signed-off-by: Bernard Laberge <bernard.laberge@autodesk.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: SG-42334: Fix random crashes involving SoundTrackIPNode
Linked issues
NA
Summarize your change.
IPImage — guarding against propertyChanged() clearing m_fb on the main thread between the two access points.
Root Cause
m_fb (the waveform framebuffer) was read and written from multiple threads without synchronization. evaluateAudioTexture() ran on the audio/render thread while
propertyChanged() and clearFB() ran on the main thread. A m_fb pointer that was valid at the check could be freed mid-use, leading to use-after-free crashes.
Describe the reason for the change.
Random crashes had been reported originating from SoundTrackIPNode.
Describe what you have tested and on which operating system.
Successfully tested on macOS.
Test Plan
Add a list of changes, and note any that might need special attention during the review.
If possible, provide screenshots.