Skip to content

Conversation

@Ecordonnier
Copy link
Collaborator

@Ecordonnier Ecordonnier commented Dec 9, 2025

Rust's start-up code sets the SIGPIPE signal handler to ignored. However the vast majority of the utilities should use the default signal handler for SIGPIPE rather than ignore SIGPIPE. (in reality those utilities should inherit the signal handler from their parent process, but this is not possible with current rust start-up code).

Instead of restoring the default signaler handler in individual utilities, do it in lib.rs and add some logic in the utilities which can't use the default SIGPIPE signal handler (cat, env, seq, split, tail, tee, tr, tty).

@github-actions
Copy link

github-actions bot commented Dec 9, 2025

GNU testsuite comparison:

GNU test failed: tests/sort/sort-compress-proc. tests/sort/sort-compress-proc is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/sort/sort-compress-proc. tests/sort/sort-compress-proc is passing on 'main'. Maybe you have to rebase?

Rust's start-up code sets the SIGPIPE signal handler to ignored. However the
vast majority of the utilities should use the default signal handler for
SIGPIPE.

Instead of restoring the default signaler handler in individual utilities, do it in lib.rs
and add some logic in the utilities which can't use the default SIGPIPE signal handler (cat, env, seq, split, tail, tee, tr, tty).

Signed-off-by: Etienne Cordonnier <[email protected]>
@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/sort/sort-compress-proc. tests/sort/sort-compress-proc is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)

@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/sort/sort-compress-proc. tests/sort/sort-compress-proc is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

@ChrisDryden
Copy link
Collaborator

There's a PR here that does some advanced stuff to get both Default SIGPIPE and SIGPIPE ignored to match GNU behavior but it does it in a totally different way.

@Ecordonnier
Copy link
Collaborator Author

@ChrisDryden are you talking about my PR #9620 or about some other PR? Did you really mean "both default SIGPIPE and SIGPIPE"? I don't understand what that means. Do you mean "both default signal SIGPIPE handler and custom SIGPIPE handler"?

@ChrisDryden
Copy link
Collaborator

ChrisDryden commented Dec 11, 2025

Whoops meant to add the link to this pr with that comment #9184

I don't think this implementation covers: Default SIGPIPE and SIGPIPE ignored

@Ecordonnier
Copy link
Collaborator Author

Whoops meant to add the link to this pr with that comment #9184

I don't think this implementation covers: Default SIGPIPE and SIGPIPE ignored

Thanks for the link. This is very interesting. I hope it can work that way.

@ChrisDryden
Copy link
Collaborator

I think this PR can be resolved now that we have the signals.rs shared library thats able to restore the default SIGPIPE handler?

@Ecordonnier
Copy link
Collaborator Author

Superseded by #9657

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.

2 participants