Skip to content

Commit

Permalink
use MINSIGSTKSZ workaround from stackoverflow
Browse files Browse the repository at this point in the history
  • Loading branch information
amokfa committed Aug 13, 2022
1 parent e39df0e commit f5742c9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/Catch2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3742,6 +3742,10 @@ PVOID FatalConditionHandler::exceptionHandlerHandle = nullptr;

#elif defined( CATCH_CONFIG_POSIX_SIGNALS )

// https://stackoverflow.com/questions/71454588/minsigstksz-error-after-update-in-my-manjaro-linux
#undef MINSIGSTKSZ
#define MINSIGSTKSZ 65536

namespace Catch {

struct SignalDefs {
Expand All @@ -3751,7 +3755,7 @@ namespace Catch {

// 32kb for the alternate stack seems to be sufficient. However, this value
// is experimentally determined, so that's not guaranteed.
static std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;

static SignalDefs signalDefs[] = {
{ SIGINT, "SIGINT - Terminal interrupt signal" },
Expand Down Expand Up @@ -3807,7 +3811,7 @@ namespace Catch {
bool FatalConditionHandler::isSet = false;
struct sigaction FatalConditionHandler::oldSigActions[sizeof(signalDefs)/sizeof(SignalDefs)] = {};
stack_t FatalConditionHandler::oldSigStack = {};
char FatalConditionHandler::altStackMem[65536] = {};
char FatalConditionHandler::altStackMem[sigStackSize] = {};


} // namespace Catch
Expand Down

0 comments on commit f5742c9

Please sign in to comment.