Skip to content

Commit

Permalink
Use a constant value for the stack size
Browse files Browse the repository at this point in the history
  • Loading branch information
jimhester committed Jun 24, 2021
1 parent 62488cc commit 6fba930
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# testthat (development version)

* The vendored Catch code used for `use_catch()` now uses an constant value for the stack size rather than relying on SIGSTKSZ.
This fixes compatibility for recent glibc versions where SIGSTKSZ is no longer a constant.

# testthat 3.0.2

* Failing expectations now include a backtrace when they're not called directly
Expand Down
6 changes: 3 additions & 3 deletions inst/include/testthat/vendor/catch.h
Original file line number Diff line number Diff line change
Expand Up @@ -6492,7 +6492,7 @@ namespace Catch {
static bool isSet;
static struct sigaction oldSigActions [sizeof(signalDefs)/sizeof(SignalDefs)];
static stack_t oldSigStack;
static char altStackMem[SIGSTKSZ];
static char altStackMem[32768];

static void handleSignal( int sig ) {
std::string name = "<unknown signal>";
Expand All @@ -6512,7 +6512,7 @@ namespace Catch {
isSet = true;
stack_t sigStack;
sigStack.ss_sp = altStackMem;
sigStack.ss_size = SIGSTKSZ;
sigStack.ss_size = 32768;
sigStack.ss_flags = 0;
sigaltstack(&sigStack, &oldSigStack);
struct sigaction sa = { 0 };
Expand Down Expand Up @@ -6543,7 +6543,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[32768] = {};

} // namespace Catch

Expand Down

0 comments on commit 6fba930

Please sign in to comment.