Skip to content

test: avoid undersized Boost.Test signal stacks - #252

Closed
l0rinc wants to merge 40 commits into
masterfrom
l0rinc/test-kernel-sigaltstack
Closed

l0rinc wants to merge 40 commits into
masterfrom
l0rinc/test-kernel-sigaltstack

Conversation

@l0rinc

@l0rinc l0rinc commented Jul 24, 2026 •

Copy link
Copy Markdown
Owner

Problem: Boost.Test creates an alternate signal stack of SIGSTKSZ before either test binary runs.
On Alpine 3.24, musl's 8 KiB value can be smaller than Linux's hardware-dependent minimum on AVX-512/AMX CPUs, causing sigaltstack() to fail with ENOMEM before the first test case.
The same test_kernel setup failure has appeared on master, unrelated feature branches, and the Bitcoin Core GUI mirror.
For the same source commit, an AMX-capable Intel runner failed while an AMD runner passed.
Semgrep independently diagnosed the same Alpine 3.24 issue, measuring a 12,976-byte runtime minimum against musl's 8,192-byte SIGSTKSZ; the Linux documentation explains why the minimum depends on hardware state.

Fix: Define Boost's supported BOOST_TEST_DISABLE_ALT_STACK switch in both Boost.Test entry points.
The tests keep ordinary signal handling on the process stack; only stack-overflow reporting after that stack is exhausted is lost, and production binaries are unaffected.

Detailed explanation

An alternate signal stack is a separate memory area that the kernel can use when invoking a signal handler.
Its main benefit to Boost.Test is that a handler can still run after a test has exhausted the regular process stack.

Before invoking the handler, Linux writes a signal frame containing the interrupted process's register state to the selected stack.
The amount of state is hardware-dependent because newer x86 features add larger XSAVE areas.
The Linux kernel documentation therefore exposes the runtime minimum as AT_MINSIGSTKSZ and demonstrates allocating AT_MINSIGSTKSZ + SIGSTKSZ.

Boost.Test instead allocates only SIGSTKSZ.
With musl 1.2.6, sigaltstack() rejects a size below sysconf(_SC_MINSIGSTKSZ).
musl reports this undersized stack as ENOMEM, which Boost surfaces as the misleading setup failure:

Test setup error: system_error produced by: exp: Out of memory

The runner was not out of memory.
The failure happened while Boost.Test registered its signal stack, before test_kernel started its first case.
The failing runner was an Intel Xeon Platinum 8573C exposing AVX-512 and AMX, while the same source commit passed on an AMD EPYC 7763 without AMX.

Disabling Boost.Test's alternate stack avoids the invalid fixed-size registration entirely.
Ordinary signals can still be handled while the regular stack has space.
A future Boost fix could size its allocation dynamically, as Semgrep did for the same problem, but the supported compile-time switch is sufficient for these test binaries.

hebasto and others added 30 commits March 16, 2026 14:33
Fix the behavior where modifications in included files (e.g.
`packages/qt_details.mk`) do not trigger a rebuild of the
parent packages (`native_qt` and `qt`).

The checksum calculation now parses `include` directives and
adds those files to the hash.
The global xpubs are stored in a map of key origin to set of xpubs,
while the serialization writes one record per xpub, keyed by the xpub.
Merging two PSBTs origin-by-origin can store the same xpub under two
origins, which serializes as a PSBT with duplicate keys that the
deserializer (and BIP 174) reject. Notably, combinepsbt returned a
PSBT that no RPC could parse again when the combined PSBTs provide
different key origins for the same xpub.

Deduplicate by xpub when merging, keeping the origin that is already
present, and share the logic between combinepsbt and joinpsbts.
The explicit duplicate global xpub check was replaced by the generic
duplicate key check in 1e2d146, leaving the set unused.
When a console line has no command name (e.g. ")", "()", "(", ",") the
parser reaches the command-execution branch with an empty argument frame,
so stack.back()[0] reads out of bounds and the argument list built from
stack.back().begin() + 1 is an invalid iterator range. Guard the ')' and
newline branch with stack.back().size() > 0, matching the existing '('
branch, so the empty frame is skipped.

Since there is no command to run in these cases, return false so the UI
reports an invalid command line, consistent with other fully-invalid input
like a bare quote, instead of silently ignoring it.

Add regression cases to rpcNestedTests for the inputs that abort without
the guard.
test_alternate_witness_tx mines the taproot funding output on node0
with sync_fun=self.no_op and immediately disconnects. node1 later
includes the script-path spend via generateblock. If the funding
block has not reached node1, that call fails with
bad-txns-inputs-missingorspent.

Drop the no_op so generate() uses the default sync_all before the
partition.

Signed-off-by: shaurya2k06 <[email protected]>
CMasterKey::nDeriveIterations values are deserialized from wallet
files as unsigned 32-bit integers, but key derivation narrowed the
count to a signed int. A count above INT_MAX became negative in the
conversion, and the derivation loop counter then overflowed, which
is undefined behavior.

Keep the count unsigned through the derivation path to match the
serialized type. Add a unit test for zero and normal counts.
`verify-commits.py` must not authorize checkout when Git cannot inspect the requested commit or its ancestry.
Reject ancestry command errors and validate the exact trusted root through Git before reporting success.

Co-authored-by: Rob Hamilton <[email protected]>
`verify-commits.py` must not authorize checkout for a commit whose history diverges from configured trust roots.
Require proof that the commit is an ancestor of a root before skipping checks, and identify the failing root in errors.

Co-authored-by: Rob Hamilton <[email protected]>
Previously would use global `CLIENT_VERSION` no matter what, but this is
one sense a refactor since all of the places where WriteVersion is
called currently call it with `CLIENT_VERSION` anyways. The
`client_version` argument is kept since future test code may want to
write other versions.

Addresses a review comment from bitcoin#32636:

bitcoin#32636 (comment)
Replace magic 0x80000000 literals with named constants for BIP32
hardened/unhardened child derivation.
Extract ParseKeyPathElement() as a shared helper in util/bip32 that
parses a single BIP32 key path element (e.g. "0", "0'", "0h").
Both ParseHDKeypath() and the descriptor parser's ParseKeyPathNum()
now delegate to it, eliminating duplicated parsing logic.
Mark CCrypter's fallible methods and crypto helpers as nodiscard, and
handle key-derivation calibration failures.

Keep the output master key unchanged until encryption succeeds. Validate
calibrated iteration counts before integer conversion. This prevents a
failed calibration from leaving mismatched parameters and ciphertext or
triggering undefined conversion behavior.
ec5d196 wallet: WalletBatch->WriteVersion respect argument. (David Gumberg)

Pull request description:

  > Previously would use global `CLIENT_VERSION` no matter what, but this is one sense a refactor since all of the places where WriteVersion is called currently call it with `CLIENT_VERSION` anyways. The `client_version` argument is kept since future test code may want to write other versions.

  > Addresses a review comment from [bitcoin#32636](bitcoin#32636 (comment)):

  This was originally pointed out in bitcoin#32636 (comment), and the followup (bitcoin#34490) was never merged. However I think it's confusing to have functions that take arguments but ignore them (and it's dead code), so I've cherry-picked the fix up from bitcoin#34490.

ACKs for top commit:
  achow101:
    ACK ec5d196
  pablomartin4btc:
    ACK ec5d196
  w0xlt:
    ACK ec5d196

Tree-SHA512: 3ad82d979493ac14704975bef504c791ac72fe7910c25097f0019bf61e3d384b0e1646f90c730d2f655733428b14ccd0196c333df2d6153ff5b55ab41918a6dd
If the `==` operator on two `Coin` fails, the developer should also see
the conditions under which it failed. All that is required is adding a
`<<` operator, moving the `==` out of the namespace, and switching `==`
sites to `BOOST_TEST`.

Here we also tighten what it means for a coin to be "equal."

This is a pre-requiste for bitcoin#35713 but seems to be a benefit on its own.

Co-authored-by: l0rinc <[email protected]>
Avoid exposing a process-wide FakeNodeClock accessor from the test
utility module. Initialize separate scoped clocks for target setup and
input processing, and pass the active clock to ResetChainmanAndMempool
by reference.

ResetChainmanAndMempool sets each scoped clock to the selected chain's
genesis time. Avoid hard-coding the mainnet genesis timestamp when
constructing these clocks, because the targets use REGTEST parameters
and the value is overwritten during reset.

Initialize each clock from the fuzz harness's existing mock time until
ResetChainmanAndMempool sets the REGTEST genesis time.

This commit does not change behavior.

Co-authored-by: maflcko <[email protected]>
Co-authored-by: nervana21 <[email protected]>
…ic toolchains

de9b436 depends: Switch from multilib to platform-specific toolchains (Hennadii Stepanov)

Pull request description:

  Using the multilib GCC toolchain, as currently documented in [`depends/README.md`](https://github.com/bitcoin/bitcoin/blob/4c1906a500cacab385b09e780b54271b0addaf4b/depends/README.md), has several issues, such as:

  1. The [`g++-multilib`](https://packages.ubuntu.com/noble/g++-multilib) package conflicts with platform-specific cross-compiler packages. This means it is not possible to cross compile for `i686` and other platforms using the same set of installed packages.

  2. The [`g++-multilib`](https://packages.ubuntu.com/noble/g++-multilib) package is not available for `arm64`:
  ```sh
  $ sudo apt install g++-multilib
  Reading package lists... Done
  Building dependency tree... Done
  Reading state information... Done
  E: Unable to locate package g++-multilib
  ```

  3. Managing the multilib GCC toolchain requires additional code in both depends and Guix scripts.

  This PR addresses all the issues mentioned above by switching from multilib to platform-specific toolchains.

  Also see bitcoin#22456.

  ---

  Here are examples of building for different scenarions:

  - Linux, `x86_64` or `arm64`, building with depends natively:
  ```sh
  $ gmake -C depends -j $(nproc)
  $ cmake -B build --toolchain depends/$(./depends/config.sub $(./depends/config.guess))/toolchain.cmake
  $ cmake --build build -j $(nproc)
  ```

  - Linux, `x86_64` or `arm64`, cross compiling for `i686-pc-linux-gnu`:
  ```sh
  $ sudo apt install g++-i686-linux-gnu binutils-i686-linux-gnu
  $ export HOST=i686-linux-gnu
  $ gmake -C depends -j $(nproc)
  $ cmake -B build-${HOST} --toolchain depends/${HOST}/toolchain.cmake
  $ cmake --build build-${HOST} -j $(nproc)
  ```

  - Linux, `x86_64`, cross compiling for `arm64`:
  ```sh
  $ sudo apt install g++-aarch64-linux-gnu binutils-aarch64-linux-gnu
  $ export HOST=aarch64-linux-gnu
  $ gmake -C depends -j $(nproc)
  $ cmake -B build-${HOST} --toolchain depends/${HOST}/toolchain.cmake
  $ cmake --build build-${HOST} -j $(nproc)
  ```

  - Linux, `arm64`, cross compiling for `x86_64`:
  ```sh
  $ sudo apt install g++-x86-64-linux-gnu binutils-x86-64-linux-gnu
  $ export HOST=x86_64-linux-gnu
  $ gmake -C depends -j $(nproc)
  $ cmake -B build-${HOST} --toolchain depends/${HOST}/toolchain.cmake
  $ cmake --build build-${HOST} -j $(nproc)
  ```

ACKs for top commit:
  fanquake:
    ACK de9b436
  BrandonOdiwuor:
    ACK de9b436

Tree-SHA512: 453b4744974cdf56d6edfdbe93bb11e3bae3f9bc9cd99b9c57aee74e65fcdd3ac011a1dcc19f485ea3be427f4e9c6c6b0d704881369f719620f0cb299123e561
…ksums

ec61a1a depends: Hash included makefiles in package checksums (Hennadii Stepanov)

Pull request description:

  This PR fixes an issue where modifications in included files (e.g. `packages/qt_details.mk`) do not trigger a rebuild of the parent packages (`native_qt` and `qt`).

  This addresses an oversight in 248613e from bitcoin#30997.

  ### Reproduction

  On master (@ 595504a), modifying the included makefile does not change the build ID:
  ```
  $ cd depends
  $ gmake print-qt_build_id HOST=x86_64-w64-mingw32
  qt_build_id=b2ce790473c
  $ gmake print-native_qt_build_id HOST=x86_64-w64-mingw32
  native_qt_build_id=70e1e5164c5
  $ echo "" >> packages/qt_details.mk
  $ gmake print-qt_build_id HOST=x86_64-w64-mingw32
  qt_build_id=b2ce790473c
  $ gmake print-native_qt_build_id HOST=x86_64-w64-mingw32
  native_qt_build_id=70e1e5164c5
  ```

  ### With this patch

  The checksum calculation now parses `include` directives and adds those files to the hash. The IDs now update correctly:
  ```
  $ cd depends
  $ gmake print-qt_build_id HOST=x86_64-w64-mingw32
  qt_build_id=9a6ebf79cb3
  $ gmake print-native_qt_build_id HOST=x86_64-w64-mingw32
  native_qt_build_id=6ad78a3f644
  $ echo "" >> packages/qt_details.mk
  $ gmake print-qt_build_id HOST=x86_64-w64-mingw32
  qt_build_id=ca820665c52
  $ gmake print-native_qt_build_id HOST=x86_64-w64-mingw32
  native_qt_build_id=082e4cb2364
  ```

ACKs for top commit:
  sedited:
    ACK ec61a1a

Tree-SHA512: 9425d606dcf003ef9342560a1d0def3d591279ed261a6af0cfb2bf7b2fb1864bf7937877a1119e4c694e6c74a46074eb5e84e6198a90f4d1cd49010088077f92
1156ce6 test: Tighten `Coin` equality and add debug output (rustaceanrob)

Pull request description:

  If the `==` operator on two `Coin` fails, the developer should also see the conditions under which it failed. All that is required is adding a `<<` operator, moving the `==` out of the namespace, and switching `==` sites to `BOOST_TEST`.

  Here we also tighten what it means for a coin to be "equal."

  This is a pre-requiste for bitcoin#35713 but seems to be a benefit on its own.

ACKs for top commit:
  josibake:
    reACK bitcoin@1156ce6
  maflcko:
    review ACK 1156ce6 🔋

Tree-SHA512: de5c612998518371ded3d25abdf1c96640e33d9961902dc4765a7e8f5088d8698a66ad63bc0a9822ec2b53e41e72dc95f78196822429af30b2ec29baa31c1ed1
8454fb2 test: sync funding block before isolating nodes (shaurya2k06)

Pull request description:

  Fixes bitcoin#35967

  test_alternate_witness_tx mines the taproot funding output on node0 with
  sync_fun=self.no_op and immediately disconnects. node1 later includes the
  script-path spend via generateblock. If the funding block has not reached
  node1, that call fails with bad-txns-inputs-missingorspent.

  Drop the no_op so generate() uses the default sync_all before the partition.
  Later generate* calls keep no_op because the nodes are then disconnected.

  Seen twice this week in hebasto bitcoin-core-nightly NetBSD jobs:
  https://github.com/hebasto/bitcoin-core-nightly/actions/runs/31350308484/job/93339698854
  https://github.com/hebasto/bitcoin-core-nightly/actions/runs/31765546925/job/94660585799

  The modified test is test/functional/wallet_listtransactions.py. I ran it
  locally three times with build/test/functional/wallet_listtransactions.py.

ACKs for top commit:
  achow101:
    ACK 8454fb2
  furszy:
    utACK 8454fb2

Tree-SHA512: 6b8fdcdc9ce9c57c2939caff34850e88450864c909fe226ba9b6e02ffcefa3625623589b8ecd2f09b9ca16bcaec3a64bd07642ff2c47ae6e8d250de478d34b53
4e5327b fuzz: refactor: scope fake clocks to target phases (Hao Xu)
e33410d fuzz: document arbitrary mocktimes (Hao Xu)

Pull request description:

  Follow-up to bitcoin#35482 (bitcoin#35482 (comment)), addressing a remaining issue with the lifetime of the mock node clock.

  This replaces the process-wide `FakeNodeClock` accessor with scoped clocks in the affected fuzz target initialization and input-processing phases, following the existing `FakeSteadyClock` pattern. The active clock is passed to `ResetChainmanAndMempool()` by reference.

  Tested the affected fuzz targets with `-runs=1`:

  - `cmpctblock`
  - `process_message`
  - `process_messages`
  - `utxo_snapshot`
  - `utxo_snapshot_invalid`

ACKs for top commit:
  maflcko:
    review ACK 4e5327b 🚉
  nervana21:
    re-ACK 4e5327b

Tree-SHA512: 7763bb2a06e3f33bcae3ad7b43f6d30a231e39197e8d274eadd496da1194fc0178b27cf016b451f36309d9277ce414c85daf734604c85a9deb3803b26b968e6a
2c16efb psbt: Remove unused IsNull() methods (nebula-21)

Pull request description:

  This PR removes the `IsNull()` methods from `PartiallySignedTransaction`, `PSBTInput`, and `PSBTOutput`, along with their calls from the fuzz target.

  This methods have no production callers, their only callers are the fuzz target. As such, keeping these methods seems not useful.

  The motivation for this PR came from jeanpablojp's comment on [bitcoin#35848](bitcoin#35848 (comment)), added him as coauthor.

ACKs for top commit:
  maflcko:
    review ACK 2c16efb 🥑
  vicjuma:
    ACK 2c16efb
  sedited:
    ACK 2c16efb

Tree-SHA512: 129933ae9803a2d053e340ee2a85efd1e5d9e5e38833fac0a0a9cbd467fec3157087959c464a8eeedb04ea99b1e5d7eba5a2fafde2e78a4fabcd247fac855477
465bca7 contrib: reject divergent verify-commits history (Lőrinc)
b3d1dca contrib: fail on verify-commits ancestry errors (Lőrinc)

Pull request description:

  **Problem:** `verify-commits.py` checks a Git commit's history for trusted signatures and tree hashes back to configured roots.
  The documented workflow runs this check after fetching a commit and before checkout, proceeding only when the script succeeds.
  A commit that is an ancestor of a configured root is intentionally accepted without checking earlier history.
  The script also takes this success path after Git errors or for divergent commits, even though neither establishes that relationship.

  **Fix:** Require Git to prove the ancestor relationship before taking this success path.

  **Reproducers:** Each commit can be validated manually.
  <details><summary>Manual reproducer: Git error</summary>

  Run this on `master` and at this PR's head:

  ```bash
  contrib/verify-commits/verify-commits.py 0000000000000000000000000000000000000000 && echo ❌ || echo ✅
  ```

  `master` exits successfully without verifying the missing commit, while the PR head rejects the Git error.
  </details>

  <details><summary>Manual reproducer: divergent history</summary>

  On `master` and at this PR's head, create an unreferenced sibling of the trusted root and run the verifier:

  ```bash
  root=$(head -n1 contrib/verify-commits/trusted-git-root)
  divergent_commit=$(git commit-tree "$root^{tree}" -p "$root^" -m 'divergent commit')
  contrib/verify-commits/verify-commits.py "$divergent_commit" && echo ❌ || echo ✅
  ```

  `master` exits successfully without verifying the sibling commit, while the PR head rejects divergent history.
  </details>

  This issue was also found and disclosed responsibly by the Red Team 🟥.

ACKs for top commit:
  151henry151:
    tACK 465bca7
  jeanpablojp:
    tACK 465bca7
  achow101:
    ACK 465bca7
  sedited:
    ACK 465bca7
  maflcko:
    review ACK 465bca7 🥜

Tree-SHA512: 72b8cd9902d881e59a1d99fda8e5d511806826fa27c05a2c21a7d2eb62b2a5a0b1b6bdc67e8d19d57f9171278f4858fd019eb7890b960df0475ba4713683f0ac
777aee7 refactor: deduplicate keypath element parsing (pythcoiner)
7d8fddf refactor: define BIP32_HARDENED and BIP32_UNHARDENED constants (pythcoiner)

Pull request description:

  The codebase used raw `0x80000000` (and implicit `0`) as the bip32 hardened / unhardened flag.

  `ParseHDKeypath` and `ParseKeyPathNum` were two separate parsers for BIP32 keypath elements, bitcoin#32784 aligned their rules (both accept ' and h as hardened marker and reject indexes > 0x7FFFFFFF), but the parsing logic itself was still duplicated.

  This PR:
  - Define `BIP32_HARDENED_FLAG` / `BIP32_UNHARDENED_FLAG` constants to replace magic `0x80000000` and `0` literals.
  - Add `ParseKeyPathElement` as bip32 parsing util and use it consistantly in `ParseHDKeyPath` and the descriptor keypath parser.

ACKs for top commit:
  Sjors:
    ACK 777aee7
  achow101:
    ACK 777aee7

Tree-SHA512: fb096eef82bb5a90baa7de41f5562b935665ee4b64c41586cf89e06c5633be44063a35a89d01a1432c8e63222d94bd06840bafc2a837f252013e317de0f5837a
achow101 and others added 3 commits August 19, 2026 10:47
cf36df0 Wallet: Check crypter return values (benthecarman)
b76afff Wallet: Use unsigned KDF iteration count (benthecarman)

Pull request description:

  CMasterKey::nDeriveIterations values are deserialized from wallet files
  as unsigned 32-bit integers, but key derivation narrowed the count to a
  signed int. A count above INT_MAX became negative in the conversion, and
  the derivation loop counter then overflowed, which is undefined
  behavior.

  Keep the count unsigned through the derivation path to match the
  serialized type, and add tests for zero and normal counts.

  Also check key-derivation calibration failures and validate calculated
  iteration counts before conversion. Keep the output master key unchanged
  until derivation and encryption succeed, and mark fallible crypter
  methods as [[nodiscard]].

ACKs for top commit:
  l0rinc:
    code review ACK cf36df0
  achow101:
    ACK cf36df0

Tree-SHA512: 95d5db2655fef8ca499af7da0f0258b4bee90975468286cb88e424257c4c5bf36407d2b2816b538e2ac3227e2a3a75c8d775211c65fe3ec6d12189da0b05fba1
6d387af psbt: remove write-only global xpub tracking set (Thomas)
3b7051c test: check combinepsbt with conflicting global xpub origins (Thomas)
7c632c0 psbt: avoid duplicate global xpub keys when merging (Thomas)

Pull request description:

  Global xpubs are stored in a map of key origin to set of xpubs, while the serialization writes one record per xpub, keyed by the xpub. `Merge` unions the map origin-by-origin, so when the combined PSBTs provide different key origins for the same xpub, the result serializes the same `PSBT_GLOBAL_XPUB` key twice. BIP 174 declares PSBTs with duplicate keys invalid and the deserializer rejects them, so `combinepsbt` returns a PSBT that no RPC can parse again. This affects all releases since the merge loop was added in bitcoin#17034 (v23.0).

  <details><summary>Reproduction on master</summary>

  The PSBTs share the unsigned transaction and xpub, and differ only in the master fingerprint of the global xpub record (`00000000` vs `11111111`):

  ```
  $ A=cHNidP8BADwCAAAAAaqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqAAAAAAD/////AQAAAAAAAAAAAAAAAABPAQQ1h88AAAAAAAAAAACHPf+BwC9SViP9H+UWfqw6VaBJ3j0xS7Qu4if/7TfVCAM5o2ATMBWX2u9B++WToCzFE9C1VSfsLfEFDi6P9JyFwgQAAAAAAAAA
  $ B=cHNidP8BADwCAAAAAaqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqAAAAAAD/////AQAAAAAAAAAAAAAAAABPAQQ1h88AAAAAAAAAAACHPf+BwC9SViP9H+UWfqw6VaBJ3j0xS7Qu4if/7TfVCAM5o2ATMBWX2u9B++WToCzFE9C1VSfsLfEFDi6P9JyFwgQRERERAAAA
  $ bitcoin-cli -regtest decodepsbt "$(bitcoin-cli -regtest combinepsbt "[\"$A\",\"$B\"]")"
  error code: -22
  error message:
  TX decode failed Duplicate Key, global key "01043587cf00...9c85c2" already provided: iostream error
  ```

  </details>

  Deduplicate by xpub when merging, keeping the origin that is already present: BIP 174 lets the Combiner "pick arbitrarily when conflicts occur", and conflicting unknown and proprietary records are already resolved the same way. The logic is shared between `combinepsbt` and `joinpsbts` through a new `MergeGlobalXPubs` helper. The second commit adds a test that fails on master with the error above, and the last commit removes the `global_xpubs` tracking set in `Unserialize`, write-only since the generic duplicate key check introduced in bitcoin#21283 (1e2d146) replaced the explicit one.

  Note: the xpub loop in `joinpsbts` currently has no observable effect, since the collected xpubs never reach the returned PSBT. My bitcoin#35516 fixes that, so this PR should land first: on its own, bitcoin#35516 would make the same duplicate key issue reachable through `joinpsbts`, while with the shared helper in place it never becomes reachable. I will rebase bitcoin#35516 on top afterwards.

ACKs for top commit:
  Bicaru20:
    tACK 6d387af.
  achow101:
    ACK 6d387af
  winterrdog:
    tACK 6d387af

Tree-SHA512: e2a9e02617eeec22a9240d7cf9386ee880a5f3639b143df7de4d8ea3e7b808f8c123f0b0410ff4a22e9a564bd86b2335a5c4aa3b2281af47d111484a6f1fd108
fanquake and others added 7 commits August 20, 2026 09:49
fa0fe21 test: [refactor] Properly use BOOST_CHECK_EXCEPTION (MarcoFalke)

Pull request description:

  The exception checking in unit tests is partly verbose, fragile, inconsistent and thus confusing.

  Fix all those issues by using `BOOST_CHECK_EXCEPTION` consistently:

  * The test code is less bloated and follows a standard pattern; Extra state and dead code like `exceptionThrown = false;` or `BOOST_CHECK(0)` can be removed.
  * The checks are more strict, because they use `HasReason{...}` or a similar predicate.

ACKs for top commit:
  l0rinc:
    ACK fa0fe21
  janb84:
    ACK fa0fe21
  jonatack:
    Light ACK fa0fe21

Tree-SHA512: f3a9abfe02988299f6d2604643feb630e078c2177287899d4fcc191802536d41d09e6365d81d0184bf3533583987969cb1b85ab3e112e7364fdb5b85a3405cb7
Steps to reproduce the diff:
```
cmake --preset dev-mode
cmake --build build_dev_mode --target translate
```
… to weak_ptr

15e5c35 doc: Correct comments after HTTPRequest::m_client was changed from shared to weak pointer (Hodlinator)

Pull request description:

  There were lingering comments from when `HTTPRequest::m_client` was a `shared_ptr`.
  Prompted by bitcoin#36007 (comment).

  Follow-up to bitcoin#36007.

ACKs for top commit:
  winterrdog:
    ACK 15e5c35

Tree-SHA512: 021427258e46d2a6a19f5304167c957084b174a4f1fd0e223605f9b06ee771225d023e5f546db9045e1bfdfd5558f933e54d9ee76e5393949612628be9815bc4
…Line on empty command

fef99e6 qt: fix out-of-bounds read in RPCParseCommandLine on empty command (sayed nabhan)

Pull request description:

  When a console line has no command name (it starts with `)`, or is `()`, `(`, or `,`), RPCParseCommandLine reaches the command-execution branch while the current argument frame is still empty, so `stack.back()[0]` reads out of bounds and the argument list built from `stack.back().begin() + 1` to `end()` is an invalid iterator range (throws std::length_error in practice, UBSan flags the null-pointer reference otherwise).

  The `(` branch already guards the frame with `stack.back().size() > 0`, so I add the same check to the `)`/newline branch and the empty frame is skipped. To be clear, `(` alone isn't safe on master either: it fails via the `\n` branch, not via the `(` branch itself (the state there isn't `STATE_ARGUMENT`), and `,` alone fails the same way.

  Since there's no command to run in any of these cases, the parser now returns `false` so the console reports an invalid command line, consistent with other fully-invalid input like a bare `'` or `"`, rather than silently ignoring it.

  Regression cases added to rpcNestedTests for `)`, `()`, `(` and `,` (all abort on master without the guard), plus `getblockchaininfo)` which stays tolerated.

ACKs for top commit:
  hebasto:
    ACK fef99e6, tested on Ubuntu 26.04.

Tree-SHA512: 15822a0525402878483d5b2d0fe7b9e27916e514c1a8ad4a697f11b1e5cfe33f5fcd1f089efefb976bcf0d84cdf5166a58a070593924c2d4c2e1f8224d06590f
5a431c9 qt: Update `src/qt/locale/bitcoin_en.ts` translation source file (Hennadii Stepanov)

Pull request description:

  This PR follows our [Release Process](https://github.com/bitcoin/bitcoin/blob/4df077d7cd32c71646a85a2464a58c322a0cee11/doc/release-process.md).

  It is required for the translation string freeze, as bitcoin-core/gui#957 introduced a new translatable string after the soft translation string freeze.

  Steps to reproduce the diff:
  ```console
  cmake --preset dev-mode
  cmake --build build_dev_mode --target translate
  ```

ACKs for top commit:
  polespinasa:
    ACK 5a431c9

Tree-SHA512: 89ee1721c5091fa0deb11f9c014515846b8af781c03d3aaed2ff757e475927d5e9bd5a16a496de0f5269e6371f2ad27d5065ef656c9376793332a05aa707272b
fa8762d build: ci/doc win64-cross build via nix (MarcoFalke)
fafe720 doc: Clarify that cygwin/msys2 are not tested/supported (MarcoFalke)

Pull request description:

  Release cross-builds to win64 are done in guix. There are also docs to use Debian/Ubuntu for those cross-builds and this approach is used in CI. However, there are many problems:

  * The CI is intended to mirror the guix build, but often it is not possible to find the major versions used for mingw and GCC in the guix build in the `apt` packages for an LTS distro.
  * Users on older distro releases may lack released bugfixes, such as mingw-w64/mingw-w64@8e06daa in mingw 13  (e.g. Debian Trixie with mingw 12, https://packages.debian.org/trixie/mingw-w64-x86-64-dev).
  * When using the UCRT variant of the build, this uncovers bugs such as https://bugs.launchpad.net/ubuntu/+source/mingw-w64/+bug/2106420 or https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1121403.

  So add a way to use nix to do the cross build. This allows to closer mimic the guix build.

  Also, clarify that cygwin/msys2 are not tested/supported.

ACKs for top commit:
  willcl-ark:
    reACK fa8762d
  hebasto:
    re-ACK fa8762d.

Tree-SHA512: de94f8bc4bb6ed9a75352cd909aa227c5954e336bf9b14969d7412b5cedfbe6cd6b2d8b476d5b1b0bcfc93bdb32fc229015855082350c8c507189e34b9b3ef3f
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 bitcoin#36026

Co-authored-by: MarcoFalke <*~=`'#}+{/-|&$^[email protected]>
@l0rinc
l0rinc force-pushed the l0rinc/test-kernel-sigaltstack branch from b2236a5 to 9eba3aa Compare August 20, 2026 17:12
@l0rinc l0rinc closed this Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.