Repository navigation
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 ! |
|
hey @ashwingopalsamy could you sign the CLA please ? so we can release this :) |
rtk 0.42.3 Created-by: HarmonybrewBot Commit-by: HarmonybrewBot Merged-by: HarmonybrewBot Description: Created by `brew bump` --- Created with `brew bump-formula-pr`.<details> <summary>release notes</summary> <pre>## [0.42.3](rtk-ai/rtk@v0.42.2...v0.42.3) (2026-06-05) ### Feats - feat(copilot): CLI native integration #2101 ### Fix - fix(docs): replace remaining MIT license references with Apache 2.0 [#2084](rtk-ai/rtk#2084) - fix: prevent crashes when output is piped rtk-ai/rtk#1048 close rtk-ai/rtk#1004 - fix(grep): parse single-file output containing colons rtk-ai/rtk#1554; close rtk-ai/rtk#1436. - fix(ls): preserve permission info as octal when -l/-la is passed rtk-ai/rtk#1675 - fix(cicd): MIT to Apache 2.0 [#2092](rtk-ai/rtk#2092) - fix(pkg): rtk is Apache 2.0 and no MIT [#2082](rtk-ai/rtk#2082) - fix(hook): collapse bash line continuations before matching #1572 close Hook matcher: leading backslash-newline defeats command rewrite #1564 - fix(gh,glab): don't pre-reject view/checks/run subcommands missing the id rtk-ai/rtk#2123 - fix(git): fix panic on multibyte chars in commit output rtk-ai/rtk#1266 ### Other - docs(readme): add Portuguese translation #2128 - doc(init): fix documentation inconsistencies arount rtk init rtk-ai/rtk#2173 - fix(provider): sanatize more chars when encoding claude code project pathes https://github.com/rtk-ai/rtk/pull/2172</pre> <p>View the full release notes at <a href="https://github.com/rtk-ai/rtk/releases/tag/v0.42.3">https://github.com/rtk-ai/rtk/releases/tag/v0.42.3</a>.</p> </details> <hr> See merge request: Harmonybrew/homebrew-core!10665
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