Skip to content

fix: 20 bug fixes in libobs callbacks, muxer, audio and build - #1464

Closed
zackees wants to merge 20 commits into
masterfrom
bugfix/sol-next20
Closed

zackees wants to merge 20 commits into
masterfrom
bugfix/sol-next20

Conversation

@zackees

@zackees zackees commented Oct 19, 2026

Copy link
Copy Markdown
Member

See table below — fixes on bugfix/sol-next20.

Generated by an autonomous codex (gpt-6.1-sol) run under clud on 2026-10-19, sequentially: locate defect -> minimal fix -> RED/GREEN regression evidence -> commit. Commit structure and branch hygiene (master untouched, nothing else pushed) were verified independently; the test results in the table below are the agent's self-reported observations and need human review before merge. Clippy and heavy CMake builds were not part of this run.


Committed exactly 20 bugs, one commit per bug, on bugfix/sol-next20.

Every fix has observed RED → GREEN evidence. C harnesses isolate production code with mocked dependencies unless noted. Logs and harnesses are in /tmp/obs-next20.

# Commit File:line What was wrong Fix Test evidence
1 94e546b01 libobs/callback/calldata.c.h:133; rust/obs-callback/src/calldata.rs:406 Exactly fitting fixed buffers rejected parameters Accept capacity equality C/Rust RED → GREEN; callback suite 55 passed
2 802bc7846 libobs/callback/signal.c.h:359 Deferred callback removal leaked the final handler reference Atomically decrement and destroy at zero Allocation-counting C harness
3 11a406238 libobs/callback/signal.c.h:367 Global callback lookup included mutable signaling state Match function and data Self-disconnect harness
4 89522e684 plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c.h:790 Seek callback returned zero for successful and unsupported seeks Return position; reject invalid seeks Absolute/relative/forced/error seek harness
5 f56808a3c frontend/utility/RemuxQueueModel.cpp.hpp:315 Row notifications exposed incorrect processing state Change state between begin/end notifications Real Qt notification test
6 eeb659ae5 plugins/obs-outputs/null-output.c.h:60 Completed stop threads became unjoinable through bookkeeping Preserve flag until joined Deterministic lifecycle harness
7 dc8e7861b plugins/obs-ffmpeg/obs-ffmpeg-video-encoders.c.h:160 Missing-encoder error used uninitialized string storage Zero-initialize dstr Patterned-stack failure-path harness
8 6a3526ffb ci/msvc_flags.py:48 An OR condition could incorrectly suppress MSVC warning checks Check every alternative Probe plus 14 Python tests
9 68677e2cb plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c.h:161 Failed file setup dereferenced an absent AVIO context Guard cleanup Failed-setup C harness
10 77e80f6d4 libobs/callback/signal.c.h:305 Nested signals lost the outer active callback Save/restore callback context Nested-emission harness
11 aebd3ff57 plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c.h:1187 Packet failures exited successfully Return failure status Packet-error harness
12 b17ca0805 libobs/callback/signal.c.h:316 Recursive delivery removed entries while outer iteration continued Defer removal until outermost delivery finishes Recursive-delivery harness
13 17bd7a645 frontend/utility/RemuxQueueModel.cpp.hpp:237 Change notifications contained invalid endpoint indexes Use valid inclusive bounds Real Qt range test
14 fc0c077d3 libobs/callback/signal.c.h:275 Registration invalidated the active callback pointer Track stable signal/index context ASan registration and immediate-removal tests
15 469777bea plugins/linux-jack/jack-input.c.h:74 Prefixed/unprefixed name comparison restarted unchanged capture Compare source-name portions Repeated-update harness
16 c3fc487d0 plugins/linux-jack/jack-wrapper.c.h:84 Timestamp fallback divided by an uninitialized zero rate Use current server rate Clock-failure harness
17 e5a7d66b4 plugins/linux-v4l2/v4l2-output.c.h:306 Short writes resent the entire frame Advance pointer and remaining count Partial-write harness
18 56e17a6d4 plugins/linux-alsa/alsa-input.c.h:395 Worker startup overwrote an early stop request Publish run state before creation; check before reading Deterministic early-stop harness
19 d531c88f1 plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c.h:1110 Failed split setup left temporary storage owned by argv, causing Windows double-free cleanup Restore argument on failure Failed-split ownership harness
20 16b07d829 plugins/obs-ffmpeg/obs-ffmpeg-output.c.h:1220 Fast worker completion left connection state stuck active Publish state before starting worker Fast-completion scheduling harness

Final checks: 89 Rust core tests passed, 14 Python tests passed, both Qt checks passed, C harnesses passed, and pinned clang-format plus rustfmt checks passed.

Known failures: unchanged C calldata characterization tests report 9 passed, 2 failed because two assertions explicitly expect the exact-fit behavior fixed by #1. Those tests remain untouched.

Unverified: full application/plugin builds, full Tier 2 and ABI checks, clippy/Dylint, live devices, Windows/macOS execution, and end-to-end application behavior.

Branch is 20 commits ahead of origin/master. Only the original dirty plugins/obs-websocket submodule remains in working-tree status; its committed pointer and local master are unchanged. No pushes, PRs, or merges.

@zackees
zackees enabled auto-merge October 19, 2026 22:11
@zackees

zackees commented Oct 19, 2026

Copy link
Copy Markdown
Member Author

Coordinator: Tier 2 Linux (ON and OFF) fails in the cmocka characterization tests merged today: test_calldata (exact_capacity_grows_test l.301, fixed_stack_test l.473) and test_signal (nested_signal_test l.373, global_remove_test l.488). Those tests pin current C behavior, with some cases marked "characterized, not endorsed" (#1447, #1457), and the callback fixes here change exactly those cases, in C too, since the OFF lane fails.

That's a policy call ("never edit existing C tests" vs. fixing a bug they pin), so I've left it for you: either update the pinned expectations in the same PR, saying it's a deliberate fix, or split those fixes out. Auto-merge stays on.

@zackees

zackees commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

Coordinator analysis and recommendation: split, then close this PR; don't rebase it as a bundle.

Bundling these means editing C tests inside a 20-fix PR, which AGENTS.md rules out, and #1462 was closed for the same shape.

@zackees

zackees commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

Split into ten PRs, each with an in-repo RED test then the fix (see the plan above):

Closing this bundle in favour of those.

@zackees zackees closed this Oct 20, 2026
auto-merge was automatically disabled October 20, 2026 20:22

Pull request was closed

chriscoveries pushed a commit to chriscoveries/obsrust-fork that referenced this pull request Oct 20, 2026
…1464) (obs-rust#1552)

* test: Expect fixed and growable calldata buffers to accept an exact fit

Supersedes the characterization in exact_capacity_grows_test and
fixed_stack_test (C and Rust): a write whose needed size equals the
capacity fits, because needed already includes the terminator.
Split from obs-rust#1464.

* fix: Accept exact fits in fixed calldata buffers

cd_ensure_capacity grew (or, for a fixed stack, refused) when the needed
size equaled capacity. Use <= in the C and the Rust port.
Split from obs-rust#1464 (72a2e4e).
chriscoveries pushed a commit to chriscoveries/obsrust-fork that referenced this pull request Oct 20, 2026
…e worker (split from obs-rust#1464) (obs-rust#1554)

* test: FFmpeg missing-encoder error storage and output connecting state (RED)

Split from obs-rust#1464. Fails on master: ffmpeg_video_encoder_init() prints into an
uninitialized dstr, and ffmpeg_output_start() overwrites connecting after a
worker that already finished cleared it.

* fix: FFmpeg missing-encoder error storage and output connecting state (GREEN)

Split from obs-rust#1464 (commits 1b534db, c79ee27):
- ffmpeg_video_encoder_init() zero-initializes its error dstr;
- ffmpeg_output_start() sets connecting before creating the worker and
  clears it only when creation fails.
chriscoveries pushed a commit to chriscoveries/obsrust-fork that referenced this pull request Oct 20, 2026
… use the server rate (Refs obs-rust#1464) (obs-rust#1557)

* test: linux-jack: unchanged updates keep the client; fallback timestamps use the server rate (RED)

Refs obs-rust#1464

* fix: compare JACK source names without the client prefix

* fix: use the JACK server rate for fallback audio timestamps
chriscoveries pushed a commit to chriscoveries/obsrust-fork that referenced this pull request Oct 20, 2026
…bs-rust#1464) (obs-rust#1558)

* test: linux-v4l2: virtual camera writes continue after short writes (RED)

Refs obs-rust#1464

* fix: advance virtual camera buffers after partial writes
chriscoveries pushed a commit to chriscoveries/obsrust-fork that referenced this pull request Oct 20, 2026
) (obs-rust#1560)

* test: obs-outputs: the null output joins completed stop threads (RED)

Refs obs-rust#1464

* fix: join completed null output stop threads
zackees added a commit that referenced this pull request Oct 20, 2026
… argv (RED)

Split from #1464. Fails on master: the seek callback returns 0, free_avformat
dereferences a NULL pb after a failed open, main returns 0 after a packet
error, and read_change_file leaves argv[1] on its own buffer on failure.
zackees added a commit that referenced this pull request Oct 20, 2026
…nd split argv (GREEN)

Split from #1464 (commits ab56688, cd07703, eadd067, ce1d1ff):
- the AVIO seek callback returns the new position and fails unsupported
  whence values (AVSEEK_SIZE, SEEK_END) and out-of-range offsets;
- free_avformat() skips the IO context when it was never allocated;
- main() returns FFM_ERROR after a packet read/write failure;
- read_change_file() restores argv[1] before reporting a failed init.
zackees added a commit that referenced this pull request Oct 20, 2026
…tion and self-disconnect

Supersedes the characterizations in nested_signal_test and
global_remove_test and adds cases for deferred removal releasing the last
handler reference, removal during recursive delivery, and removal after
connects that move the callback array. Split from #1464.
zackees added a commit that referenced this pull request Oct 20, 2026
…registration

Squash of #1464's 00368fb, 183d3fd, 8bc9c00, 4554fee, 179e9a4:
- release the handler when a deferred keep_ref removal drops the last ref
- find global callbacks by callback and data, not a whole-struct memcmp
- save and restore the thread-local current callback around delivery
- count nested deliveries and erase removed callbacks only at depth 0
- track the current callback by signal and index, not a pointer into the
  array that a connect during delivery can reallocate
chriscoveries pushed a commit to chriscoveries/obsrust-fork that referenced this pull request Oct 20, 2026
…Refs obs-rust#1464) (obs-rust#1559)

* test: linux-alsa: a stop before the capture thread starts ends it (RED)

Refs obs-rust#1464

* fix: preserve early stop requests in the ALSA capture worker
chriscoveries pushed a commit to chriscoveries/obsrust-fork that referenced this pull request Oct 20, 2026
…egistration (split from obs-rust#1464) (obs-rust#1556)

* test: Expect signal callbacks to survive nesting, recursion, registration and self-disconnect

Supersedes the characterizations in nested_signal_test and
global_remove_test and adds cases for deferred removal releasing the last
handler reference, removal during recursive delivery, and removal after
connects that move the callback array. Split from obs-rust#1464.

* fix: Make signal callback removal safe across nesting, recursion and registration

Squash of obs-rust#1464's 00368fb, 183d3fd, 8bc9c00, 4554fee, 179e9a4:
- release the handler when a deferred keep_ref removal drops the last ref
- find global callbacks by callback and data, not a whole-struct memcmp
- save and restore the thread-local current callback around delivery
- count nested deliveries and erase removed callbacks only at depth 0
- track the current callback by signal and index, not a pointer into the
  array that a connect during delivery can reallocate
chriscoveries pushed a commit to chriscoveries/obsrust-fork that referenced this pull request Oct 20, 2026
…t argv (split from obs-rust#1464) (obs-rust#1553)

* test: obs-ffmpeg-mux seek, failed-open cleanup, exit status and split argv (RED)

Split from obs-rust#1464. Fails on master: the seek callback returns 0, free_avformat
dereferences a NULL pb after a failed open, main returns 0 after a packet
error, and read_change_file leaves argv[1] on its own buffer on failure.

* fix: obs-ffmpeg-mux seek contract, failed-open cleanup, exit status and split argv (GREEN)

Split from obs-rust#1464 (commits ab56688, cd07703, eadd067, ce1d1ff):
- the AVIO seek callback returns the new position and fails unsupported
  whence values (AVSEEK_SIZE, SEEK_END) and out-of-range offsets;
- free_avformat() skips the IO context when it was never allocated;
- main() returns FFM_ERROR after a packet read/write failure;
- read_change_file() restores argv[1] before reporting a failed init.

* fixup: clang-format test_ffmpeg_mux_helper.c
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.

1 participant