Skip to content

Bound camera metadata helper output - #47

Merged
mikecerisano merged 1 commit into
mainfrom
fix/metadata-subprocess-output-20261017
Oct 17, 2026
Merged

mikecerisano merged 1 commit into
mainfrom
fix/metadata-subprocess-output-20261017

Conversation

@mikecerisano

@mikecerisano mikecerisano commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

A camera metadata helper could block when mdls or ffprobe filled stdout: BitMatch waited for the process to exit before reading its pipe. The eventual readDataToEndOfFile also had no memory bound. This drains output while the helper runs, caps it at 256 KiB, and discards oversized output entirely so a truncated prefix is never treated as camera metadata. Cancellation still stops the child, and existing exit-status handling stays intact. This is advisory camera detection; it does not change transfer or verification verdicts.

Local validation on the final code patch:

  • Focused Mac tests: 3/3 passed (exact cap, oversized output without a pipe hang or partial parse, cancellation of a quiet helper).
  • ./test.sh mac-test: passed; xcresult reports 1,201 passed, 14 skipped, 0 failed.
  • ./test.sh ipad-build: passed.
  • Rebasing onto current main (9cb218ba) produced an identical source/test diff (cmp) and a clean git diff --check.

Existing limitation: a helper that hangs without task cancellation and without filling stdout still has no overall timeout. This PR bounds captured output and cancellation, not that separate policy.

@mikecerisano
mikecerisano force-pushed the fix/metadata-subprocess-output-20261017 branch from 1704d87 to 463c31e Compare October 17, 2026 15:16
@mikecerisano
mikecerisano force-pushed the fix/metadata-subprocess-output-20261017 branch from 463c31e to d012214 Compare October 17, 2026 16:00
@mikecerisano
mikecerisano marked this pull request as ready for review October 17, 2026 16:01
@mikecerisano
mikecerisano merged commit 724643d into main Oct 17, 2026
4 of 8 checks passed
@mikecerisano
mikecerisano deleted the fix/metadata-subprocess-output-20261017 branch October 17, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant