Skip to content

fix(agent-init): write each stderr line with a single write - #298

Merged
Ash20pk merged 4 commits into
mainfrom
fix/agent-init-atomic-log
Oct 25, 2026
Merged

Ash20pk merged 4 commits into
mainfrom
fix/agent-init-atomic-log

Conversation

@Ash20pk

@Ash20pk Ash20pk commented Oct 25, 2026

Copy link
Copy Markdown
Owner

The Multi-App Sandbox Milestone check has been failing about one run in three, on main as well as on PRs. The cause is agent-init's logging. std's eprintln! does one write(2) per piece of the format string, so when two apps' agent-init share a stderr their lines get spliced together mid-line, and the test sees one "restricted" line where it expects two.

This shadows eprintln! across the crate with a version that formats the whole line first and writes it once. A single write under PIPE_BUF to a pipe is atomic, so lines stay whole. No call sites change.

Checked with cargo clippy --all-targets for aarch64 Linux (clean). The VM rootfs re-pin that picks this up follows in this branch.

std's eprintln! issues one write(2) per format piece, so two apps'
agent-init sharing a stderr interleave mid-line. That is what made the
Multi-App Sandbox Milestone check fail about one run in three. Shadow
eprintln! crate-wide with a version that formats first and writes once.
Points both rootfs manifests' agent_init_commit at the fix, which also
carries main's dependency bumps, and takes the context-bus and
semantic-fs pins from the update_pins runs 40197044617 and 40197047050.
The agent-init, rootfs and layer hashes follow from a re-pin run.
From update_pins runs 40198606357 (aarch64) and 40198603422 (x86_64):
new agent-init and rootfs hashes in both manifests, the matching
rootfs pins in the CLI, and the release names in the docs.
berth-vmm compiles the kernel and rootfs pins in, so the re-pin needs
new binaries for all three platforms. Run 40200731376 built them,
rebuilt both rootfs images to their pins, and passed the x86_64 e2e.
libkrun is unchanged.
@Ash20pk
Ash20pk merged commit c72f438 into main Oct 25, 2026
36 checks passed
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