Skip to content

Commit 0bed946

Browse files
committed
Merge bitcoin/bitcoin#33079: ci: limit max stack size to 512 KiB
3b23f95 ci: limit max stack size to 512 KiB (dergoegge) 2931a87 ci: limit stack size to 512kb in native macOS jobs (fanquake) Pull request description: Picks up #31367. Closes #29840. Limit adjustment is moved until after compilation, otherwise compilation might not succeed. I've used compilation flags to limit the stack size in the native macOS jobs, because trying to use `ulimit` resulted in: ```bash + '[' -n 1 ']' + ulimit -s 262144 /Users/runner/work/bitcoin/bitcoin/ci/test/03_test_script.sh: line 17: ulimit: stack size: cannot modify limit: Operation not permitted ``` See example failures (`ulimit -s 64`) here: https://github.com/bitcoin/bitcoin/runs/46861548042. ACKs for top commit: dergoegge: utACK 3b23f95 Tree-SHA512: 7e00626f3ca9e860d79a301af2427008ce27c329b618e24f95e7a55b284459a446216d2859c2e63be50abb9d4f0d343c12ff50445231652d354f225477928a35
2 parents 28ec91c + 3b23f95 commit 0bed946

8 files changed

+11
-2
lines changed

ci/test/00_setup_env_arm.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export USE_BUSY_BOX=true
1616
export RUN_UNIT_TESTS=true
1717
export RUN_FUNCTIONAL_TESTS=false
1818
export GOAL="install"
19+
export CI_LIMIT_STACK_SIZE=1
1920
# -Wno-psabi is to disable ABI warnings: "note: parameter passing for argument of type ... changed in GCC 7.1"
2021
# This could be removed once the ABI change warning does not show up by default
2122
export BITCOIN_CONFIG="-DREDUCE_EXPORTS=ON -DCMAKE_CXX_FLAGS='-Wno-psabi -Wno-error=maybe-uninitialized'"

ci/test/00_setup_env_mac_native.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export LC_ALL=C.UTF-8
1111
export PIP_PACKAGES="--break-system-packages zmq"
1212
export GOAL="install deploy"
1313
export CMAKE_GENERATOR="Ninja"
14-
export BITCOIN_CONFIG="-DBUILD_GUI=ON -DWITH_ZMQ=ON -DREDUCE_EXPORTS=ON"
14+
export BITCOIN_CONFIG="-DBUILD_GUI=ON -DWITH_ZMQ=ON -DREDUCE_EXPORTS=ON -DCMAKE_EXE_LINKER_FLAGS='-Wl,-stack_size -Wl,0x80000'"
1515
export CI_OS_NAME="macos"
1616
export NO_DEPENDS=1
1717
export OSX_SDK=""

ci/test/00_setup_env_mac_native_fuzz.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
export LC_ALL=C.UTF-8
88

99
export CMAKE_GENERATOR="Ninja"
10-
export BITCOIN_CONFIG="-DBUILD_FOR_FUZZING=ON"
10+
export BITCOIN_CONFIG="-DBUILD_FOR_FUZZING=ON -DCMAKE_EXE_LINKER_FLAGS='-Wl,-stack_size -Wl,0x80000'"
1111
export CI_OS_NAME="macos"
1212
export NO_DEPENDS=1
1313
export OSX_SDK=""

ci/test/00_setup_env_native_asan.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export APT_LLVM_V="20"
2323
export PACKAGES="systemtap-sdt-dev clang-${APT_LLVM_V} llvm-${APT_LLVM_V} libclang-rt-${APT_LLVM_V}-dev python3-zmq qt6-base-dev qt6-tools-dev qt6-l10n-tools libevent-dev libboost-dev libzmq3-dev libqrencode-dev libsqlite3-dev ${BPFCC_PACKAGE}"
2424
export NO_DEPENDS=1
2525
export GOAL="install"
26+
export CI_LIMIT_STACK_SIZE=1
2627
export BITCOIN_CONFIG="\
2728
-DWITH_USDT=ON -DWITH_ZMQ=ON -DBUILD_GUI=ON \
2829
-DSANITIZERS=address,float-divide-by-zero,integer,undefined \

ci/test/00_setup_env_native_msan.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export CONTAINER_NAME="ci_native_msan"
1717
export PACKAGES="clang-${APT_LLVM_V} llvm-${APT_LLVM_V} llvm-${APT_LLVM_V}-dev libclang-${APT_LLVM_V}-dev libclang-rt-${APT_LLVM_V}-dev ninja-build"
1818
export DEP_OPTS="DEBUG=1 NO_QT=1 CC=clang CXX=clang++ CFLAGS='${MSAN_FLAGS}' CXXFLAGS='${MSAN_AND_LIBCXX_FLAGS}'"
1919
export GOAL="install"
20+
export CI_LIMIT_STACK_SIZE=1
2021
# Setting CMAKE_{C,CXX}_FLAGS_DEBUG flags to an empty string ensures that the flags set in MSAN_FLAGS remain unaltered.
2122
# _FORTIFY_SOURCE is not compatible with MSAN.
2223
export BITCOIN_CONFIG="\

ci/test/00_setup_env_native_previous_releases.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export TEST_RUNNER_EXTRA="--previous-releases --coverage --extended --exclude fe
1515
export RUN_UNIT_TESTS_SEQUENTIAL="true"
1616
export RUN_UNIT_TESTS="false"
1717
export GOAL="install"
18+
export CI_LIMIT_STACK_SIZE=1
1819
export DOWNLOAD_PREVIOUS_RELEASES="true"
1920
export BITCOIN_CONFIG="\
2021
-DWITH_ZMQ=ON -DBUILD_GUI=ON -DREDUCE_EXPORTS=ON \

ci/test/00_setup_env_native_tsan.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ export APT_LLVM_V="20"
1212
export PACKAGES="clang-${APT_LLVM_V} llvm-${APT_LLVM_V} libclang-rt-${APT_LLVM_V}-dev libc++abi-${APT_LLVM_V}-dev libc++-${APT_LLVM_V}-dev python3-zmq"
1313
export DEP_OPTS="CC=clang CXX='clang++ -stdlib=libc++'"
1414
export GOAL="install"
15+
export CI_LIMIT_STACK_SIZE=1
1516
export BITCOIN_CONFIG="-DWITH_ZMQ=ON -DSANITIZERS=thread \
1617
-DAPPEND_CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER -DDEBUG_LOCKCONTENTION -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES'"

ci/test/03_test_script.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ bash -c "${PRINT_CCACHE_STATISTICS}"
140140
du -sh "${DEPENDS_DIR}"/*/
141141
du -sh "${PREVIOUS_RELEASES_DIR}"
142142

143+
if [ -n "${CI_LIMIT_STACK_SIZE}" ]; then
144+
ulimit -s 512
145+
fi
146+
143147
if [ -n "$USE_VALGRIND" ]; then
144148
"${BASE_ROOT_DIR}/ci/test/wrap-valgrind.sh"
145149
fi

0 commit comments

Comments
 (0)