The signal handlers LLVM installs in RegisterHandlers() (used for things
like printing a stack trace) use SA_ONSTACK so that on stack overflow,
the signal handler still has a stack from which it can run.
However, CrashRecoveryContext overwrites those signal handlers with ones
without SA_ONSTACK. Therefore, if the stack overflows while a
CrashRecoveryContext is active, the kernel fails to write a signal frame
and terminates the process.
Fix it by registering CrashRecoveryContext's signal handlers such that
they also run off the alternate signal stack.
You can test this by calling an endlessly recursing function directly
below the call to llvm::CrashRecoveryContext::Enable() in
clang/tools/driver/driver.cpp.