Skip to content

Commit 9eba3aa

Browse files
l0rincMarcoFalke
andcommitted
test: avoid undersized Boost.Test signal stacks
Boost.Test registers a `SIGSTKSZ` alternate signal stack as each test binary starts, before any tests run. On musl, this can be smaller than Linux's hardware-dependent minimum, causing `sigaltstack()` to fail with `ENOMEM` during setup. Disable Boost.Test's alternate stack in both test entry points. Signal handlers continue to use the regular process stack. Boost.Test can no longer report stack overflows. Fixes #36026 Co-authored-by: MarcoFalke <*~=`'#}+{/-|&$^[email protected]>
1 parent 56db08d commit 9eba3aa

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎src/test/kernel/test_kernel.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#include <util/byte_units.h>
88
#include <util/fs.h>
99

10+
// Boost.Test's SIGSTKSZ alternate stack can be smaller than Linux requires on musl.
11+
#define BOOST_TEST_DISABLE_ALT_STACK
1012
#define BOOST_TEST_MODULE Bitcoin Kernel Test Suite
1113
#include <boost/test/included/unit_test.hpp>
1214

‎src/test/main.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
/**
66
* See https://www.boost.org/doc/libs/1_78_0/libs/test/doc/html/boost_test/adv_scenarios/single_header_customizations/multiple_translation_units.html
77
*/
8+
// Boost.Test's SIGSTKSZ alternate stack can be smaller than Linux requires on musl.
9+
#define BOOST_TEST_DISABLE_ALT_STACK
810
#define BOOST_TEST_MODULE Bitcoin Core Test Suite
911

1012
#include <boost/test/included/unit_test.hpp>

0 commit comments

Comments
 (0)