fix: prevent crashes when output is piped#1048
Conversation
|
|
📊 Automated PR Analysis
SummaryFixes a SIGABRT crash when rtk output is piped to commands like Review Checklist
Linked issues: #1004 Analyzed automatically by wshm · This is an automated analysis, not a human review. |
|
Hey @ashwingopalsamy, the fix itself is correct — P0 — Windows build will fail// #[cfg(unix)] ← currently commented out
unsafe {
libc::signal(libc::SIGPIPE, libc::SIG_DFL);
}
Fix: uncomment the #[cfg(unix)]
unsafe {
libc::signal(libc::SIGPIPE, libc::SIG_DFL);
}P1 — Noise causing the CONFLICTING stateThe PR includes unrelated changes:
These happen when you branch from an older commit. release-please handles version bumps and changelog automatically on release, so please drop these files. Fix: git fetch origin
git rebase origin/develop
# Keep develop's versions for Cargo.toml/Cargo.lock/CHANGELOG.md/release-please-manifest.json
git push --force-with-leaseP2 — Typo in the testLine 2485: Thanks — this is a real bug, the fix just needs a bit of cleanup! |
|
@pszymkowiak - I've attempted to fix the suggestions. Please review. |
|
Thanks @ashwingopalsamy, and sorry for the long delay. Re-reviewed — you've addressed all three points:
One last thing: the PR still shows After that + green CI it's good to merge — the fix itself is correct and #1004 is still unfixed on |
|
Hey, conflicts solved |
|
LGTM Thanks for contributing to RTK ! |
Summary
rtk git log | head) by resetting SIGPIPE to the default handler at process startup (panic/SIGABRT on Broken pipe while writing stdout #1004)panic = "abort"in the release profile, any write to a closed pipe triggers SIGABRT + coredump instead of silent exitcfg(unix)focusing on Unix based systems, no impact on Windows platform.Test plan
cargo fmt --all && cargo clippy --all-targets && cargo testrtk git log --oneline -50 | head -1exits cleanly (no SIGABRT, no exit 134)rtk ls | head -1exits cleanlycargo test --ignored test_broken_pipe_does_not_crash