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 8499aaf commit 18d3066
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
Expand Up @@ -58,6 +58,9 @@
* Support setting the testthat edition via an environment variable
(`TESTTHAT_EDITION`) as well (@michaelquinn32, #1386).

* 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 18d3066

Please sign in to comment.