Repository navigation
libobs: wait for the video thread in obs_wait_for_destroy_queue without audio (Fixes #5405) - #5407
Merged
Merged
Conversation
…nly cores (Refs #5405) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ut audio (Fixes #5405) tick_sources() holds a reference on every source while it ticks it. The wait synced with the video thread only when audio was reset too, so a video-only core could still see that reference after the wait. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Ci-Attestation: {"at":1795261934,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["48653f5779045f7e10772e2354374a1f41b28276"],"secs":93,"stamp":"c5eaf942897bcd1f422a8b60442d57b0","tree":"78315c16114b8b2751db1b35576f6a6c687c2cfc","v":1,"via":"run"} Ci-Attestation: {"at":1795261934,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["48653f5779045f7e10772e2354374a1f41b28276"],"secs":93,"stamp":"4ac391a4b3a8ffa02b13eacf8ab201e6","tree":"78315c16114b8b2751db1b35576f6a6c687c2cfc","v":1,"via":"run"} Ci-Attestation: {"at":1795261934,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["48653f5779045f7e10772e2354374a1f41b28276"],"secs":93,"stamp":"eaacf6d3920aba2708314cd2042ba21d","tree":"78315c16114b8b2751db1b35576f6a6c687c2cfc","v":1,"via":"run"} Ci-Attestation: {"at":1795261934,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["48653f5779045f7e10772e2354374a1f41b28276"],"secs":93,"stamp":"d5811bcbe181e0da0ca79998d7006d57","tree":"78315c16114b8b2751db1b35576f6a6c687c2cfc","v":1,"via":"run"} Ci-Attestation: {"at":1795261840,"gate":"general/all/client-lint","host":"linux-x86_64","key":"e6ff4ccf3bc027728b53e77c479a8a75244be240d81ee8e0e6eddcbb404d9486","lane":"client-lint","parents":["48653f5779045f7e10772e2354374a1f41b28276"],"secs":61,"stamp":"ed7d73df2c2ed43390f3ebd7572edf1a","tree":"78315c16114b8b2751db1b35576f6a6c687c2cfc","v":1,"via":"run"} Ci-Attestation: {"at":1795261934,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["48653f5779045f7e10772e2354374a1f41b28276"],"secs":93,"stamp":"79bdb662e897beb93107a44f8729a811","tree":"78315c16114b8b2751db1b35576f6a6c687c2cfc","v":1,"via":"run"} Ci-Attestation: {"at":1795261840,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"e6ff4ccf3bc027728b53e77c479a8a75244be240d81ee8e0e6eddcbb404d9486","lane":"client-lint","parents":["48653f5779045f7e10772e2354374a1f41b28276"],"secs":61,"stamp":"ffbf121a3632a4f4903cd377f05aa01b","tree":"78315c16114b8b2751db1b35576f6a6c687c2cfc","v":1,"via":"run"} Ci-Attestation: {"at":1795261840,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"e6ff4ccf3bc027728b53e77c479a8a75244be240d81ee8e0e6eddcbb404d9486","lane":"client-lint","parents":["48653f5779045f7e10772e2354374a1f41b28276"],"secs":61,"stamp":"2d95b536ca89b76741c1df08c6a35141","tree":"78315c16114b8b2751db1b35576f6a6c687c2cfc","v":1,"via":"run"} Ci-Attestation: {"at":1795261840,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"e6ff4ccf3bc027728b53e77c479a8a75244be240d81ee8e0e6eddcbb404d9486","lane":"client-lint","parents":["48653f5779045f7e10772e2354374a1f41b28276"],"secs":61,"stamp":"779ce90ec8b9fb2ca425681cf100882f","tree":"78315c16114b8b2751db1b35576f6a6c687c2cfc","v":1,"via":"run"} Ci-Attestation: {"at":1795261840,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"e6ff4ccf3bc027728b53e77c479a8a75244be240d81ee8e0e6eddcbb404d9486","lane":"client-lint","parents":["48653f5779045f7e10772e2354374a1f41b28276"],"secs":61,"stamp":"d372e982ea189c2a37622e233223cfda","tree":"78315c16114b8b2751db1b35576f6a6c687c2cfc","v":1,"via":"run"} Ci-Attestation: {"at":1795261840,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"e6ff4ccf3bc027728b53e77c479a8a75244be240d81ee8e0e6eddcbb404d9486","lane":"client-lint","parents":["48653f5779045f7e10772e2354374a1f41b28276"],"secs":61,"stamp":"f24c0742821c1e21c7cc94217a157976","tree":"78315c16114b8b2751db1b35576f6a6c687c2cfc","v":1,"via":"run"} Ci-Attestation: {"at":1795261840,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"e6ff4ccf3bc027728b53e77c479a8a75244be240d81ee8e0e6eddcbb404d9486","lane":"client-lint","parents":["48653f5779045f7e10772e2354374a1f41b28276"],"secs":61,"stamp":"3bcbf02ba45160a3584aa992397fac00","tree":"78315c16114b8b2751db1b35576f6a6c687c2cfc","v":1,"via":"run"} Ci-Attestation: {"at":1795261840,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"e6ff4ccf3bc027728b53e77c479a8a75244be240d81ee8e0e6eddcbb404d9486","lane":"client-lint","parents":["48653f5779045f7e10772e2354374a1f41b28276"],"secs":61,"stamp":"c73f6f7699227cb1dbcead3634832e86","tree":"78315c16114b8b2751db1b35576f6a6c687c2cfc","v":1,"via":"run"} Ci-Attestation: {"at":1795261840,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"e6ff4ccf3bc027728b53e77c479a8a75244be240d81ee8e0e6eddcbb404d9486","lane":"client-lint","parents":["48653f5779045f7e10772e2354374a1f41b28276"],"secs":61,"stamp":"09b7c0bbdf2d1ca79113d41023fa9537","tree":"78315c16114b8b2751db1b35576f6a6c687c2cfc","v":1,"via":"run"} Ci-Attestation: {"at":1795261840,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"e6ff4ccf3bc027728b53e77c479a8a75244be240d81ee8e0e6eddcbb404d9486","lane":"client-lint","parents":["48653f5779045f7e10772e2354374a1f41b28276"],"secs":61,"stamp":"77f27582b80884738c18f5b1b5e24da9","tree":"78315c16114b8b2751db1b35576f6a6c687c2cfc","v":1,"via":"run"} Ci-Attestation: {"at":1795261840,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"e6ff4ccf3bc027728b53e77c479a8a75244be240d81ee8e0e6eddcbb404d9486","lane":"client-lint","parents":["48653f5779045f7e10772e2354374a1f41b28276"],"secs":61,"stamp":"06d8ecf5626c0a90cfee6d47f3b7cfbc","tree":"78315c16114b8b2751db1b35576f6a6c687c2cfc","v":1,"via":"run"} Ci-Attestation: {"at":1795261840,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"e6ff4ccf3bc027728b53e77c479a8a75244be240d81ee8e0e6eddcbb404d9486","lane":"client-lint","parents":["48653f5779045f7e10772e2354374a1f41b28276"],"secs":61,"stamp":"9da33f7ea60f9450fe7066cf8f93cfde","tree":"78315c16114b8b2751db1b35576f6a6c687c2cfc","v":1,"via":"run"} Ci-Attestation: {"at":1795261840,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"e6ff4ccf3bc027728b53e77c479a8a75244be240d81ee8e0e6eddcbb404d9486","lane":"client-lint","parents":["48653f5779045f7e10772e2354374a1f41b28276"],"secs":61,"stamp":"862dfc946df5c7a75e018819ad42fb12","tree":"78315c16114b8b2751db1b35576f6a6c687c2cfc","v":1,"via":"run"} Ci-Attestation: {"at":1795262137,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"d2c80fc87f0aca35e6e4986b369363fb3168d152838ec71fcd4ef3d166353a71","lane":"client-test-x86_64-unknown-linux-gnu","parents":["48653f5779045f7e10772e2354374a1f41b28276"],"secs":202,"stamp":"afb7f6b6a0d69907724ca790869b1f69","tree":"78315c16114b8b2751db1b35576f6a6c687c2cfc","v":1,"via":"run"} Client-Checks: {"checks":{"base":"6bf1f673cbd5dde32e069bfec5135e17dd013c55","coverage":"all-tracked-applicable-files","diff":["libobs/obs.c.h","test/cmocka/test_destroy_queue_video_sync.c","test/cmocka/tests.d/test_destroy_queue_video_sync.cmake"],"head":"0bccf89bc8cfbf12d18d9ce18fbdafbc808c5a0c","tools":{"orchestrator-python":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.1.3 ]","schema-dependencies":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.1.3 ]\n{'jsonschema': '4.26.0', 'json_source_map': '1.0.5'}","uv":"uv 0.13.5 (x86_64-unknown-linux-gnu)","xmllint":"xmllint: using libxml version 21504-GITv2.15.4\n compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 DTDValid HTML C14N Catalog XPath XPointer XInclude Iconv ICU ISO8859X Regexps Automata RelaxNG Schemas Schematron Modules Debug Zlib"},"tracked-digest":"6143fda329ffd1d4f82a494e923e5ea31664f4805cc4de01b463eab882be688b","tree":"78315c16114b8b2751db1b35576f6a6c687c2cfc"}}
rdoupe
marked this pull request as ready for review
November 21, 2026 11:56
rdoupe
enabled auto-merge
November 21, 2026 12:15
This was referenced Nov 21, 2026
amsterdamboomer
pushed a commit
to amsterdamboomer/obs-studio
that referenced
this pull request
Nov 21, 2026
obs-rust#4800) (obs-rust#5413) Its failure (line 360: the old source still referenced after the test released it, then the cascade at line 378) was the video-only obs_wait_for_destroy_queue() race fixed by obs-rust#5407: the fixture resets video without audio, so the wait skipped the video thread and tick_sources() could still hold its tick reference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Ci-Attestation: {"at":1795267090,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["c0bf2355b1ecd3b440cec361233880788697e799"],"secs":94,"stamp":"6882c56d1c536618a8f52273b7c8251c","tree":"c9bd152da2beb9e4cd477c591bd6634490846245","v":1,"via":"run"} Ci-Attestation: {"at":1795267090,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["c0bf2355b1ecd3b440cec361233880788697e799"],"secs":94,"stamp":"9c4001d03ff7fb326d45a0a4c93017c5","tree":"c9bd152da2beb9e4cd477c591bd6634490846245","v":1,"via":"run"} Ci-Attestation: {"at":1795267090,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["c0bf2355b1ecd3b440cec361233880788697e799"],"secs":94,"stamp":"a9cda3d8ec5a5400d2c7b1ab1c13ef89","tree":"c9bd152da2beb9e4cd477c591bd6634490846245","v":1,"via":"run"} Ci-Attestation: {"at":1795267090,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["c0bf2355b1ecd3b440cec361233880788697e799"],"secs":94,"stamp":"261f31ec219cf87bbcaa7eb0119e2832","tree":"c9bd152da2beb9e4cd477c591bd6634490846245","v":1,"via":"run"} Ci-Attestation: {"at":1795266996,"gate":"general/all/client-lint","host":"linux-x86_64","key":"62a80741fe3d385360d0cc6fb0e1a85558c840b35762306960818cbec9290545","lane":"client-lint","parents":["c0bf2355b1ecd3b440cec361233880788697e799"],"secs":67,"stamp":"f4450303f13a11bcb8b6d65427003d50","tree":"c9bd152da2beb9e4cd477c591bd6634490846245","v":1,"via":"run"} Ci-Attestation: {"at":1795267090,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["c0bf2355b1ecd3b440cec361233880788697e799"],"secs":94,"stamp":"ec954ec998b35d01aca8c1e20ef4241c","tree":"c9bd152da2beb9e4cd477c591bd6634490846245","v":1,"via":"run"} Ci-Attestation: {"at":1795266996,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"62a80741fe3d385360d0cc6fb0e1a85558c840b35762306960818cbec9290545","lane":"client-lint","parents":["c0bf2355b1ecd3b440cec361233880788697e799"],"secs":67,"stamp":"f1bd2901f6ce7cf7bf3f4e0670fb04e1","tree":"c9bd152da2beb9e4cd477c591bd6634490846245","v":1,"via":"run"} Ci-Attestation: {"at":1795266996,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"62a80741fe3d385360d0cc6fb0e1a85558c840b35762306960818cbec9290545","lane":"client-lint","parents":["c0bf2355b1ecd3b440cec361233880788697e799"],"secs":67,"stamp":"73eaa3b56de14822a5e5cb3d8640704a","tree":"c9bd152da2beb9e4cd477c591bd6634490846245","v":1,"via":"run"} Ci-Attestation: {"at":1795266996,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"62a80741fe3d385360d0cc6fb0e1a85558c840b35762306960818cbec9290545","lane":"client-lint","parents":["c0bf2355b1ecd3b440cec361233880788697e799"],"secs":67,"stamp":"8feb7dc9d21ed472e82bf14ddc1b1ff1","tree":"c9bd152da2beb9e4cd477c591bd6634490846245","v":1,"via":"run"} Ci-Attestation: {"at":1795266996,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"62a80741fe3d385360d0cc6fb0e1a85558c840b35762306960818cbec9290545","lane":"client-lint","parents":["c0bf2355b1ecd3b440cec361233880788697e799"],"secs":67,"stamp":"b7d6396ff0f7ab5db941cf0927c57132","tree":"c9bd152da2beb9e4cd477c591bd6634490846245","v":1,"via":"run"} Ci-Attestation: {"at":1795266996,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"62a80741fe3d385360d0cc6fb0e1a85558c840b35762306960818cbec9290545","lane":"client-lint","parents":["c0bf2355b1ecd3b440cec361233880788697e799"],"secs":67,"stamp":"f77658c325404c9e36a315140ae46913","tree":"c9bd152da2beb9e4cd477c591bd6634490846245","v":1,"via":"run"} Ci-Attestation: {"at":1795266996,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"62a80741fe3d385360d0cc6fb0e1a85558c840b35762306960818cbec9290545","lane":"client-lint","parents":["c0bf2355b1ecd3b440cec361233880788697e799"],"secs":67,"stamp":"162beee1be7d659c18e67ce7fdbd5732","tree":"c9bd152da2beb9e4cd477c591bd6634490846245","v":1,"via":"run"} Ci-Attestation: {"at":1795266996,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"62a80741fe3d385360d0cc6fb0e1a85558c840b35762306960818cbec9290545","lane":"client-lint","parents":["c0bf2355b1ecd3b440cec361233880788697e799"],"secs":67,"stamp":"2f7e6db301c2774522f9e659fe4ebda6","tree":"c9bd152da2beb9e4cd477c591bd6634490846245","v":1,"via":"run"} Ci-Attestation: {"at":1795266996,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"62a80741fe3d385360d0cc6fb0e1a85558c840b35762306960818cbec9290545","lane":"client-lint","parents":["c0bf2355b1ecd3b440cec361233880788697e799"],"secs":67,"stamp":"809da28f6b4d4c75f69735aa5695feed","tree":"c9bd152da2beb9e4cd477c591bd6634490846245","v":1,"via":"run"} Ci-Attestation: {"at":1795266996,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"62a80741fe3d385360d0cc6fb0e1a85558c840b35762306960818cbec9290545","lane":"client-lint","parents":["c0bf2355b1ecd3b440cec361233880788697e799"],"secs":67,"stamp":"a52cf0e6ec33421e4d9c6138d78928e8","tree":"c9bd152da2beb9e4cd477c591bd6634490846245","v":1,"via":"run"} Ci-Attestation: {"at":1795266996,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"62a80741fe3d385360d0cc6fb0e1a85558c840b35762306960818cbec9290545","lane":"client-lint","parents":["c0bf2355b1ecd3b440cec361233880788697e799"],"secs":67,"stamp":"d77a433cd73ad0ab243f4e08c7d4cdfb","tree":"c9bd152da2beb9e4cd477c591bd6634490846245","v":1,"via":"run"} Ci-Attestation: {"at":1795266996,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"62a80741fe3d385360d0cc6fb0e1a85558c840b35762306960818cbec9290545","lane":"client-lint","parents":["c0bf2355b1ecd3b440cec361233880788697e799"],"secs":67,"stamp":"c2ba24c5d9e68dce1993842cde26ff1c","tree":"c9bd152da2beb9e4cd477c591bd6634490846245","v":1,"via":"run"} Ci-Attestation: {"at":1795266996,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"62a80741fe3d385360d0cc6fb0e1a85558c840b35762306960818cbec9290545","lane":"client-lint","parents":["c0bf2355b1ecd3b440cec361233880788697e799"],"secs":67,"stamp":"977bf69b08e5eb900831112e38b2a54a","tree":"c9bd152da2beb9e4cd477c591bd6634490846245","v":1,"via":"run"} Ci-Attestation: {"at":1795267305,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"4c28bab027efbecd5ff4ca7a50f69be0d32d875847ec1c8e6e4553eea6deb95f","lane":"client-test-x86_64-unknown-linux-gnu","parents":["c0bf2355b1ecd3b440cec361233880788697e799"],"secs":214,"stamp":"520c5fda3c6a907cccd2b44373411d76","tree":"c9bd152da2beb9e4cd477c591bd6634490846245","v":1,"via":"run"} Client-Checks: {"checks":{"base":"c0bf2355b1ecd3b440cec361233880788697e799","coverage":"all-tracked-applicable-files","diff":["test/cmocka/known-flaky.txt"],"head":"fa2bc50a585615262e632a398cf39cbd1d059540","tools":{"orchestrator-python":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.1.3 ]","schema-dependencies":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.1.3 ]\n{'jsonschema': '4.26.0', 'json_source_map': '1.0.5'}","uv":"uv 0.13.5 (x86_64-unknown-linux-gnu)","xmllint":"xmllint: using libxml version 21504-GITv2.15.4\n compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 DTDValid HTML C14N Catalog XPath XPointer XInclude Iconv ICU ISO8859X Regexps Automata RelaxNG Schemas Schematron Modules Debug Zlib"},"tracked-digest":"54fec83d2e7d034fbd5a560ff3ab36d8a5721fcec89aff97accb0bf3d38b4b80","tree":"c9bd152da2beb9e4cd477c591bd6634490846245"}}
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.
Fixes #5405
obs_wait_for_destroy_queue()synced with the video thread only when audio had been reset too.tick_sources()holds a reference on every source (private ones included) while it ticks it, so on a video-only core a caller could release a source, wait, and still find the source alive. That is the master push failure after #5356:test_scene_item_transition_serialization_lifetime.c:107: obs_weak_source_expired(old) is not true(https://github.com/obs-rust/obs-studio/actions/runs/44895576535), in a test that merge didn't touch. 26 cmocka fixtures reset video without audio and use this wait.The fix waits for the graphics task whenever the video thread runs, and for the audio task whenever audio exists, as two separate checks. A full OBS session (video and audio) waits for both, as before.
Evidence
RED (
48653f577, newtest/cmocka/test_destroy_queue_video_sync.c): a private source'svideo_tickblocks while the test drops its own reference, then the test waits for the destroy queue and checks the weak reference.The
assert_false(obs_weak_source_expired(weak))just before it passed, so the tick really was holding the reference.GREEN (
d1a3e6166):./lintpasses.🤖 Generated with Claude Code