Skip to content

SIGPIPE kills perry programs; node ignores it — claude … | head exits 141 and dies mid-write #9402

Description

@proggeramlug
claude auto-mode defaults | head -2
  node : rc=0     perry: rc=141

Deterministic, 3/3 each.

Node installs a SIGPIPE handler (or ignores the signal) so a program whose reader closes early finishes normally and sees EPIPE on write. Perry inherits the default disposition, so the process is killed mid-write by any truncating consumer: | head, | grep -q, | less and quitting, a closed socket.

This also caused an unrelated-looking suite failure (hooks case: perry rc=-13 vs node rc=1), so it will keep producing confusing secondary symptoms until fixed.

Fix: ignore SIGPIPE at runtime startup (signal(SIGPIPE, SIG_IGN)) and let writes return EPIPE, which is what every JS runtime does. Worth pairing with a check that write errors surface as JS-visible errors rather than being swallowed.

Found by a differential stress-test of cc 2.1.112 under perry 757beace0.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions