[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
Thu Nov 14 14:45:49 PST 2019


vsk created this revision.
vsk added reviewers: JDevlieghere, jfb, labath.
Herald added subscribers: dexonsmith, hiraditya.
Herald added a project: LLVM.

Allow clients of the llvm library to opt-in to one-shot SIGPIPE
handling, instead of exiting with an IO error by default.

This prevents "IO error" crashes in long-lived processes (lldb is the
motivating example) which both a) load llvm as a dynamic library and b)
*really* need to ignore SIGPIPE.

As llvm signal handlers can be installed when calling into libclang
(say, via RemoveFileOnSignal), thereby overriding a previous SIG_IGN for
SIGPIPE, there is no clean way to opt-out of "exit-on-SIGPIPE" in the
current model.


https://reviews.llvm.org/D70277

Files:
  clang/tools/driver/driver.cpp
  lldb/tools/driver/Driver.cpp
  llvm/include/llvm/Support/Signals.h
  llvm/lib/Support/Unix/Signals.inc
  llvm/lib/Support/Windows/Signals.inc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70277.229416.patch
Type: text/x-patch
Size: 6320 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20191114/ae2b6d3a/attachment.bin>


More information about the lldb-commits mailing list