Repository navigation
test: wait for the tick before reading a transition child's weak ref (Fixes #4680) - #5423
Merged
Merged
Conversation
…ixes #4680) clear_empties_both_slots, and the release checks after it, read a child's weak reference right after the transition dropped its own references. The video thread's tick_sources() holds a reference on every source while it ticks, so for a moment the weak reference still yields the child, in the C reference as much as in hybrid libobs. child_alive() now waits for the destroy queue, which waits a video tick, before it reads the weak reference. No assertion changes. The test leaves known-flaky.txt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Ci-Attestation: {"at":1795304365,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["a98b199d3fc02ef274f861915dea5aecbdd448f0"],"secs":62,"stamp":"55a56e6d5f19c5419bc76a6fb41c4912","tree":"a419528ebd54eb2dc5f54b11d97d78fb5c1c0c1c","v":1,"via":"run"} Ci-Attestation: {"at":1795304365,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["a98b199d3fc02ef274f861915dea5aecbdd448f0"],"secs":62,"stamp":"debba485abded9cd5170899fa4556d82","tree":"a419528ebd54eb2dc5f54b11d97d78fb5c1c0c1c","v":1,"via":"run"} Ci-Attestation: {"at":1795304365,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["a98b199d3fc02ef274f861915dea5aecbdd448f0"],"secs":62,"stamp":"11cdcd9d52004202ddf9d21cbe59e57e","tree":"a419528ebd54eb2dc5f54b11d97d78fb5c1c0c1c","v":1,"via":"run"} Ci-Attestation: {"at":1795304365,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["a98b199d3fc02ef274f861915dea5aecbdd448f0"],"secs":62,"stamp":"c77fdcaa9906373e023354a67127de81","tree":"a419528ebd54eb2dc5f54b11d97d78fb5c1c0c1c","v":1,"via":"run"} Ci-Attestation: {"at":1795304302,"gate":"general/all/client-lint","host":"linux-x86_64","key":"f089c493d3f9daeb469d75e67aafeaf864ec955661e74b71079464de87e4bc63","lane":"client-lint","parents":["a98b199d3fc02ef274f861915dea5aecbdd448f0"],"secs":10,"stamp":"e5de443586137046280a8a79631d8ac3","tree":"a419528ebd54eb2dc5f54b11d97d78fb5c1c0c1c","v":1,"via":"run"} Ci-Attestation: {"at":1795304365,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["a98b199d3fc02ef274f861915dea5aecbdd448f0"],"secs":62,"stamp":"029de4dc69bb75597b107aad3d4d2119","tree":"a419528ebd54eb2dc5f54b11d97d78fb5c1c0c1c","v":1,"via":"run"} Ci-Attestation: {"at":1795304302,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"f089c493d3f9daeb469d75e67aafeaf864ec955661e74b71079464de87e4bc63","lane":"client-lint","parents":["a98b199d3fc02ef274f861915dea5aecbdd448f0"],"secs":10,"stamp":"58bc1175d37e12e14f3f88d55a36e9a7","tree":"a419528ebd54eb2dc5f54b11d97d78fb5c1c0c1c","v":1,"via":"run"} Ci-Attestation: {"at":1795304302,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"f089c493d3f9daeb469d75e67aafeaf864ec955661e74b71079464de87e4bc63","lane":"client-lint","parents":["a98b199d3fc02ef274f861915dea5aecbdd448f0"],"secs":10,"stamp":"1462995ae31575e9a090da7621cda315","tree":"a419528ebd54eb2dc5f54b11d97d78fb5c1c0c1c","v":1,"via":"run"} Ci-Attestation: {"at":1795304302,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"f089c493d3f9daeb469d75e67aafeaf864ec955661e74b71079464de87e4bc63","lane":"client-lint","parents":["a98b199d3fc02ef274f861915dea5aecbdd448f0"],"secs":10,"stamp":"59b33d55f430541102faa4bdfd9f8666","tree":"a419528ebd54eb2dc5f54b11d97d78fb5c1c0c1c","v":1,"via":"run"} Ci-Attestation: {"at":1795304302,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"f089c493d3f9daeb469d75e67aafeaf864ec955661e74b71079464de87e4bc63","lane":"client-lint","parents":["a98b199d3fc02ef274f861915dea5aecbdd448f0"],"secs":10,"stamp":"f5abe306e39f11fc5ad67bc089b082d9","tree":"a419528ebd54eb2dc5f54b11d97d78fb5c1c0c1c","v":1,"via":"run"} Ci-Attestation: {"at":1795304302,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"f089c493d3f9daeb469d75e67aafeaf864ec955661e74b71079464de87e4bc63","lane":"client-lint","parents":["a98b199d3fc02ef274f861915dea5aecbdd448f0"],"secs":10,"stamp":"20ee1c20cd66fdc0c5b9c5c81eb96874","tree":"a419528ebd54eb2dc5f54b11d97d78fb5c1c0c1c","v":1,"via":"run"} Ci-Attestation: {"at":1795304302,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"f089c493d3f9daeb469d75e67aafeaf864ec955661e74b71079464de87e4bc63","lane":"client-lint","parents":["a98b199d3fc02ef274f861915dea5aecbdd448f0"],"secs":10,"stamp":"ea2eef36c07bfd13083c5b4c1e4eaa19","tree":"a419528ebd54eb2dc5f54b11d97d78fb5c1c0c1c","v":1,"via":"run"} Ci-Attestation: {"at":1795304302,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"f089c493d3f9daeb469d75e67aafeaf864ec955661e74b71079464de87e4bc63","lane":"client-lint","parents":["a98b199d3fc02ef274f861915dea5aecbdd448f0"],"secs":10,"stamp":"1f970a38ccceceac6eb9dec4d288befc","tree":"a419528ebd54eb2dc5f54b11d97d78fb5c1c0c1c","v":1,"via":"run"} Ci-Attestation: {"at":1795304302,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"f089c493d3f9daeb469d75e67aafeaf864ec955661e74b71079464de87e4bc63","lane":"client-lint","parents":["a98b199d3fc02ef274f861915dea5aecbdd448f0"],"secs":10,"stamp":"82c65e5e1a29471505557adbc49c19c0","tree":"a419528ebd54eb2dc5f54b11d97d78fb5c1c0c1c","v":1,"via":"run"} Ci-Attestation: {"at":1795304302,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"f089c493d3f9daeb469d75e67aafeaf864ec955661e74b71079464de87e4bc63","lane":"client-lint","parents":["a98b199d3fc02ef274f861915dea5aecbdd448f0"],"secs":10,"stamp":"365c0e0cf62590f481e3604e58a5cb01","tree":"a419528ebd54eb2dc5f54b11d97d78fb5c1c0c1c","v":1,"via":"run"} Ci-Attestation: {"at":1795304302,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"f089c493d3f9daeb469d75e67aafeaf864ec955661e74b71079464de87e4bc63","lane":"client-lint","parents":["a98b199d3fc02ef274f861915dea5aecbdd448f0"],"secs":10,"stamp":"79eb920491b21c725e93e0dc70365de9","tree":"a419528ebd54eb2dc5f54b11d97d78fb5c1c0c1c","v":1,"via":"run"} Ci-Attestation: {"at":1795304302,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"f089c493d3f9daeb469d75e67aafeaf864ec955661e74b71079464de87e4bc63","lane":"client-lint","parents":["a98b199d3fc02ef274f861915dea5aecbdd448f0"],"secs":10,"stamp":"6351dbdf41c697a1d229fd863177eeaa","tree":"a419528ebd54eb2dc5f54b11d97d78fb5c1c0c1c","v":1,"via":"run"} Ci-Attestation: {"at":1795304302,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"f089c493d3f9daeb469d75e67aafeaf864ec955661e74b71079464de87e4bc63","lane":"client-lint","parents":["a98b199d3fc02ef274f861915dea5aecbdd448f0"],"secs":10,"stamp":"6a96256539a3f516855afcc7b027fa4c","tree":"a419528ebd54eb2dc5f54b11d97d78fb5c1c0c1c","v":1,"via":"run"} Ci-Attestation: {"at":1795304620,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"83d18f14c6b1183d10f8c95e36bf13bfaa7165a4b90d1a8c05e4a84c383c5fd5","lane":"client-test-x86_64-unknown-linux-gnu","parents":["a98b199d3fc02ef274f861915dea5aecbdd448f0"],"secs":254,"stamp":"2566aac9c4baa0007fa0fd669178196a","tree":"a419528ebd54eb2dc5f54b11d97d78fb5c1c0c1c","v":1,"via":"run"} Client-Checks: {"checks":{"base":"a98b199d3fc02ef274f861915dea5aecbdd448f0","coverage":"all-tracked-applicable-files","diff":["test/cmocka/known-flaky.txt","test/cmocka/test_source_transition_slots.c"],"head":"bb76d1872744bcec596c147a19231d30b3b94230","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":"e8576160b41d297ecc90fb3f53c471870f28f9d38d7a4563feca566ccf298285","tree":"a419528ebd54eb2dc5f54b11d97d78fb5c1c0c1c"}}
|
Claim conflict: keep this PR out of the merge queue until resolved.
|
Member
rdoupe
marked this pull request as ready for review
November 22, 2026 00:20
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 #4680. Approved on the issue: add only the wait, change and remove no assertion, and drop the test from
known-flaky.txt.child_alive()read a child's weak reference right afterobs_transition_clear()(or the transition's release) dropped the transition's own references. The video thread'stick_sources()keeps its own reference on every source while it ticks, so for a moment the weak reference still gave back the child. This happens in the C reference too; it is how upstream libobs behaves, not a port bug.child_alive()now callsobs_wait_for_destroy_queue()first. Since #5407 that waits for a video tick even with no audio running, the same wait used for #4800.RED (C reference, test unchanged)
Two local-only delays, neither committed:
os_sleep_ms(30)intick_sources()right after it takes its source references (libobs/obs-video.c.h), andos_sleep_ms(40)inclear_empties_both_slotsbeforeobs_transition_clear().(Line 246 is line 245 plus the delay line.) The 30 ms tick delay also fails some timing-bound tests (deinterlace field order, async rotation). They fail the same way with and without this fix.
GREEN
Same two delays plus this change, same command:
Without the delays, both builds, full suite then 100 repeats:
./lintpasses.🤖 Generated with Claude Code