setup signal handler with SA_ONSTACK
authorPhilip Pronin <philipp@fb.com>
Fri, 11 Dec 2015 00:15:37 +0000 (16:15 -0800)
committerfacebook-github-bot-0 <folly-bot@fb.com>
Fri, 11 Dec 2015 01:20:24 +0000 (17:20 -0800)
commitdee3186eca21211a0e031f5489b32326a3b9ddd2
tree6e8fdc2ad7b92f1e55fdef0a33d9591d7831d596
parentd8ebd43db7f2146a6a867ce4ec282d934ff32e36
setup signal handler with SA_ONSTACK

Summary:
By default signal handlers are run on the signaled thread's stack.
In case of stack overflow running the `SIGSEGV` signal handler on
the same stack leads to another `SIGSEGV` and crashes the program
Use `SA_ONSTACK`, so alternate stack is used (only if configured via
`sigaltstack`).

Reviewed By: luciang

Differential Revision: D2747021

fb-gh-sync-id: 48388acd6147e2919412ec32acfca1ca76f22a16
folly/experimental/symbolizer/SignalHandler.cpp