Skip to content

berd-call: start the voice session with posix_spawn - #404

Merged
johnmatthewtennant merged 1 commit into
mainfrom
jtennant/berd-call-posix-spawn
Oct 20, 2026
Merged

johnmatthewtennant merged 1 commit into
mainfrom
jtennant/berd-call-posix-spawn

Conversation

@johnmatthewtennant

Copy link
Copy Markdown
Contributor

Summary

A Berd Call could fail to start with could not write voice session input: Broken pipe (os error 32). The voice session process aborted before it ran any Berd Call code: macOS reported BUG IN CLIENT OF LIBPLATFORM: os_once_t is corrupt, crashed on the child side of fork in libnotify's fork handler. The host spawned the session with a pre_exec hook, which makes the standard library fork. The menu bar's process runs AppKit threads, and if one of them is setting up a system library at that moment, the forked child aborts.

The session now starts through posix_spawn. Without the hook, the standard library uses it, and the hook's work moves to safe places:

  • The session's own process group comes from process_group(0).
  • The audio pipe's read end is close-on-exec, so only the write end reaches the session.
  • The session clears the stop signals the host blocks, which it now inherits.

Related issue

None.

Testing

  • New session test: a session that inherits blocked SIGINT and SIGTERM still stops on SIGTERM. It failed before the change and passes after.
  • Started a muted call from this build with the menu bar. The session reached ready with its own process group and no blocked signals, and it held only stdin, stdout and the audio pipe's write end. SIGTERM to the host ended both processes.
  • The fork race itself isn't deterministic, so no test reproduces the original crash.

The session was spawned with a pre_exec hook, which makes std fork.
Forking the menu bar's multithreaded process can abort the child before
exec ("os_once_t is corrupt" in libnotify's fork handler), and the call
then fails with a broken pipe. Without the hook std uses posix_spawn:
the process group comes from process_group, the audio pipe's read end
is close-on-exec, and the session clears the stop signals the host
blocked.

Signed-off-by: John Tennant <jtennant@block.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@johnmatthewtennant
johnmatthewtennant marked this pull request as ready for review October 20, 2026 20:28
@johnmatthewtennant
johnmatthewtennant requested a review from a team October 20, 2026 20:28

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Automated code review

APPROVE. Fresh static Engineering review of the exact prepared three-dot comparison found no publishable changed-line defects. The project code-review and Wes-review passes found the process-spawn change preserves session startup, signal delivery, process isolation, audio-pipe ownership, cleanup, and failure behavior, with a discriminating regression test for inherited blocked SIGTERM. Supplied GitHub evidence is structurally valid and reports 11 successful checks at the reviewed head SHA; required checks still govern merge readiness. Final self-check covered every changed user flow; accessibility; i18n/localization completeness; navigation and consent guards; async, error, never-completes, lifecycle, and race behavior; test honesty; design-system and project rules; duplicate and overlapping findings; and concrete evidence plus user effect for blocking severity.

Deterministic publication result: 0 blocking and 0 non-blocking inline finding(s) publishable; 0 duplicate(s) suppressed; 0 blocking screenshot-evidence requirement(s) in this review body.

Pending checks: 1 check(s) are not complete.

This approval reflects the completed code review only; merge readiness remains governed by the repository's required checks.

@johnmatthewtennant
johnmatthewtennant merged commit cf0d93d into main Oct 20, 2026
11 checks passed
@johnmatthewtennant
johnmatthewtennant deleted the jtennant/berd-call-posix-spawn branch October 20, 2026 20:52
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.

2 participants