rtk-ai/rtk

panic/SIGABRT on Broken pipe while writing stdout

Open

#1004 opened on Apr 3, 2026

View on GitHub
 (1 comment) (0 reactions) (0 assignees)Rust (48,085 stars) (2,914 forks)batch import
bugeffort-smallgood first issueresolved-pending-close

Description

Summary

rtk aborts with a Rust panic when stdout is closed (Broken pipe), producing SIGABRT + coredump instead of exiting gracefully.

Environment

  • OS: Arch Linux (x86_64)
  • rtk version: 0.31.0
  • Binary: /home/s3s/.local/bin/rtk
  • Build ID: cc06a1448d8bbdd786613878d0ec5dd3537f3ce9

What happened

On 2026-04-03 (CEST), multiple rtk invocations crashed (SIGABRT) and generated core dumps.

Observed commands at crash time:

  • rtk ls -la /mnt/datos/2brain-backend/scripts/deploy/
  • rtk git log --oneline --all --decorate -50
  • rtk git diff ae78d87^..ae78d87 --name-only (repeated)

systemd services were healthy (systemctl --failed and systemctl --user --failed both empty), so this is user-space process crash behavior in rtk.

Evidence

coredumpctl list rtk showed 5 crashes (all SIGABRT) on 2026-04-03.

From core dump strings (same pattern across all affected PIDs):

thread 'main' (...) panicked at /rustc/.../library/std/src/io/stdio.rs:1165:9:
failed printing to stdout: Broken pipe (os error 32)

I validated this message in multiple dumps (e.g. PIDs 30441, 42021, 490097, 491982, 492096).

Expected behavior

If stdout is closed by downstream consumer (EPIPE), rtk should terminate cleanly (or return non-zero) without panic/abort/coredump.

Actual behavior

rtk panics in std::io::stdio on write to stdout, then aborts and dumps core.

Notes

This looks like unhandled Broken pipe on output path. Handling EPIPE explicitly (or ignoring SIGPIPE semantics appropriately for CLI output writes) should avoid process aborts and coredumps in normal shell workflows.

Contributor guide