Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a constant value for the stack size #1403

Merged
merged 3 commits into from
Jun 30, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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.
lionel- marked this conversation as resolved.
Show resolved Hide resolved
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