[Lldb-commits] [PATCH] D70277: [Signal] Allow llvm clients to opt into one-shot SIGPIPE handling

Vedant Kumar via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 8 11:18:56 PST 2021

vsk added a comment.

The issue is that InitLLVM initializes its private PrettyStackPrinter before installing the one-shot default SIGPIPE handler: the PrettyStackPrinter itself eventually calls RegisterHandlers(), which runs before the SIGPIPE handler is installed and therefore doesn't register a SIGPIPE handler.

Why doesn't RegisterHandlers simply unconditionally install llvm's "SignalHandler" as a handler for SIGPIPE? We found that it broke lldb's ability to ignore SIGPIPE, as RegisterHandlers is called by a ton of library code (including library code called by lldb!). I'll be the first to admit that this one-shot sigpipe handler business is incredibly fragile, but unfortunately I don't have a better solution :/.

The fix is up here: https://reviews.llvm.org/D94324

  rG LLVM Github Monorepo



More information about the lldb-commits mailing list