Index: opentracing-cpp-1.6.0/3rd_party/include/opentracing/catch2/catch.hpp =================================================================== --- opentracing-cpp-1.6.0.orig/3rd_party/include/opentracing/catch2/catch.hpp +++ opentracing-cpp-1.6.0/3rd_party/include/opentracing/catch2/catch.hpp @@ -6571,6 +6571,17 @@ namespace Catch { int id; const char* name; }; + + // 32kb for the alternate stack seems to be sufficient. However, this value + // is experimentally determined, so that's not guaranteed. + #if defined(_SC_SIGSTKSZ_SOURCE) || defined(_GNU_SOURCE) + // on glibc > 2.33 this is no longer constant, see + // https://sourceware.org/git/?p=glibc.git;a=blob;f=NEWS;h=85e84fe53699fe9e392edffa993612ce08b2954a;hb=HEAD + static constexpr std::size_t altStackSize = 32 * 1024; + #else + static constexpr std::size_t altStackSize = std::max(static_cast(SIGSTKSZ), 32 * 1024) + #endif + static SignalDefs signalDefs[] = { { SIGINT, "SIGINT - Terminal interrupt signal" }, { SIGILL, "SIGILL - Illegal instruction signal" }, @@ -6597,7 +6608,7 @@ namespace Catch { isSet = true; stack_t sigStack; sigStack.ss_sp = altStackMem; - sigStack.ss_size = SIGSTKSZ; + sigStack.ss_size = altStackSize; sigStack.ss_flags = 0; sigaltstack(&sigStack, &oldSigStack); struct sigaction sa = { }; @@ -6628,7 +6639,7 @@ namespace Catch { bool FatalConditionHandler::isSet = false; struct sigaction FatalConditionHandler::oldSigActions[sizeof(signalDefs)/sizeof(SignalDefs)] = {}; stack_t FatalConditionHandler::oldSigStack = {}; - char FatalConditionHandler::altStackMem[SIGSTKSZ] = {}; + char FatalConditionHandler::altStackMem[altStackSize] = {}; } // namespace Catch