This is an archive of the discontinued LLVM Phabricator instance.

Revert "Reapply: Add an error message to the default SIGPIPE handler"
ClosedPublic

Authored by void on Nov 17 2022, 4:13 PM.

Details

Summary

This patch is spamming compiles with unhelpful and confusing messages.
E.g. the Linux kernel uses "grep -q" in several places. It's meant to
quit with a return code of zero when the first match is found. This can
cause a SIGPIPE signal, but that's expected. Worse, there's no way to
turn this error message off. We can only pipe it to /dev/null, which is
a bit awkward.

Is UNIX03 conformance something Clang is striving for? If so, then we
need a much better solution than to emit an error message that we can't
quiet.

This reverts commit b89bcefa6202e310eb3167dd1c37f1807377ec8d.

Link: https://github.com/ClangBuiltLinux/linux/issues/1651
Link: https://github.com/llvm/llvm-project/issues/59037

Diff Detail

Event Timeline

void created this revision.Nov 17 2022, 4:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 17 2022, 4:13 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
void requested review of this revision.Nov 17 2022, 4:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 17 2022, 4:13 PM
kees accepted this revision.Nov 17 2022, 4:24 PM

Looks good. Likely future work here would be to examine why the EX_IOERR exit is being exposed instead of just leaving SIGPIPE set to SIG_DFLT. But that's a separate issue entirely. :)

This revision is now accepted and ready to land.Nov 17 2022, 4:24 PM
nickdesaulniers edited the summary of this revision. (Show Details)
nickdesaulniers accepted this revision.Nov 18 2022, 9:16 AM

Looks good. Likely future work here would be to examine why the EX_IOERR exit is being exposed instead of just leaving SIGPIPE set to SIG_DFLT. But that's a separate issue entirely. :)

I think I added something like this: https://reviews.llvm.org/D53000 where in clang we need to check that return code in other frontends...

llvm/lib/Support/Unix/Signals.inc