You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
quality: Miri, sanitizers and an unsafe-code lint for the Rust ports #143
The policy says the safe core has no unsafe, but nothing enforces it: there is already unsafe { CStr::from_ptr } in the safe core at rust/obs-util/src/config_file.rs:949 with no // SAFETY: comment. Rust-allocated memory is freed by C (darray via bmalloc), and only three cmocka tests run with ASan/UBSan.
Work:
#![deny(unsafe_code)] on safe-core modules (forbid outside src/ffi/); fix config_file.rs:949.
Claiming: An ASan/UBSan variant of the Tier 2 ON build
infra/sanitizer-workflow: a workflow_dispatch workflow (.github/workflows/sanitizers.yaml) plus rust/tools/sanitize/. It builds the tree under ASan+UBSan, TSan or valgrind, with ENABLE_RUST_LIBOBS OFF or ON as an input, runs every cmocka test, and does a timed headless OBS launch. A triage script writes the OBS-attributable reports to the job summary. PR today.
The manual passes over master have already filed #128, #133 and #160. The Miri and unsafe lint items stay unclaimed.
Claiming: #![deny(unsafe_code)] on the safe-core modules, plus the unsafe lint for ffi/ (both were noted as unclaimed here; the Miri and sanitizer items stay with their current owners).
Plan, as one PR, following the policy's RED→GREEN order:
Deny unsafe_code for the four port crates (obs-util, obs-codec, obs-graphics, obs-media-io), allowing it back only on src/ffi/ and on the two Windows platform modules that call Win32 directly (obs_util::pipe::windows, obs_util::utf8::windows), each with its own reason next to the module declaration. RED commit: with only the denial in place, cargo check --workspace reports 10 E0133 errors, at config_file.rs:949 and profiler.rs:17, 105, 111, 115, 117, 137, 142, 495, 504.
GREEN: clean up those two safe cores.
config_file::get_string was not only a lint violation: it read the value back through the address config_get_string returns after dropping the lock, so a concurrent writer that replaced the value frees the buffer and the safe API reads freed memory. It copies the bytes with the lock held now; the bytes returned do not change.
profiler's core loses the blog declaration, the bmalloc adoption and the box drop. profile_end reports the two LOG_ERROR lines through a callback the shim implements, which is the split the pipe port (rust: Port util/pipe-windows.c to obs-util #259) already uses for a failed CreateProcessW. Tier 1 gains a case for those lines that cmocka cannot see.
Record the invariant in docs/rust-port/testing-policy.md.
RED, GREEN and the local runs are done; the PR follows in a moment. Note on evidence: this machine has rustc 1.97.1 (windows-gnullvm) against the pinned 1.98.1, no soldr and no Docker, so I ran the equivalent commands directly (cargo test --workspace --ignore-rust-version, clippy -D warnings, fmt --check) and the head is deliberately unstamped so CI runs everything.
The clippy::undocumented_unsafe_blocks half of item 2 is a much larger, separate change (about 40 ffi/ modules and several hundred blocks), so I left it out of this PR. Say the word if you would rather have it folded in or split per crate.
Please add the claimed label; I have no triage rights on this repo.
Done and merged: the safe-core deny(unsafe_code) work landed in #290 ("rust: Deny unsafe_code in the port crates"), which merged on 2026-10-12. The lint that also caught the real bug in rust/obs-util/src/profiler.rs (a use-after-free on a reallocated Vec) is in that same PR.
The claim expired because I did not comment here after the merge, so the bot released the item to anyone. Nothing is outstanding on my side for that part.
Leaving the Miri and the ASan/UBSan Tier 2 variant with their current owners (zackees claimed the sanitizer workflow above).
Triage: a multi-item checklist, so labelling it tracker. Item 1 (deny unsafe_code) landed in #290; clippy undocumented_unsafe_blocks, Miri and the ASan/UBSan Tier 2 variant remain. Each should become its own sub-issue when someone picks it up.
Activity
zackees commentedon Oct 11, 2026
Claiming: An ASan/UBSan variant of the Tier 2 ON build
infra/sanitizer-workflow: aworkflow_dispatchworkflow (.github/workflows/sanitizers.yaml) plusrust/tools/sanitize/. It builds the tree under ASan+UBSan, TSan or valgrind, withENABLE_RUST_LIBOBSOFF or ON as an input, runs every cmocka test, and does a timed headless OBS launch. A triage script writes the OBS-attributable reports to the job summary. PR today.The manual passes over master have already filed #128, #133 and #160. The Miri and
unsafelint items stay unclaimed.infra: sanitizer triage catches what the first CI run hid
infra: sanitizer triage catches what the first CI run hid
infra: Add a dispatchable sanitizer workflow (ASan/UBSan, TSan, valgr…
infra: sanitizer triage catches what the first CI run hid
infra: sanitize.sh installs the pinned Rust toolchain for ENABLE_RUST…
MCPVOT commentedon Oct 12, 2026
Claiming:
#![deny(unsafe_code)]on the safe-core modules, plus theunsafelint forffi/(both were noted as unclaimed here; the Miri and sanitizer items stay with their current owners).Plan, as one PR, following the policy's RED→GREEN order:
Deny
unsafe_codefor the four port crates (obs-util,obs-codec,obs-graphics,obs-media-io), allowing it back only onsrc/ffi/and on the two Windows platform modules that call Win32 directly (obs_util::pipe::windows,obs_util::utf8::windows), each with its own reason next to the module declaration. RED commit: with only the denial in place,cargo check --workspacereports 10E0133errors, atconfig_file.rs:949andprofiler.rs:17, 105, 111, 115, 117, 137, 142, 495, 504.GREEN: clean up those two safe cores.
config_file::get_stringwas not only a lint violation: it read the value back through the addressconfig_get_stringreturns after dropping the lock, so a concurrent writer that replaced the value frees the buffer and the safe API reads freed memory. It copies the bytes with the lock held now; the bytes returned do not change.profiler's core loses theblogdeclaration, thebmallocadoption and the box drop.profile_endreports the twoLOG_ERRORlines through a callback the shim implements, which is the split the pipe port (rust: Port util/pipe-windows.c to obs-util #259) already uses for a failedCreateProcessW. Tier 1 gains a case for those lines that cmocka cannot see.Record the invariant in
docs/rust-port/testing-policy.md.RED, GREEN and the local runs are done; the PR follows in a moment. Note on evidence: this machine has rustc 1.97.1 (windows-gnullvm) against the pinned 1.98.1, no
soldrand no Docker, so I ran the equivalent commands directly (cargo test --workspace --ignore-rust-version, clippy-D warnings,fmt --check) and the head is deliberately unstamped so CI runs everything.The
clippy::undocumented_unsafe_blockshalf of item 2 is a much larger, separate change (about 40ffi/modules and several hundred blocks), so I left it out of this PR. Say the word if you would rather have it folded in or split per crate.Please add the
claimedlabel; I have no triage rights on this repo.rust: Deny unsafe_code in the port crates (RED)
rust: Keep the safe cores free of unsafe (GREEN)
docs: Record that the port crates deny unsafe_code
github-actions commentedon Oct 15, 2026
Claim bot: claim expired: no progress from @MCPVOT in 48 h. Anyone may claim it now.
MCPVOT commentedon Oct 20, 2026
Done and merged: the safe-core
deny(unsafe_code)work landed in #290 ("rust: Deny unsafe_code in the port crates"), which merged on 2026-10-12. The lint that also caught the real bug inrust/obs-util/src/profiler.rs(a use-after-free on a reallocatedVec) is in that same PR.The claim expired because I did not comment here after the merge, so the bot released the item to anyone. Nothing is outstanding on my side for that part.
Leaving the Miri and the ASan/UBSan Tier 2 variant with their current owners (zackees claimed the sanitizer workflow above).
zackees commentedon Oct 25, 2026
Triage: a multi-item checklist, so labelling it
tracker. Item 1 (deny unsafe_code) landed in #290; clippy undocumented_unsafe_blocks, Miri and the ASan/UBSan Tier 2 variant remain. Each should become its own sub-issue when someone picks it up.