Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions source/common/signal/signal_action.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,11 @@ void SignalAction::installSigHandlers() {
}

void SignalAction::removeSigHandlers() {
#if defined(__APPLE__)
// ss_flags contains SS_DISABLE, but Darwin still checks the size, contrary to the man page
if (previous_altstack_.ss_size < MINSIGSTKSZ) {
previous_altstack_.ss_size = MINSIGSTKSZ;
}
#endif
// sigaltstack and backtrace() are incompatible on Apple platforms
// https://reviews.llvm.org/D28265
#if !defined(__APPLE__)
RELEASE_ASSERT(sigaltstack(&previous_altstack_, nullptr) == 0, "");
#endif

int hidx = 0;
for (const auto& sig : FATAL_SIGS) {
Expand Down
4 changes: 4 additions & 0 deletions source/common/signal/signal_action.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ class SignalAction : NonCopyable {
void unmapStackMemory();
char* altstack_{};
std::array<struct sigaction, sizeof(FATAL_SIGS) / sizeof(int)> previous_handlers_;
// sigaltstack and backtrace() are incompatible on Apple platforms
// https://reviews.llvm.org/D28265
#if !defined(__APPLE__)
stack_t previous_altstack_;
#endif
};

} // namespace Envoy