Skip to content

libobs: obs_scene_enum_items must not walk items removed by its callback - #708

Merged
zackees merged 2 commits into
masterfrom
fix/490-scene-enum-remove
Oct 14, 2026
Merged

zackees merged 2 commits into
masterfrom
fix/490-scene-enum-remove

Conversation

@zackees

@zackees zackees commented Oct 14, 2026

Copy link
Copy Markdown
Member

Fixes #490

obs_scene_enum_items now takes a reference on every item under the scene lock, walks that snapshot, and skips items removed or no longer in the scene's list. Items added by the callback during a walk are no longer visited by it. obs-scene.c is not ported to Rust, so there is no Rust counterpart.

Test and fix are adapted from chriscoveries' fork branch fix/scene-enum-items-removal (released on #490); the test registration now runs under xvfb-run on Linux.

RED (a2dae06, rust/tools/linux-validate/run.sh, OFF): test_scene_enum_items_removal failed 5 of 11 cases: remove_next_item_held_by_caller, remove_next_item, remove_two_adjacent_items, snapshot_references_are_released, removal_signal_reentry_skips_removed_item (6 passed).

GREEN (6623656): run.sh passes OFF and ON, 199/199 each, test_scene_enum_items_removal passed in both, exported symbols IDENTICAL (1766). ./lint ok. ci-lint local-gate run passed (lint, rust-test, cross, tier2-linux) and the head is stamped.

Not run: ASan or TSan builds.

Refs #490. Test adapted from chriscoveries' fork branch.
Fixes #490.

Local-Gate: v1 tree=327cf15db9f834b2c2f0fcf9ddaa4599efb16645 secs=449 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run
Ci-Attestation: {"at":1791963907,"gate":"rust/all/fmt","host":"linux-x86_64","key":"b819184bfb28f89a86824e42fae50076e02e85dcdf107592251d2bc04d4f4422","lane":"lint","parents":["a2dae06bfe91daefabf04b9a904ec128d87622b1"],"secs":29,"stamp":"7ca17bcfd57c8ac1e01e1eaad84e671b","tree":"327cf15db9f834b2c2f0fcf9ddaa4599efb16645","v":1,"via":"run"}
Ci-Attestation: {"at":1791963907,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"b819184bfb28f89a86824e42fae50076e02e85dcdf107592251d2bc04d4f4422","lane":"lint","parents":["a2dae06bfe91daefabf04b9a904ec128d87622b1"],"secs":29,"stamp":"e88172a524f729bdd2281c81c44d30e0","tree":"327cf15db9f834b2c2f0fcf9ddaa4599efb16645","v":1,"via":"run"}
Ci-Attestation: {"at":1791963907,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"fb2f730680a775a6a9de86f9cd5de24715d7717182f69015002f8bb2e342bbb3","lane":"rust-test","parents":["a2dae06bfe91daefabf04b9a904ec128d87622b1"],"secs":143,"stamp":"5708bd05c3edfb8d6d570297e6e5ebe4","tree":"327cf15db9f834b2c2f0fcf9ddaa4599efb16645","v":1,"via":"run"}
Ci-Attestation: {"at":1791963907,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"95f69ef4d01561d7d64e403902de295e6dbf459f29f473e586919d71553149d0","lane":"cross","parents":["a2dae06bfe91daefabf04b9a904ec128d87622b1"],"secs":117,"stamp":"6832ea27acb0146e98f9b41da8173ec3","tree":"327cf15db9f834b2c2f0fcf9ddaa4599efb16645","v":1,"via":"run"}
Ci-Attestation: {"at":1791963907,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"95f69ef4d01561d7d64e403902de295e6dbf459f29f473e586919d71553149d0","lane":"cross","parents":["a2dae06bfe91daefabf04b9a904ec128d87622b1"],"secs":117,"stamp":"ff29b932deb009f0ff2adc0947c79b91","tree":"327cf15db9f834b2c2f0fcf9ddaa4599efb16645","v":1,"via":"run"}
Ci-Attestation: {"at":1791963907,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"95f69ef4d01561d7d64e403902de295e6dbf459f29f473e586919d71553149d0","lane":"cross","parents":["a2dae06bfe91daefabf04b9a904ec128d87622b1"],"secs":117,"stamp":"b35a332ff5f36af31aa6a1c6a00eda7b","tree":"327cf15db9f834b2c2f0fcf9ddaa4599efb16645","v":1,"via":"run"}
Ci-Attestation: {"at":1791963907,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"95f69ef4d01561d7d64e403902de295e6dbf459f29f473e586919d71553149d0","lane":"cross","parents":["a2dae06bfe91daefabf04b9a904ec128d87622b1"],"secs":117,"stamp":"7b8cd438d37644d35604605a3d23eae8","tree":"327cf15db9f834b2c2f0fcf9ddaa4599efb16645","v":1,"via":"run"}
Ci-Attestation: {"at":1791963907,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"95f69ef4d01561d7d64e403902de295e6dbf459f29f473e586919d71553149d0","lane":"cross","parents":["a2dae06bfe91daefabf04b9a904ec128d87622b1"],"secs":117,"stamp":"5444ac672730a515378d70d2505a01d3","tree":"327cf15db9f834b2c2f0fcf9ddaa4599efb16645","v":1,"via":"run"}
Ci-Attestation: {"at":1791963907,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"95f69ef4d01561d7d64e403902de295e6dbf459f29f473e586919d71553149d0","lane":"cross","parents":["a2dae06bfe91daefabf04b9a904ec128d87622b1"],"secs":117,"stamp":"dd5b47d757fcef3f55375518de4490a2","tree":"327cf15db9f834b2c2f0fcf9ddaa4599efb16645","v":1,"via":"run"}
Ci-Attestation: {"at":1791963907,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"2ecc8f131673aa9e07342176e01f6d1b71a9d65ea3c7718116edf8feacc47138","lane":"tier2-linux","parents":["a2dae06bfe91daefabf04b9a904ec128d87622b1"],"secs":159,"stamp":"67b49b053dd4e818fc221bdbe8a82131","tree":"327cf15db9f834b2c2f0fcf9ddaa4599efb16645","v":1,"via":"run"}
@zackees

zackees commented Oct 14, 2026

Copy link
Copy Markdown
Member Author

Builds on @chriscoveries' released branch fix/scene-enum-items-removal (#490): the test and fix are theirs, re-applied onto current master; the only test change is running it under xvfb-run. Note one behaviour change for reviewers: items a callback adds during obs_scene_enum_items are no longer visited by that same walk (it walks a referenced snapshot).

@zackees
zackees merged commit 9d5e8b9 into master Oct 14, 2026
21 checks passed
@zackees
zackees deleted the fix/490-scene-enum-remove branch October 26, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug: libobs: obs_scene_enum_items walks a released item when its callback removes a later item

1 participant