Repository navigation
Conversation
…ldren without `ps` A 0.36.0 Windows tester's support bundle reported 0 FFmpeg processes and no backend memory for its whole run. The runtime resource sampler forks `ps -axo` every second on every platform but macOS, and Windows has no `ps`, so every sample failed into an empty snapshot: Diagnostics showed "FFmpeg processes 0" and no engine memory, and Health's Memory check sat on "—" so its 1 GB warn and 2 GB error never fired there. Even with rows, the name check compared `ffmpeg` against `ffmpeg.exe`. Windows now reads one Toolhelp snapshot a second and never forks: - the backend's own row carries its working set (K32GetProcessMemoryInfo, `Win32_System_ProcessStatus`, used only by this backend and the WER helper) - a process joins the backend's tree only while it runs and when it started no earlier than the parent it names: a Windows parent pid is never cleared and can be reused - names match without a Windows `.exe` suffix (`executable_stem`); the capture worker `ffmpeg-capture.exe` is still not an FFmpeg process Linux keeps `ps`; macOS keeps libproc with `ps` as its fallback. Tests: `.exe` names and their counts, and the reused-pid and exited-process rules (every platform); a Windows test runs this binary's fixture as a real `ffmpeg.exe` child and reads it and the backend's working set back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
petercr
marked this pull request as draft
November 22, 2026 03:24
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This branch has not been deployed
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.
What a tester's bundle showed
A 0.36.0 Windows tester's support bundle (the same one behind #1639) reported 0 FFmpeg processes and no backend memory for the whole run.
The runtime resource sampler forks
ps -axo pid=,ppid=,rss=,comm=every second on every platform except macOS. Windows has nops, so every sample failed into an empty snapshot:Even with rows, the name check compared
ffmpegagainstffmpeg.exe, so it would have missed FFmpeg anyway.Change (
diagnostics.rs)Windows now reads one Toolhelp process snapshot per second and never forks.
K32GetProcessMemoryInfo). This adds theWin32_System_ProcessStatusfeature towindows, which only this backend and the WER helper use..exesuffix (executable_stem). The capture workerffmpeg-capture.exeis still not counted as an FFmpeg process.windows_tree_rows) so its rules run in tests on every platform.Linux keeps
ps. macOS keeps libproc withpsas its fallback.Tests
windows_executable_names_count_as_ffmpeg_and_ffprobe(every platform)windows_tree_rows_leave_out_reused_parent_pids_and_exited_processes(every platform)windows_process_rows_read_own_working_set_and_count_an_ffmpeg_exe_child(Windows): copies the test binary to a scratchffmpeg.exe, runs its fixture as a real child, and reads back the child and the backend's working set. It kills, reaps and cleans up on drop.Run on the Windows laptop (Intel UHD 620, PowerShell 7, debug test binary):
diagnostics::45 passed, 0 failedcargo fmt --checkand the pre-push hook are cleanNot yet run
cargo clippy(debug and release). CI runs both.🤖 Generated with Claude Code