Repository: bitcoin/bitcoin (language: cpp)

Issue:
qt: Windows build with DEBUG=1 is broken
If you try and cross-compile for Windows using master (d04324a7056a735c1127ba8ccdc720a16e7281a3) `DEBUG=1`, it fails. This is on a Ubuntu Noble machine, with `x86_64-w64-mingw32-g++ (GCC) 13-win32`. Noticed in #29527.
```bash
make -C depends HOST=x86_64-w64-mingw32 DEBUG=1 -j17
<snip>
Checking for STL compatibility... 
+ cd /root/ci_scratch/depends/work/build/x86_64-w64-mingw32/qt/5.15.11-8c515c34c2a/config.tests/stl && PKG_CONFIG_SYSROOT_DIR=/ PKG_CONFIG_LIBDIR=/root/ci_scratch/depends/x86_64-w64-mingw32/lib/pkgconfig /root/ci_scratch/depends/work/build/x86_64-w64-mingw32/qt/5.15.11-8c515c34c2a/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += static warn_off console single_arch" 'QMAKE_CFLAGS = '\''-pipe -std=c11 -O1 -g  -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC -I/root/ci_scratch/depends/x86_64-w64-mingw32/include'\''' 'QMAKE_CXX = '\''x86_64-w64-mingw32-g++-posix'\''' 'QMAKE_CXXFLAGS = '\''-pipe -std=c++20 -O1 -g  -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC -I/root/ci_scratch/depends/x86_64-w64-mingw32/include'\''' 'QMAKE_LFLAGS = '\''  -L/root/ci_scratch/depends/x86_64-w64-mingw32/lib'\''' 'QMAKE_LIB = '\''x86_64-w64-mingw32-ar rc'\''' -early "CONFIG += cross_compile" /root/ci_scratch/depends/work/build/x86_64-w64-mingw32/qt/5.15.11-8c515c34c2a/qtbase/config.tests/stl
+ cd /root/ci_scratch/depends/work/build/x86_64-w64-mingw32/qt/5.15.11-8c515c34c2a/config.tests/stl && MAKEFLAGS= /usr/bin/gmake
> gmake[1]: Entering directory '/root/ci_scratch/depends/work/build/x86_64-w64-mingw32/qt/5.15.11-8c515c34c2a/config.tests/stl'
> x86_64-w64-mingw32-g++-posix -c -pipe -std=c++20 -O1 -g  -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC -I/root/ci_scratch/depends/x86_64-w64-mingw32/include -O2 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I/root/ci_scratch/depends/work/build/x86_64-w64-mingw32/qt/5.15.11-8c515c34c2a/qtbase/config.tests/stl -I. -I/root/ci_scratch/depends/work/build/x86_64-w64-mingw32/qt/5.15.11-8c515c34c2a/qtbase/mkspecs/win32-g++  -o stltest.o /root/ci_scratch/depends/work/build/x86_64-w64-mingw32/qt/5.15.11-8c515c34c2a/qtbase/config.tests/stl/stltest.cpp
> x86_64-w64-mingw32-g++ -L/root/ci_scratch/depends/x86_64-w64-mingw32/lib -Wl,-s -Wl,-subsystem,console -mthreads -o stl.exe stltest.o  
> /usr/bin/x86_64-w64-mingw32-ld: stltest.o: in function `__gthread_mutex_lock':
> /usr/lib/gcc/x86_64-w64-mingw32/13-posix/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:749:(.text+0x809): undefined reference to `pthread_mutex_lock'
> /usr/bin/x86_64-w64-mingw32-ld: stltest.o: in function `__gthread_mutex_unlock':
> /usr/lib/gcc/x86_64-w64-mingw32/13-posix/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779:(.text+0x81d): undefined reference to `pthread_mutex_unlock'
> /usr/bin/x86_64-w64-mingw32-ld: stltest.o: in function `__gthread_mutex_lock':
> /usr/lib/gcc/x86_64-w64-mingw32/13-posix/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:749:(.text$_ZSt4findIN11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPiNSt9__cxx19986vectorIiSaIiEEEEENSt7__debug6vectorIiS7_EESt26random_access_iterator_tagEEiET_SF_SF_RKT0_[_ZSt4findIN11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPiNSt9__cxx19986vectorIiSaIiEEEEENSt7__debug6vectorIiS7_EESt26random_access_iterator_tagEEiET_SF_SF_RKT0_]+0x2ce): undefined reference to `pthread_mutex_lock'
> /usr/bin/x86_64-w64-mingw32-ld: stltest.o: in function `__gthread_mutex_unlock':
> /usr/lib/gcc/x86_64-w64-mingw32/13-posix/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779:(.text$_ZSt4findIN11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPiNSt9__cxx19986vectorIiSaIiEEEEENSt7__debug6vectorIiS7_EESt26random_access_iterator_tagEEiET_SF_SF_RKT0_[_ZSt4findIN11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPiNSt9__cxx19986vectorIiSaIiEEEEENSt7__debug6vectorIiS7_EESt26random_access_iterator_tagEEiET_SF_SF_RKT0_]+0x2e7): undefined reference to `pthread_mutex_unlock'
> /usr/bin/x86_64-w64-mingw32-ld: stltest.o: in function `__gthread_mutex_lock':
> /usr/lib/gcc/x86_64-w64-mingw32/13-posix/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:749:(.text$_ZSt4findIN11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPiNSt9__cxx19986vectorIiSaIiEEEEENSt7__debug6vectorIiS7_EESt26random_access_iterator_tagEEiET_SF_SF_RKT0_[_ZSt4findIN11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPiNSt9__cxx19986vectorIiSaIiEEEEENSt7__debug6vectorIiS7_EESt26random_access_iterator_tagEEiET_SF_SF_RKT0_]+0x3c0): undefined reference to `pthread_mutex_lock'
> /usr/bin/x86_64-w64-mingw32-ld: stltest.o: in function `__gthread_mutex_unlock':
> /usr/lib/gcc/x86_64-w64-mingw32/13-posix/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779:(.text$_ZSt4findIN11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPiNSt9__cxx19986vectorIiSaIiEEEEENSt7__debug6vectorIiS7_EESt26random_access_iterator_tagEEiET_SF_SF_RKT0_[_ZSt4findIN11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPiNSt9__cxx19986vectorIiSaIiEEEEENSt7__debug6vectorIiS7_EESt26random_access_iterator_tagEEiET_SF_SF_RKT0_]+0x3d9): undefined reference to `pthread_mutex_unlock'
> /usr/bin/x86_64-w64-mingw32-ld: stltest.o: in function `__gthread_mutex_lock':
> /usr/lib/gcc/x86_64-w64-mingw32/13-posix/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:749:(.text$_ZSt4findIN11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPiNSt9__cxx19986vectorIiSaIiEEEEENSt7__debug6vectorIiS7_EESt26random_access_iterator_tagEEiET_SF_SF_RKT0_[_ZSt4findIN11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPiNSt9__cxx19986vectorIiSaIiEEEEENSt7__debug6vectorIiS7_EESt26random_access_iterator_tagEEiET_SF_SF_RKT0_]+0x4b6): undefined reference to `pthread_mutex_lock'
> /usr/bin/x86_64-w64-mingw32-ld: stltest.o: in function `__gthread_mutex_unlock':
> /usr/lib/gcc/x86_64-w64-mingw32/13-posix/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779:(.text$_ZSt4findIN11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPiNSt9__cxx19986vectorIiSaIiEEEEENSt7__debug6vectorIiS7_EESt26random_access_iterator_tagEEiET_SF_SF_RKT0_[_ZSt4findIN11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPiNSt9__cxx19986vectorIiSaIiEEEEENSt7__debug6vectorIiS7_EESt26random_access_iterator_tagEEiET_SF_SF_RKT0_]+0x4cf): undefined reference to `pthread_mutex_unlock'
> /usr/bin/x86_64-w64-mingw32-ld: stltest.o: in function `__gthread_mutex_lock':
> /usr/lib/gcc/x86_64-w64-mingw32/13-posix/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:749:(.text$_ZSt4findIN11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPiNSt9__cxx19986vectorIiSaIiEEEEENSt7__debug6vectorIiS7_EESt26random_access_iterator_tagEEiET_SF_SF_RKT0_[_ZSt4findIN11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPiNSt9__cxx19986vectorIiSaIiEEEEENSt7__debug6vectorIiS7_EESt26random_access_iterator_tagEEiET_SF_SF_RKT0_]+0x5ac): undefined reference to `pthread_mutex_lock'
> /usr/bin/x86_64-w64-mingw32-ld: stltest.o: in function `__gthread_mutex_unlock':
> /usr/lib/gcc/x86_64-w64-mingw32/13-posix/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779:(.text$_ZSt4findIN11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPiNSt9__cxx19986vectorIiSaIiEEEEENSt7__debug6vectorIiS7_EESt26random_access_iterator_tagEEiET_SF_SF_RKT0_[_ZSt4findIN11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPiNSt9__cxx19986vectorIiSaIiEEEEENSt7__debug6vectorIiS7_EESt26random_access_iterator_tagEEiET_SF_SF_RKT0_]+0x5c5): undefined reference to `pthread_mutex_unlock'
> /usr/bin/x86_64-w64-mingw32-ld: stltest.o: in function `__gthread_mutex_lock':
> /usr/lib/gcc/x86_64-w64-mingw32/13-posix/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:749:(.text$_ZSt13__copy_move_aILb0EN9__gnu_cxx17__normal_iteratorIPiNSt9__cxx19986vectorIiSaIiEEEEENSt7__debug6vectorIiS5_EESt26random_access_iterator_tagSt20back_insert_iteratorISA_EET3_RKN11__gnu_debug14_Safe_iteratorIT0_T1_T2_EESM_SE_[_ZSt13__copy_move_aILb0EN9__gnu_cxx17__normal_iteratorIPiNSt9__cxx19986vectorIiSaIiEEEEENSt7__debug6vectorIiS5_EESt26random_access_iterator_tagSt20back_insert_iteratorISA_EET3_RKN11__gnu_debug14_Safe_iteratorIT0_T1_T2_EESM_SE_]+0x352): undefined reference to `pthread_mutex_lock'
> /usr/bin/x86_64-w64-mingw32-ld: stltest.o: in function `__gthread_mutex_unlock':
> /usr/lib/gcc/x86_64-w64-mingw32/13-posix/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779:(.text$_ZSt13__copy_move_aILb0EN9__gnu_cxx17__normal_iteratorIPiNSt9__cxx19986vectorIiSaIiEEEEENSt7__debug6vectorIiS5_EESt26random_access_iterator_tagSt20back_insert_iteratorISA_EET3_RKN11__gnu_debug14_Safe_iteratorIT0_T1_T2_EESM_SE_[_ZSt13__copy_move_aILb0EN9__gnu_cxx17__normal_iteratorIPiNSt9__cxx19986vectorIiSaIiEEEEENSt7__debug6vectorIiS5_EESt26random_access_iterator_tagSt20back_insert_iteratorISA_EET3_RKN11__gnu_debug14_Safe_iteratorIT0_T1_T2_EESM_SE_]+0x36b): undefined reference to `pthread_mutex_unlock'
> /usr/bin/x86_64-w64-mingw32-ld: stltest.o: in function `__gthread_mutex_lock':
> /usr/lib/gcc/x86_64-w64-mingw32/13-posix/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:749:(.text.startup+0x60b): undefined reference to `pthread_mutex_lock'
> /usr/bin/x86_64-w64-mingw32-ld: stltest.o: in function `__gthread_mutex_unlock':
> /usr/lib/gcc/x86_64-w64-mingw32/13-posix/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779:(.text.startup+0x62a): undefined reference to `pthread_mutex_unlock'
> /usr/bin/x86_64-w64-mingw32-ld: stltest.o: in function `__gthread_mutex_lock':
> /usr/lib/gcc/x86_64-w64-mingw32/13-posix/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:749:(.text.startup+0x84b): undefined reference to `pthread_mutex_lock'
> /usr/bin/x86_64-w64-mingw32-ld: stltest.o: in function `__gthread_mutex_unlock':
> /usr/lib/gcc/x86_64-w64-mingw32/13-posix/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:779:(.text.startup+0x879): undefined reference to `pthread_mutex_unlock'
> collect2: error: ld returned 1 exit status
> gmake[1]: *** [Makefile:69: stl.exe] Error 1
> gmake[1]: Leaving directory '/root/ci_scratch/depends/work/build/x86_64-w64-mingw32/qt/5.15.11-8c515c34c2a/config.tests/stl'
test config.qtbase.tests.stl FAILED
<snip>
Note: Using static linking will disable the use of dynamically
loaded plugins. Make sure to import all needed static plugins,
or compile needed modules into the library.

ERROR: Qt requires a compliant STL library.
make: *** [funcs.mk:298: /root/ci_scratch/depends/x86_64-w64-mingw32/.qt_stamp_configured] Error 3
make: Leaving directory '/root/ci_scratch/depends'
```
ThreadSanitizer: data race src/flatfile.cpp:47:13 in FlatFileSeq::Open(FlatFilePos const&, bool)
https://cirrus-ci.com/task/6414638208778240?logs=ci#L2908

```
 node2 2024-03-30T00:33:41.792784Z [txindex] [util/thread.cpp:20] [TraceThread] txindex thread start 
 node2 2024-03-30T00:33:41.792859Z [scheduler] [validationinterface.cpp:183] [operator()] [validation] UpdatedBlockTip: new block hash=7883788f39770ef5ae6f0f4ecee37802d50a6f0dacada65d6a8ea02f3af90c3c fork block hash=62b1edabd87390a81142c653e6e6f6543c99c6be5e63f48697d37267c0bf86fe (in IBD=true) 
 node2 2024-03-30T00:33:41.792975Z [scheduler] [validationinterface.cpp:222] [operator()] [validation] MempoolTransactionsRemovedForBlock: block height=398 txs removed=0 
 node2 2024-03-30T00:33:41.793076Z [basic block filter index] [util/thread.cpp:20] [TraceThread] basic block filter index thread start 
 node2 2024-03-30T00:33:41.793139Z [scheduler] [validationinterface.cpp:212] [operator()] [validation] BlockConnected: block hash=74b216909b0a33a9beef910bf3a85e52ba4876a83cc74a657f72c908cf623ad3 block height=398 
 node2 2024-03-30T00:33:41.793226Z [txindex] [index/base.cpp:209] [Sync] txindex is enabled at height 399 
 node2 2024-03-30T00:33:41.793341Z [txindex] [util/thread.cpp:22] [TraceThread] txindex thread exit 
 node2 2024-03-30T00:33:41.793397Z [initload] [util/thread.cpp:22] [TraceThread] initload thread exit 
 node2 2024-03-30T00:33:41.793516Z [coinstatsindex] [util/thread.cpp:20] [TraceThread] coinstatsindex thread start 
 node2 2024-03-30T00:33:41.793821Z [coinstatsindex] [index/base.cpp:209] [Sync] coinstatsindex is enabled at height 399 
 node2 2024-03-30T00:33:41.793850Z [coinstatsindex] [util/thread.cpp:22] [TraceThread] coinstatsindex thread exit 
 node2 2024-03-30T00:33:41.836832Z [http] [httpserver.cpp:306] [http_request_cb] [http] Received a POST request for / from 127.0.0.1:40794 
 test  2024-03-30T00:33:42.739000Z TestFramework (ERROR): Unexpected exception caught during testing 
                                   Traceback (most recent call last):
                                     File "/ci_container_base/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 132, in main
                                       self.run_test()
                                     File "/ci_container_base/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/feature_assumeutxo.py", line 419, in run_test
                                       self.restart_node(2, extra_args=[
                                     File "/ci_container_base/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 598, in restart_node
                                       self.start_node(i, extra_args)
                                     File "/ci_container_base/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 550, in start_node
                                       node.wait_for_rpc_connection()
                                     File "/ci_container_base/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/test_node.py", line 255, in wait_for_rpc_connection
                                       raise FailedToStartError(self._node_msg(
                                   test_framework.test_node.FailedToStartError: [node 2] bitcoind exited with status 66 during initialization. ==================
                                   WARNING: ThreadSanitizer: data race (pid=47449)
                                     Read of size 4 at 0x7b4800003b64 by thread T16:
                                       #0 FlatFileSeq::Open(FlatFilePos const&, bool) src/flatfile.cpp:47:13 (bitcoind+0x649c9f) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #1 BlockFilterIndex::CustomCommit(CDBBatch&) src/index/blockfilterindex.cpp:149:37 (bitcoind+0x687929) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #2 BaseIndex::Commit() src/index/base.cpp:222:14 (bitcoind+0x67fde7) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #3 BaseIndex::Sync() src/index/base.cpp:167:17 (bitcoind+0x67f6d0) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #4 BaseIndex::StartBackgroundSync()::$_0::operator()() const src/index/base.cpp:394:73 (bitcoind+0x6828f5) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #5 decltype(std::declval<BaseIndex::StartBackgroundSync()::$_0&>()()) std::__1::__invoke[abi:ue170006]<BaseIndex::StartBackgroundSync()::$_0&>(BaseIndex::StartBackgroundSync()::$_0&) /usr/lib/llvm-17/bin/../include/c++/v1/__type_traits/invoke.h:340:25 (bitcoind+0x6828f5)
                                       #6 void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:ue170006]<BaseIndex::StartBackgroundSync()::$_0&>(BaseIndex::StartBackgroundSync()::$_0&) /usr/lib/llvm-17/bin/../include/c++/v1/__type_traits/invoke.h:415:5 (bitcoind+0x6828f5)
                                       #7 std::__1::__function::__alloc_func<BaseIndex::StartBackgroundSync()::$_0, std::__1::allocator<BaseIndex::StartBackgroundSync()::$_0>, void ()>::operator()[abi:ue170006]() /usr/lib/llvm-17/bin/../include/c++/v1/__functional/function.h:192:16 (bitcoind+0x6828f5)
                                       #8 std::__1::__function::__func<BaseIndex::StartBackgroundSync()::$_0, std::__1::allocator<BaseIndex::StartBackgroundSync()::$_0>, void ()>::operator()() /usr/lib/llvm-17/bin/../include/c++/v1/__functional/function.h:363:12 (bitcoind+0x6828f5)
                                       #9 std::__1::__function::__value_func<void ()>::operator()[abi:ue170006]() const /usr/lib/llvm-17/bin/../include/c++/v1/__functional/function.h:517:16 (bitcoind+0xb3acd5) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #10 std::__1::function<void ()>::operator()() const /usr/lib/llvm-17/bin/../include/c++/v1/__functional/function.h:1168:12 (bitcoind+0xb3acd5)
                                       #11 util::TraceThread(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>) src/util/thread.cpp:21:9 (bitcoind+0xb3acd5)
                                       #12 decltype(std::declval<void (*)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>)>()(std::declval<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>(), std::declval<BaseIndex::StartBackgroundSync()::$_0>())) std::__1::__invoke[abi:ue170006]<void (*)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>), std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, BaseIndex::StartBackgroundSync()::$_0>(void (*&&)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>), std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&&, BaseIndex::StartBackgroundSync()::$_0&&) /usr/lib/llvm-17/bin/../include/c++/v1/__type_traits/invoke.h:340:25 (bitcoind+0x6824a4) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #13 void std::__1::__thread_execute[abi:ue170006]<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (*)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>), std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, BaseIndex::StartBackgroundSync()::$_0, 2ul, 3ul>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (*)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>), std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, BaseIndex::StartBackgroundSync()::$_0>&, std::__1::__tuple_indices<2ul, 3ul>) /usr/lib/llvm-17/bin/../include/c++/v1/__thread/thread.h:221:5 (bitcoind+0x6824a4)
                                       #14 void* std::__1::__thread_proxy[abi:ue170006]<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (*)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>), std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, BaseIndex::StartBackgroundSync()::$_0>>(void*) /usr/lib/llvm-17/bin/../include/c++/v1/__thread/thread.h:232:5 (bitcoind+0x6824a4)
                                     Previous write of size 4 at 0x7b4800003b64 by thread T1:
                                       #0 BlockFilterIndex::Write(BlockFilter const&, unsigned int, uint256 const&) src/index/blockfilterindex.cpp:287:28 (bitcoind+0x68a60a) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #1 BlockFilterIndex::CustomAppend(interfaces::BlockInfo const&) src/index/blockfilterindex.cpp:267:16 (bitcoind+0x68a101) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #2 BaseIndex::BlockConnected(ChainstateRole, std::__1::shared_ptr<CBlock const> const&, CBlockIndex const*) src/index/base.cpp:303:9 (bitcoind+0x680ce9) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #3 ValidationSignals::BlockConnected(ChainstateRole, std::__1::shared_ptr<CBlock const> const&, CBlockIndex const*)::$_0::operator()() const::'lambda'(CValidationInterface&)::operator()(CValidationInterface&) const src/validationinterface.cpp:208:79 (bitcoind+0x5f3607) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #4 void ValidationSignalsImpl::Iterate<ValidationSignals::BlockConnected(ChainstateRole, std::__1::shared_ptr<CBlock const> const&, CBlockIndex const*)::$_0::operator()() const::'lambda'(CValidationInterface&)>(ValidationSignals::BlockConnected(ChainstateRole, std::__1::shared_ptr<CBlock const> const&, CBlockIndex const*)::$_0::operator()() const::'lambda'(CValidationInterface&)&&) src/validationinterface.cpp:88:17 (bitcoind+0x5f3607)
                                       #5 ValidationSignals::BlockConnected(ChainstateRole, std::__1::shared_ptr<CBlock const> const&, CBlockIndex const*)::$_0::operator()() const src/validationinterface.cpp:208:22 (bitcoind+0x5f3607)
                                       #6 ValidationSignals::BlockConnected(ChainstateRole, std::__1::shared_ptr<CBlock const> const&, CBlockIndex const*)::$_1::operator()() const src/validationinterface.cpp:210:5 (bitcoind+0x5f3607)
                                       #7 decltype(std::declval<ValidationSignals::BlockConnected(ChainstateRole, std::__1::shared_ptr<CBlock const> const&, CBlockIndex const*)::$_1&>()()) std::__1::__invoke[abi:ue170006]<ValidationSignals::BlockConnected(ChainstateRole, std::__1::shared_ptr<CBlock const> const&, CBlockIndex const*)::$_1&>(ValidationSignals::BlockConnected(ChainstateRole, std::__1::shared_ptr<CBlock const> const&, CBlockIndex const*)::$_1&) /usr/lib/llvm-17/bin/../include/c++/v1/__type_traits/invoke.h:340:25 (bitcoind+0x5f3607)
                                       #8 void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:ue170006]<ValidationSignals::BlockConnected(ChainstateRole, std::__1::shared_ptr<CBlock const> const&, CBlockIndex const*)::$_1&>(ValidationSignals::BlockConnected(ChainstateRole, std::__1::shared_ptr<CBlock const> const&, CBlockIndex const*)::$_1&) /usr/lib/llvm-17/bin/../include/c++/v1/__type_traits/invoke.h:415:5 (bitcoind+0x5f3607)
                                       #9 std::__1::__function::__alloc_func<ValidationSignals::BlockConnected(ChainstateRole, std::__1::shared_ptr<CBlock const> const&, CBlockIndex const*)::$_1, std::__1::allocator<ValidationSignals::BlockConnected(ChainstateRole, std::__1::shared_ptr<CBlock const> const&, CBlockIndex const*)::$_1>, void ()>::operator()[abi:ue170006]() /usr/lib/llvm-17/bin/../include/c++/v1/__functional/function.h:192:16 (bitcoind+0x5f3607)
                                       #10 std::__1::__function::__func<ValidationSignals::BlockConnected(ChainstateRole, std::__1::shared_ptr<CBlock const> const&, CBlockIndex const*)::$_1, std::__1::allocator<ValidationSignals::BlockConnected(ChainstateRole, std::__1::shared_ptr<CBlock const> const&, CBlockIndex const*)::$_1>, void ()>::operator()() /usr/lib/llvm-17/bin/../include/c++/v1/__functional/function.h:363:12 (bitcoind+0x5f3607)
                                       #11 std::__1::__function::__value_func<void ()>::operator()[abi:ue170006]() const /usr/lib/llvm-17/bin/../include/c++/v1/__functional/function.h:517:16 (bitcoind+0xa3adbf) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #12 std::__1::function<void ()>::operator()() const /usr/lib/llvm-17/bin/../include/c++/v1/__functional/function.h:1168:12 (bitcoind+0xa3adbf)
                                       #13 SerialTaskRunner::ProcessQueue() src/scheduler.cpp:173:5 (bitcoind+0xa3adbf)
                                       #14 SerialTaskRunner::MaybeScheduleProcessQueue()::$_0::operator()() const src/scheduler.cpp:142:41 (bitcoind+0xa3cd15) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #15 decltype(std::declval<SerialTaskRunner::MaybeScheduleProcessQueue()::$_0&>()()) std::__1::__invoke[abi:ue170006]<SerialTaskRunner::MaybeScheduleProcessQueue()::$_0&>(SerialTaskRunner::MaybeScheduleProcessQueue()::$_0&) /usr/lib/llvm-17/bin/../include/c++/v1/__type_traits/invoke.h:340:25 (bitcoind+0xa3cd15)
                                       #16 void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:ue170006]<SerialTaskRunner::MaybeScheduleProcessQueue()::$_0&>(SerialTaskRunner::MaybeScheduleProcessQueue()::$_0&) /usr/lib/llvm-17/bin/../include/c++/v1/__type_traits/invoke.h:415:5 (bitcoind+0xa3cd15)
                                       #17 std::__1::__function::__alloc_func<SerialTaskRunner::MaybeScheduleProcessQueue()::$_0, std::__1::allocator<SerialTaskRunner::MaybeScheduleProcessQueue()::$_0>, void ()>::operator()[abi:ue170006]() /usr/lib/llvm-17/bin/../include/c++/v1/__functional/function.h:192:16 (bitcoind+0xa3cd15)
                                       #18 std::__1::__function::__func<SerialTaskRunner::MaybeScheduleProcessQueue()::$_0, std::__1::allocator<SerialTaskRunner::MaybeScheduleProcessQueue()::$_0>, void ()>::operator()() /usr/lib/llvm-17/bin/../include/c++/v1/__functional/function.h:363:12 (bitcoind+0xa3cd15)
                                       #19 std::__1::__function::__value_func<void ()>::operator()[abi:ue170006]() const /usr/lib/llvm-17/bin/../include/c++/v1/__functional/function.h:517:16 (bitcoind+0xa39b64) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #20 std::__1::function<void ()>::operator()() const /usr/lib/llvm-17/bin/../include/c++/v1/__functional/function.h:1168:12 (bitcoind+0xa39b64)
                                       #21 CScheduler::serviceQueue() src/scheduler.cpp:60:17 (bitcoind+0xa39b64)
                                       #22 AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_3::operator()() const src/init.cpp:1165:94 (bitcoind+0x1ac325) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #23 decltype(std::declval<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_3&>()()) std::__1::__invoke[abi:ue170006]<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_3&>(AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_3&) /usr/lib/llvm-17/bin/../include/c++/v1/__type_traits/invoke.h:340:25 (bitcoind+0x1ac325)
                                       #24 void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:ue170006]<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_3&>(AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_3&) /usr/lib/llvm-17/bin/../include/c++/v1/__type_traits/invoke.h:415:5 (bitcoind+0x1ac325)
                                       #25 std::__1::__function::__alloc_func<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_3, std::__1::allocator<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_3>, void ()>::operator()[abi:ue170006]() /usr/lib/llvm-17/bin/../include/c++/v1/__functional/function.h:192:16 (bitcoind+0x1ac325)
                                       #26 std::__1::__function::__func<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_3, std::__1::allocator<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_3>, void ()>::operator()() /usr/lib/llvm-17/bin/../include/c++/v1/__functional/function.h:363:12 (bitcoind+0x1ac325)
                                       #27 std::__1::__function::__value_func<void ()>::operator()[abi:ue170006]() const /usr/lib/llvm-17/bin/../include/c++/v1/__functional/function.h:517:16 (bitcoind+0xb3acd5) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #28 std::__1::function<void ()>::operator()() const /usr/lib/llvm-17/bin/../include/c++/v1/__functional/function.h:1168:12 (bitcoind+0xb3acd5)
                                       #29 util::TraceThread(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>) src/util/thread.cpp:21:9 (bitcoind+0xb3acd5)
                                       #30 decltype(std::declval<void (*)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>)>()(std::declval<char const*>(), std::declval<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_3>())) std::__1::__invoke[abi:ue170006]<void (*)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>), char const*, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_3>(void (*&&)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>), char const*&&, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_3&&) /usr/lib/llvm-17/bin/../include/c++/v1/__type_traits/invoke.h:340:25 (bitcoind+0x1abf1c) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #31 void std::__1::__thread_execute[abi:ue170006]<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (*)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>), char const*, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_3, 2ul, 3ul>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (*)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>), char const*, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_3>&, std::__1::__tuple_indices<2ul, 3ul>) /usr/lib/llvm-17/bin/../include/c++/v1/__thread/thread.h:221:5 (bitcoind+0x1abf1c)
                                       #32 void* std::__1::__thread_proxy[abi:ue170006]<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (*)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>), char const*, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_3>>(void*) /usr/lib/llvm-17/bin/../include/c++/v1/__thread/thread.h:232:5 (bitcoind+0x1abf1c)
                                     Location is heap block of size 352 at 0x7b4800003a80 allocated by main thread:
                                       #0 operator new(unsigned long) <null> (bitcoind+0x1811ab) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #1 void* std::__1::__libcpp_operator_new[abi:ue170006]<unsigned long>(unsigned long) /usr/lib/llvm-17/bin/../include/c++/v1/new:268:10 (bitcoind+0x692f8f) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #2 std::__1::__libcpp_allocate[abi:ue170006](unsigned long, unsigned long) /usr/lib/llvm-17/bin/../include/c++/v1/new:294:10 (bitcoind+0x692f8f)
                                       #3 std::__1::allocator<std::__1::__tree_node<std::__1::__value_type<BlockFilterType, BlockFilterIndex>, void*>>::allocate[abi:ue170006](unsigned long) /usr/lib/llvm-17/bin/../include/c++/v1/__memory/allocator.h:114:38 (bitcoind+0x692f8f)
                                       #4 std::__1::allocator_traits<std::__1::allocator<std::__1::__tree_node<std::__1::__value_type<BlockFilterType, BlockFilterIndex>, void*>>>::allocate[abi:ue170006](std::__1::allocator<std::__1::__tree_node<std::__1::__value_type<BlockFilterType, BlockFilterIndex>, void*>>&, unsigned long) /usr/lib/llvm-17/bin/../include/c++/v1/__memory/allocator_traits.h:268:20 (bitcoind+0x692f8f)
                                       #5 std::__1::unique_ptr<std::__1::__tree_node<std::__1::__value_type<BlockFilterType, BlockFilterIndex>, void*>, std::__1::__tree_node_destructor<std::__1::allocator<std::__1::__tree_node<std::__1::__value_type<BlockFilterType, BlockFilterIndex>, void*>>>> std::__1::__tree<std::__1::__value_type<BlockFilterType, BlockFilterIndex>, std::__1::__map_value_compare<BlockFilterType, std::__1::__value_type<BlockFilterType, BlockFilterIndex>, std::__1::less<BlockFilterType>, true>, std::__1::allocator<std::__1::__value_type<BlockFilterType, BlockFilterIndex>>>::__construct_node<std::__1::piecewise_construct_t const&, std::__1::tuple<BlockFilterType&>, std::__1::tuple<std::__1::unique_ptr<interfaces::Chain, std::__1::default_delete<interfaces::Chain>>&&, BlockFilterType&, unsigned long&, bool&, bool&>>(std::__1::piecewise_construct_t const&, std::__1::tuple<BlockFilterType&>&&, std::__1::tuple<std::__1::unique_ptr<interfaces::Chain, std::__1::default_delete<interfaces::Chain>>&&, BlockFilterType&, unsigned long&, bool&, bool&>&&) /usr/lib/llvm-17/bin/../include/c++/v1/__tree:2143:23 (bitcoind+0x692f8f)
                                       #6 std::__1::pair<std::__1::__tree_iterator<std::__1::__value_type<BlockFilterType, BlockFilterIndex>, std::__1::__tree_node<std::__1::__value_type<BlockFilterType, BlockFilterIndex>, void*>*, long>, bool> std::__1::__tree<std::__1::__value_type<BlockFilterType, BlockFilterIndex>, std::__1::__map_value_compare<BlockFilterType, std::__1::__value_type<BlockFilterType, BlockFilterIndex>, std::__1::less<BlockFilterType>, true>, std::__1::allocator<std::__1::__value_type<BlockFilterType, BlockFilterIndex>>>::__emplace_unique_impl<std::__1::piecewise_construct_t const&, std::__1::tuple<BlockFilterType&>, std::__1::tuple<std::__1::unique_ptr<interfaces::Chain, std::__1::default_delete<interfaces::Chain>>&&, BlockFilterType&, unsigned long&, bool&, bool&>>(std::__1::piecewise_construct_t const&, std::__1::tuple<BlockFilterType&>&&, std::__1::tuple<std::__1::unique_ptr<interfaces::Chain, std::__1::default_delete<interfaces::Chain>>&&, BlockFilterType&, unsigned long&, bool&, bool&>&&) /usr/lib/llvm-17/bin/../include/c++/v1/__tree:2155:25 (bitcoind+0x692d9b) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #7 std::__1::pair<std::__1::__tree_iterator<std::__1::__value_type<BlockFilterType, BlockFilterIndex>, std::__1::__tree_node<std::__1::__value_type<BlockFilterType, BlockFilterIndex>, void*>*, long>, bool> std::__1::__tree<std::__1::__value_type<BlockFilterType, BlockFilterIndex>, std::__1::__map_value_compare<BlockFilterType, std::__1::__value_type<BlockFilterType, BlockFilterIndex>, std::__1::less<BlockFilterType>, true>, std::__1::allocator<std::__1::__value_type<BlockFilterType, BlockFilterIndex>>>::__emplace_unique[abi:ue170006]<std::__1::piecewise_construct_t const&, std::__1::tuple<BlockFilterType&>, std::__1::tuple<std::__1::unique_ptr<interfaces::Chain, std::__1::default_delete<interfaces::Chain>>&&, BlockFilterType&, unsigned long&, bool&, bool&>>(std::__1::piecewise_construct_t const&, std::__1::tuple<BlockFilterType&>&&, std::__1::tuple<std::__1::unique_ptr<interfaces::Chain, std::__1::default_delete<interfaces::Chain>>&&, BlockFilterType&, unsigned long&, bool&, bool&>&&) /usr/lib/llvm-17/bin/../include/c++/v1/__tree:1200:16 (bitcoind+0x68d833) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #8 std::__1::pair<std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<BlockFilterType, BlockFilterIndex>, std::__1::__tree_node<std::__1::__value_type<BlockFilterType, BlockFilterIndex>, void*>*, long>>, bool> std::__1::map<BlockFilterType, BlockFilterIndex, std::__1::less<BlockFilterType>, std::__1::allocator<std::__1::pair<BlockFilterType const, BlockFilterIndex>>>::emplace[abi:ue170006]<std::__1::piecewise_construct_t const&, std::__1::tuple<BlockFilterType&>, std::__1::tuple<std::__1::unique_ptr<interfaces::Chain, std::__1::default_delete<interfaces::Chain>>&&, BlockFilterType&, unsigned long&, bool&, bool&>>(std::__1::piecewise_construct_t const&, std::__1::tuple<BlockFilterType&>&&, std::__1::tuple<std::__1::unique_ptr<interfaces::Chain, std::__1::default_delete<interfaces::Chain>>&&, BlockFilterType&, unsigned long&, bool&, bool&>&&) /usr/lib/llvm-17/bin/../include/c++/v1/map:1288:24 (bitcoind+0x68d833)
                                       #9 InitBlockFilterIndex(std::__1::function<std::__1::unique_ptr<interfaces::Chain, std::__1::default_delete<interfaces::Chain>> ()>, BlockFilterType, unsigned long, bool, bool) src/index/blockfilterindex.cpp:510:36 (bitcoind+0x68d833)
                                       #10 AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*) src/init.cpp:1651:9 (bitcoind+0x1a15e7) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #11 AppInit(node::NodeContext&) src/bitcoind.cpp:228:43 (bitcoind+0x18308d) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #12 main src/bitcoind.cpp:274:10 (bitcoind+0x18308d)
                                     Thread T16 'b-basic block f' (tid=47534, running) created by thread T11 at:
                                       #0 pthread_create <null> (bitcoind+0xf7f4f) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #1 std::__1::__libcpp_thread_create[abi:ue170006](unsigned long*, void* (*)(void*), void*) /usr/lib/llvm-17/bin/../include/c++/v1/__threading_support:371:10 (bitcoind+0x682034) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #2 std::__1::thread::thread<void (*)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>), std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, BaseIndex::StartBackgroundSync()::$_0, void>(void (*&&)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>), std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, BaseIndex::StartBackgroundSync()::$_0&&) /usr/lib/llvm-17/bin/../include/c++/v1/__thread/thread.h:248:16 (bitcoind+0x682034)
                                       #3 BaseIndex::StartBackgroundSync() src/index/base.cpp:394:21 (bitcoind+0x682034)
                                       #4 StartIndexBackgroundSync(node::NodeContext&) src/init.cpp:2033:49 (bitcoind+0x1ab2df) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #5 AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_14::operator()() const src/init.cpp:1758:14 (bitcoind+0x1af5c5) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #6 decltype(std::declval<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_14&>()()) std::__1::__invoke[abi:ue170006]<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_14&>(AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_14&) /usr/lib/llvm-17/bin/../include/c++/v1/__type_traits/invoke.h:340:25 (bitcoind+0x1af5c5)
                                       #7 void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:ue170006]<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_14&>(AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_14&) /usr/lib/llvm-17/bin/../include/c++/v1/__type_traits/invoke.h:415:5 (bitcoind+0x1af5c5)
                                       #8 std::__1::__function::__alloc_func<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_14, std::__1::allocator<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_14>, void ()>::operator()[abi:ue170006]() /usr/lib/llvm-17/bin/../include/c++/v1/__functional/function.h:192:16 (bitcoind+0x1af5c5)
                                       #9 std::__1::__function::__func<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_14, std::__1::allocator<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_14>, void ()>::operator()() /usr/lib/llvm-17/bin/../include/c++/v1/__functional/function.h:363:12 (bitcoind+0x1af5c5)
                                       #10 std::__1::__function::__value_func<void ()>::operator()[abi:ue170006]() const /usr/lib/llvm-17/bin/../include/c++/v1/__functional/function.h:517:16 (bitcoind+0xb3acd5) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #11 std::__1::function<void ()>::operator()() const /usr/lib/llvm-17/bin/../include/c++/v1/__functional/function.h:1168:12 (bitcoind+0xb3acd5)
                                       #12 util::TraceThread(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>) src/util/thread.cpp:21:9 (bitcoind+0xb3acd5)
                                       #13 decltype(std::declval<void (*)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>)>()(std::declval<char const*>(), std::declval<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_14>())) std::__1::__invoke[abi:ue170006]<void (*)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>), char const*, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_14>(void (*&&)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>), char const*&&, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_14&&) /usr/lib/llvm-17/bin/../include/c++/v1/__type_traits/invoke.h:340:25 (bitcoind+0x1aead2) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #14 void std::__1::__thread_execute[abi:ue170006]<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (*)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>), char const*, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_14, 2ul, 3ul>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (*)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>), char const*, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_14>&, std::__1::__tuple_indices<2ul, 3ul>) /usr/lib/llvm-17/bin/../include/c++/v1/__thread/thread.h:221:5 (bitcoind+0x1aead2)
                                       #15 void* std::__1::__thread_proxy[abi:ue170006]<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (*)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>), char const*, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_14>>(void*) /usr/lib/llvm-17/bin/../include/c++/v1/__thread/thread.h:232:5 (bitcoind+0x1aead2)
                                     Thread T1 'b-scheduler' (tid=47456, running) created by main thread at:
                                       #0 pthread_create <null> (bitcoind+0xf7f4f) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #1 std::__1::__libcpp_thread_create[abi:ue170006](unsigned long*, void* (*)(void*), void*) /usr/lib/llvm-17/bin/../include/c++/v1/__threading_support:371:10 (bitcoind+0x19c9fa) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #2 std::__1::thread::thread<void (&)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>), char const (&) [10], AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_3, void>(void (&)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>), char const (&) [10], AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_3&&) /usr/lib/llvm-17/bin/../include/c++/v1/__thread/thread.h:248:16 (bitcoind+0x19c9fa)
                                       #3 AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*) src/init.cpp:1165:34 (bitcoind+0x19c9fa)
                                       #4 AppInit(node::NodeContext&) src/bitcoind.cpp:228:43 (bitcoind+0x18308d) (BuildId: 994f604f928124359e165db86502aa34e11056bc)
                                       #5 main src/bitcoind.cpp:274:10 (bitcoind+0x18308d)
                                   SUMMARY: ThreadSanitizer: data race src/flatfile.cpp:47:13 in FlatFileSeq::Open(FlatFilePos const&, bool)
                                   ==================
                                   ************************
depends: Cross-compiling `qt` for `arm-linux-gnueabihf` fails
On Ubuntu 24.04 with glibc 2.39:
```
compiling ../3rdparty/zlib/src/gzclose.c
In file included from /usr/arm-linux-gnueabihf/include/features.h:394,
                 from /usr/arm-linux-gnueabihf/include/bits/libc-header-start.h:33,
                 from /usr/arm-linux-gnueabihf/include/stdio.h:28,
                 from ../3rdparty/zlib/src/gzguts.h:40,
                 from ../3rdparty/zlib/src/gzclose.c:6:
/usr/arm-linux-gnueabihf/include/features-time64.h:26:5: error: #error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
   26 | #   error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
      |     ^~~~~
```

Some similar issues in https://bugreports.qt.io suggest to switch from the builtin `zlib` to a system one. But that doesn't look like an option for us.


Discussion / hints:

Fix patch:
diff --git a/build-aux/m4/l_atomic.m4 b/build-aux/m4/l_atomic.m4
index aa00168fce85b..859ddaabbb429 100644
--- a/build-aux/m4/l_atomic.m4
+++ b/build-aux/m4/l_atomic.m4
@@ -7,7 +7,7 @@ dnl warranty.
 # Clang, when building for 32-bit,
 # and linking against libstdc++, requires linking with
 # -latomic if using the C++ atomic library.
-# Can be tested with: clang++ test.cpp -m32
+# Can be tested with: clang++ -std=c++20 test.cpp -m32
 #
 # Sourced from http://bugs.debian.org/797228
 
@@ -27,8 +27,11 @@ m4_define([_CHECK_ATOMIC_testbody], [[
     auto t1 = t.load();
     t.compare_exchange_strong(t1, 3s);
 
-    std::atomic<int64_t> a{};
+    std::atomic<double> d{};
+    d.store(3.14);
+    auto d1 = d.load();
 
+    std::atomic<int64_t> a{};
     int64_t v = 5;
     int64_t r = a.fetch_add(v);
     return static_cast<int>(r);
diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk
index 5608e5f07387d..4b65afda54824 100644
--- a/depends/packages/qt.mk
+++ b/depends/packages/qt.mk
@@ -24,6 +24,7 @@ $(package)_patches += fix-macos-linker.patch
 $(package)_patches += memory_resource.patch
 $(package)_patches += utc_from_string_no_optimize.patch
 $(package)_patches += windows_lto.patch
+$(package)_patches += zlib-timebits64.patch
 
 $(package)_qttranslations_file_name=qttranslations-$($(package)_suffix)
 $(package)_qttranslations_sha256_hash=a31785948c640b7c66d9fe2db4993728ca07f64e41c560b3625ad191b276ff20
@@ -178,6 +179,7 @@ $(package)_config_opts_mingw32 += -xplatform win32-g++
 $(package)_config_opts_mingw32 += "QMAKE_CFLAGS = '$($(package)_cflags) $($(package)_cppflags)'"
 $(package)_config_opts_mingw32 += "QMAKE_CXX = '$($(package)_cxx)'"
 $(package)_config_opts_mingw32 += "QMAKE_CXXFLAGS = '$($(package)_cxxflags) $($(package)_cppflags)'"
+$(package)_config_opts_mingw32 += "QMAKE_LINK = '$($(package)_cxx)'"
 $(package)_config_opts_mingw32 += "QMAKE_LFLAGS = '$($(package)_ldflags)'"
 $(package)_config_opts_mingw32 += "QMAKE_LIB = '$($(package)_ar) rc'"
 $(package)_config_opts_mingw32 += -device-option CROSS_COMPILE="$(host)-"
@@ -254,6 +256,7 @@ define $(package)_preprocess_cmds
   patch -p1 -i $($(package)_patch_dir)/fast_fixed_dtoa_no_optimize.patch && \
   patch -p1 -i $($(package)_patch_dir)/guix_cross_lib_path.patch && \
   patch -p1 -i $($(package)_patch_dir)/windows_lto.patch && \
+  patch -p1 -i $($(package)_patch_dir)/zlib-timebits64.patch && \
   mkdir -p qtbase/mkspecs/macx-clang-linux &&\
   cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\
   cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \
diff --git a/depends/patches/qt/zlib-timebits64.patch b/depends/patches/qt/zlib-timebits64.patch
new file mode 100644
index 0000000000000..139c1dfa77f3e
--- /dev/null
+++ b/depends/patches/qt/zlib-timebits64.patch
@@ -0,0 +1,31 @@
+From a566e156b3fa07b566ddbf6801b517a9dba04fa3 Mon Sep 17 00:00:00 2001
+From: Mark Adler <madler@alumni.caltech.edu>
+Date: Sat, 29 Jul 2023 22:13:09 -0700
+Subject: [PATCH] Avoid compiler complaints if _TIME_BITS defined when building
+ zlib.
+
+zlib does not use time_t, so _TIME_BITS is irrelevant. However it
+may be defined anyway as part of a sledgehammer indiscriminately
+applied to all builds.
+
+From https://github.com/madler/zlib/commit/a566e156b3fa07b566ddbf6801b517a9dba04fa3.patch
+---
+ qtbase/src/3rdparty/zlib/src/gzguts.h | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/qtbase/src/3rdparty/zlib/src/gzguts.h b/qtbase/src/3rdparty/zlib/src/gzguts.h
+index e23f831f5..f9375047e 100644
+--- a/qtbase/src/3rdparty/zlib/src/gzguts.h
++++ b/qtbase/src/3rdparty/zlib/src/gzguts.h
+@@ -26,9 +26,8 @@
+ #  ifndef _LARGEFILE_SOURCE
+ #    define _LARGEFILE_SOURCE 1
+ #  endif
+-#  ifdef _FILE_OFFSET_BITS
+-#    undef _FILE_OFFSET_BITS
+-#  endif
++#  undef _FILE_OFFSET_BITS
++#  undef _TIME_BITS
+ #endif
+ 
+ #ifdef HAVE_HIDDEN
diff --git a/doc/build-osx.md b/doc/build-osx.md
index 5c3dc1ac7fa0f..20c92ab7a42e8 100644
--- a/doc/build-osx.md
+++ b/doc/build-osx.md
@@ -51,6 +51,20 @@ To install, run the following from your terminal:
 brew install automake libtool boost pkg-config libevent
 ```
 
+For macOS 11 (Big Sur) and 12 (Monterey) you need to install a more recent version of llvm.
+
+``` bash
+brew install llvm
+```
+
+And append the following to the configure commands below:
+
+``` bash
+CC=$(brew --prefix llvm)/bin/clang CXX=$(brew --prefix llvm)/bin/clang++
+```
+
+Try `llvm@17` if compilation fails with the default version of llvm.
+
 ### 4. Clone Bitcoin repository
 
 `git` should already be installed by default on your system.
diff --git a/doc/release-notes.md b/doc/release-notes.md
index 506006832808f..00a6cc9447997 100644
--- a/doc/release-notes.md
+++ b/doc/release-notes.md
@@ -1,8 +1,8 @@
-Bitcoin Core version 27.0 is now available from:
+Bitcoin Core version 27.x is now available from:
 
-  <https://bitcoincore.org/bin/bitcoin-core-27.0/>
+  <https://bitcoincore.org/bin/bitcoin-core-27.x/>
 
-This release includes new features, various bug fixes and performance
+This release includes various bug fixes and performance
 improvements, as well as updated translations.
 
 Please report bugs using the issue tracker at GitHub:
@@ -37,181 +37,55 @@ unsupported systems.
 Notable changes
 ===============
 
-libbitcoinconsensus
--------------------
-
-- libbitcoinconsensus is deprecated and will be removed for v28. This library has
-  existed for nearly 10 years with very little known uptake or impact. It has
-  become a maintenance burden.
+### Miniscript
 
-  The underlying functionality does not change between versions, so any users of
-  the library can continue to use the final release indefinitely, with the
-  understanding that Taproot is its final consensus update.
+- #29853 sign: don't assume we are parsing a sane TapMiniscript
 
-  In the future, libbitcoinkernel will provide a much more useful API that is
-  aware of the UTXO set, and therefore be able to fully validate transactions and
-  blocks. (#29189)
+### RPC
 
-mempool.dat compatibility
--------------------------
+- #29869 rpc, bugfix: Enforce maximum value for setmocktime
+- #29870 rpc: Reword SighashFromStr error message
 
-- The `mempool.dat` file created by -persistmempool or the savemempool RPC will
-  be written in a new format. This new format includes the XOR'ing of transaction
-  contents to mitigate issues where external programs (such as anti-virus) attempt
-  to interpret and potentially modify the file.
+### Index
 
-  This new format can not be read by previous software releases. To allow for a
-  downgrade, a temporary setting `-persistmempoolv1` has been added to fall back
-  to the legacy format. (#28207)
+- #29776 Fix #29767, set m_synced = true after Commit()
 
-P2P and network changes
------------------------
+### Test
 
-- BIP324 v2 transport is now enabled by default. It remains possible to disable v2
-  by running with `-v2transport=0`. (#29347)
-- Manual connection options (`-connect`, `-addnode` and `-seednode`) will
-  now follow `-v2transport` to connect with v2 by default. They will retry with
-  v1 on failure. (#29058)
+- #29892 test: Fix failing univalue float test
 
-- Network-adjusted time has been removed from consensus code. It is replaced
-  with (unadjusted) system time. The warning for a large median time offset
-  (70 minutes or more) is kept. This removes the implicit security assumption of
-  requiring an honest majority of outbound peers, and increases the importance
-  of the node operator ensuring their system time is (and stays) correct to not
-  fall out of consensus with the network. (#28956)
+### Build
 
-Mempool Policy Changes
-----------------------
+- #29747 depends: fix mingw-w64 Qt DEBUG=1 build
+- #29859 build: Fix false positive CHECK_ATOMIC test
+- #29985 depends: Fix build of Qt for 32-bit platforms with recent glibc
 
-- Opt-in Topologically Restricted Until Confirmation (TRUC) Transactions policy
-  (aka v3 transaction policy) is available for use on test networks when
-  `-acceptnonstdtxn=1` is set. By setting the transaction version number to 3, TRUC transactions
-  request the application of limits on spending of their unconfirmed outputs. These
-  restrictions simplify the assessment of incentive compatibility of accepting or
-  replacing TRUC transactions, thus ensuring any replacements are more profitable for
-  the node and making fee-bumping more reliable. TRUC transactions are currently
-  nonstandard and can only be used on test networks where the standardness rules are
-  relaxed or disabled (e.g. with `-acceptnonstdtxn=1`). (#28948)
+### Doc
 
-External Signing
-----------------
+- #29934 doc: add LLVM instruction for macOS < 13
 
-- Support for external signing on Windows has been disabled. It will be re-enabled
-  once the underlying dependency (Boost Process), has been replaced with a different
-  library. (#28967)
+### CI
 
-Updated RPCs
-------------
+- #29856 ci: Bump s390x to ubuntu:24.04
 
-- The addnode RPC now follows the `-v2transport` option (now on by default, see above) for making connections.
-  It remains possible to specify the transport type manually with the v2transport argument of addnode. (#29239)
+### Misc
 
-Build System
-------------
-
-- A C++20 capable compiler is now required to build Bitcoin Core. (#28349)
-- MacOS releases are configured to use the hardened runtime libraries (#29127)
-
-Wallet
-------
-
-- The CoinGrinder coin selection algorithm has been introduced to mitigate unnecessary
-  large input sets and lower transaction costs at high feerates. CoinGrinder
-  searches for the input set with minimal weight. Solutions found by
-  CoinGrinder will produce a change output. CoinGrinder is only active at
-  elevated feerates (default: 30+ sat/vB, based on `-consolidatefeerate`×3). (#27877)
-- The Branch And Bound coin selection algorithm will be disabled when the subtract fee
-  from outputs feature is used. (#28994)
-- If the birth time of a descriptor is detected to be later than the first transaction
-  involving that descriptor, the birth time will be reset to the earlier time. (#28920)
-
-Low-level changes
-=================
-
-Pruning
--------
-
-- When pruning during initial block download, more blocks will be pruned at each
-  flush in order to speed up the syncing of such nodes. (#20827)
-
-Init
-----
-
-- Various fixes to prevent issues where subsequent instances of Bitcoin Core would
-  result in deletion of files in use by an existing instance. (#28784, #28946)
-- Improved handling of empty `settings.json` files. (#29144)
+- #29691 Change Luke Dashjr seed to dashjr-list-of-p2p-nodes.us
 
 Credits
 =======
 
 Thanks to everyone who directly contributed to this release:
 
-- 22388o⚡️
-- Aaron Clauson
-- Amiti Uttarwar
-- Andrew Toth
-- Anthony Towns
 - Antoine Poinsot
-- Ava Chow
-- Brandon Odiwuor
-- brunoerg
-- Chris Stewart
-- Cory Fields
 - dergoegge
-- djschnei21
-- Fabian Jahr
 - fanquake
-- furszy
-- Gloria Zhao
-- Greg Sanders
 - Hennadii Stepanov
-- Hernan Marino
-- iamcarlos94
-- ismaelsadeeq
-- Jameson Lopp
-- Jesse Barton
-- John Moffett
-- Jon Atack
-- josibake
-- jrakibi
-- Justin Dhillon
-- Kashif Smith
-- kevkevin
-- Kristaps Kaupe
-- L0la L33tz
+- laanwj
 - Luke Dashjr
-- Lőrinc
-- marco
 - MarcoFalke
-- Mark Friedenbach
-- Marnix
-- Martin Leitner-Ankerl
-- Martin Zumsande
-- Max Edwards
-- Murch
-- muxator
-- naiyoma
-- Nikodemas Tuckus
-- ns-xvrn
-- pablomartin4btc
-- Peter Todd
-- Pieter Wuille
-- Richard Myers
-- Roman Zeyde
-- Russell Yanofsky
-- Ryan Ofsky
-- Sebastian Falbesoner
-- Sergi Delgado Segura
+- nanlour
 - Sjors Provoost
-- stickies-v
-- stratospher
-- Supachai Kheawjuy
-- TheCharlatan
-- UdjinM6
-- Vasil Dimov
-- w0xlt
-- willcl-ark
-
 
 As well as to everyone that helped with translations on
 [Transifex](https://www.transifex.com/bitcoin/bitcoin/).
diff --git a/doc/release-notes/release-notes-27.0.md b/doc/release-notes/release-notes-27.0.md
new file mode 100644
index 0000000000000..506006832808f
--- /dev/null
+++ b/doc/release-notes/release-notes-27.0.md
@@ -0,0 +1,217 @@
+Bitcoin Core version 27.0 is now available from:
+
+  <https://bitcoincore.org/bin/bitcoin-core-27.0/>
+
+This release includes new features, various bug fixes and performance
+improvements, as well as updated translations.
+
+Please report bugs using the issue tracker at GitHub:
+
+  <https://github.com/bitcoin/bitcoin/issues>
+
+To receive security and update notifications, please subscribe to:
+
+  <https://bitcoincore.org/en/list/announcements/join/>
+
+How to Upgrade
+==============
+
+If you are running an older version, shut it down. Wait until it has completely
+shut down (which might take a few minutes in some cases), then run the
+installer (on Windows) or just copy over `/Applications/Bitcoin-Qt` (on macOS)
+or `bitcoind`/`bitcoin-qt` (on Linux).
+
+Upgrading directly from a version of Bitcoin Core that has reached its EOL is
+possible, but it might take some time if the data directory needs to be migrated. Old
+wallet versions of Bitcoin Core are generally supported.
+
+Compatibility
+==============
+
+Bitcoin Core is supported and extensively tested on operating systems
+using the Linux Kernel 3.17+, macOS 11.0+, and Windows 7 and newer. Bitcoin
+Core should also work on most other Unix-like systems but is not as
+frequently tested on them. It is not recommended to use Bitcoin Core on
+unsupported systems.
+
+Notable changes
+===============
+
+libbitcoinconsensus
+-------------------
+
+- libbitcoinconsensus is deprecated and will be removed for v28. This library has
+  existed for nearly 10 years with very little known uptake or impact. It has
+  become a maintenance burden.
+
+  The underlying functionality does not change between versions, so any users of
+  the library can continue to use the final release indefinitely, with the
+  understanding that Taproot is its final consensus update.
+
+  In the future, libbitcoinkernel will provide a much more useful API that is
+  aware of the UTXO set, and therefore be able to fully validate transactions and
+  blocks. (#29189)
+
+mempool.dat compatibility
+-------------------------
+
+- The `mempool.dat` file created by -persistmempool or the savemempool RPC will
+  be written in a new format. This new format includes the XOR'ing of transaction
+  contents to mitigate issues where external programs (such as anti-virus) attempt
+  to interpret and potentially modify the file.
+
+  This new format can not be read by previous software releases. To allow for a
+  downgrade, a temporary setting `-persistmempoolv1` has been added to fall back
+  to the legacy format. (#28207)
+
+P2P and network changes
+-----------------------
+
+- BIP324 v2 transport is now enabled by default. It remains possible to disable v2
+  by running with `-v2transport=0`. (#29347)
+- Manual connection options (`-connect`, `-addnode` and `-seednode`) will
+  now follow `-v2transport` to connect with v2 by default. They will retry with
+  v1 on failure. (#29058)
+
+- Network-adjusted time has been removed from consensus code. It is replaced
+  with (unadjusted) system time. The warning for a large median time offset
+  (70 minutes or more) is kept. This removes the implicit security assumption of
+  requiring an honest majority of outbound peers, and increases the importance
+  of the node operator ensuring their system time is (and stays) correct to not
+  fall out of consensus with the network. (#28956)
+
+Mempool Policy Changes
+----------------------
+
+- Opt-in Topologically Restricted Until Confirmation (TRUC) Transactions policy
+  (aka v3 transaction policy) is available for use on test networks when
+  `-acceptnonstdtxn=1` is set. By setting the transaction version number to 3, TRUC transactions
+  request the application of limits on spending of their unconfirmed outputs. These
+  restrictions simplify the assessment of incentive compatibility of accepting or
+  replacing TRUC transactions, thus ensuring any replacements are more profitable for
+  the node and making fee-bumping more reliable. TRUC transactions are currently
+  nonstandard and can only be used on test networks where the standardness rules are
+  relaxed or disabled (e.g. with `-acceptnonstdtxn=1`). (#28948)
+
+External Signing
+----------------
+
+- Support for external signing on Windows has been disabled. It will be re-enabled
+  once the underlying dependency (Boost Process), has been replaced with a different
+  library. (#28967)
+
+Updated RPCs
+------------
+
+- The addnode RPC now follows the `-v2transport` option (now on by default, see above) for making connections.
+  It remains possible to specify the transport type manually with the v2transport argument of addnode. (#29239)
+
+Build System
+------------
+
+- A C++20 capable compiler is now required to build Bitcoin Core. (#28349)
+- MacOS releases are configured to use the hardened runtime libraries (#29127)
+
+Wallet
+------
+
+- The CoinGrinder coin selection algorithm has been introduced to mitigate unnecessary
+  large input sets and lower transaction costs at high feerates. CoinGrinder
+  searches for the input set with minimal weight. Solutions found by
+  CoinGrinder will produce a change output. CoinGrinder is only active at
+  elevated feerates (default: 30+ sat/vB, based on `-consolidatefeerate`×3). (#27877)
+- The Branch And Bound coin selection algorithm will be disabled when the subtract fee
+  from outputs feature is used. (#28994)
+- If the birth time of a descriptor is detected to be later than the first transaction
+  involving that descriptor, the birth time will be reset to the earlier time. (#28920)
+
+Low-level changes
+=================
+
+Pruning
+-------
+
+- When pruning during initial block download, more blocks will be pruned at each
+  flush in order to speed up the syncing of such nodes. (#20827)
+
+Init
+----
+
+- Various fixes to prevent issues where subsequent instances of Bitcoin Core would
+  result in deletion of files in use by an existing instance. (#28784, #28946)
+- Improved handling of empty `settings.json` files. (#29144)
+
+Credits
+=======
+
+Thanks to everyone who directly contributed to this release:
+
+- 22388o⚡️
+- Aaron Clauson
+- Amiti Uttarwar
+- Andrew Toth
+- Anthony Towns
+- Antoine Poinsot
+- Ava Chow
+- Brandon Odiwuor
+- brunoerg
+- Chris Stewart
+- Cory Fields
+- dergoegge
+- djschnei21
+- Fabian Jahr
+- fanquake
+- furszy
+- Gloria Zhao
+- Greg Sanders
+- Hennadii Stepanov
+- Hernan Marino
+- iamcarlos94
+- ismaelsadeeq
+- Jameson Lopp
+- Jesse Barton
+- John Moffett
+- Jon Atack
+- josibake
+- jrakibi
+- Justin Dhillon
+- Kashif Smith
+- kevkevin
+- Kristaps Kaupe
+- L0la L33tz
+- Luke Dashjr
+- Lőrinc
+- marco
+- MarcoFalke
+- Mark Friedenbach
+- Marnix
+- Martin Leitner-Ankerl
+- Martin Zumsande
+- Max Edwards
+- Murch
+- muxator
+- naiyoma
+- Nikodemas Tuckus
+- ns-xvrn
+- pablomartin4btc
+- Peter Todd
+- Pieter Wuille
+- Richard Myers
+- Roman Zeyde
+- Russell Yanofsky
+- Ryan Ofsky
+- Sebastian Falbesoner
+- Sergi Delgado Segura
+- Sjors Provoost
+- stickies-v
+- stratospher
+- Supachai Kheawjuy
+- TheCharlatan
+- UdjinM6
+- Vasil Dimov
+- w0xlt
+- willcl-ark
+
+
+As well as to everyone that helped with translations on
+[Transifex](https://www.transifex.com/bitcoin/bitcoin/).
diff --git a/src/core_read.cpp b/src/core_read.cpp
index e32e46d1b9b4a..5956d9df5fa0c 100644
--- a/src/core_read.cpp
+++ b/src/core_read.cpp
@@ -256,6 +256,6 @@ util::Result<int> SighashFromStr(const std::string& sighash)
     if (it != map_sighash_values.end()) {
         return it->second;
     } else {
-        return util::Error{Untranslated(sighash + " is not a valid sighash parameter.")};
+        return util::Error{Untranslated("'" + sighash + "' is not a valid sighash parameter.")};
     }
 }
diff --git a/src/index/base.cpp b/src/index/base.cpp
index bcfe7215beaf4..af7a80392d84a 100644
--- a/src/index/base.cpp
+++ b/src/index/base.cpp
@@ -164,9 +164,9 @@ void BaseIndex::ThreadSync()
                 const CBlockIndex* pindex_next = NextSyncBlock(pindex, m_chainstate->m_chain);
                 if (!pindex_next) {
                     SetBestBlockIndex(pindex);
-                    m_synced = true;
                     // No need to handle errors in Commit. See rationale above.
                     Commit();
+                    m_synced = true;
                     break;
                 }
                 if (pindex_next->pprev != pindex && !Rewind(pindex, pindex_next->pprev)) {
diff --git a/src/kernel/chainparams.cpp b/src/kernel/chainparams.cpp
index 264a2fd68130c..26c261eba2725 100644
--- a/src/kernel/chainparams.cpp
+++ b/src/kernel/chainparams.cpp
@@ -133,7 +133,7 @@ class CMainParams : public CChainParams {
         // release ASAP to avoid it where possible.
         vSeeds.emplace_back("seed.bitcoin.sipa.be."); // Pieter Wuille, only supports x1, x5, x9, and xd
         vSeeds.emplace_back("dnsseed.bluematt.me."); // Matt Corallo, only supports x9
-        vSeeds.emplace_back("dnsseed.bitcoin.dashjr.org."); // Luke Dashjr
+        vSeeds.emplace_back("dnsseed.bitcoin.dashjr-list-of-p2p-nodes.us."); // Luke Dashjr
         vSeeds.emplace_back("seed.bitcoinstats.com."); // Christian Decker, supports x1 - xf
         vSeeds.emplace_back("seed.bitcoin.jonasschnelli.ch."); // Jonas Schnelli, only supports x1, x5, x9, and xd
         vSeeds.emplace_back("seed.btc.petertodd.net."); // Peter Todd, only supports x1, x5, x9, and xd
diff --git a/src/rpc/node.cpp b/src/rpc/node.cpp
index 45053f882dd83..02e56e61eb8a3 100644
--- a/src/rpc/node.cpp
+++ b/src/rpc/node.cpp
@@ -26,6 +26,7 @@
 #include <univalue.h>
 #include <util/any.h>
 #include <util/check.h>
+#include <util/time.h>
 
 #include <stdint.h>
 #ifdef HAVE_MALLOC_INFO
@@ -58,9 +59,11 @@ static RPCHelpMan setmocktime()
     LOCK(cs_main);
 
     const int64_t time{request.params[0].getInt<int64_t>()};
-    if (time < 0) {
-        throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Mocktime cannot be negative: %s.", time));
+    constexpr int64_t max_time{Ticks<std::chrono::seconds>(std::chrono::nanoseconds::max())};
+    if (time < 0 || time > max_time) {
+        throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Mocktime must be in the range [0, %s], not %s.", max_time, time));
     }
+
     SetMockTime(time);
     const NodeContext& node_context{EnsureAnyNodeContext(request.context)};
     for (const auto& chain_client : node_context.chain_clients) {
diff --git a/src/script/sign.cpp b/src/script/sign.cpp
index be4b35756818b..22ac062a633a7 100644
--- a/src/script/sign.cpp
+++ b/src/script/sign.cpp
@@ -295,7 +295,7 @@ struct TapSatisfier: Satisfier<XOnlyPubKey> {
     //! Conversion from a raw xonly public key.
     template <typename I>
     std::optional<XOnlyPubKey> FromPKBytes(I first, I last) const {
-        CHECK_NONFATAL(last - first == 32);
+        if (last - first != 32) return {};
         XOnlyPubKey pubkey;
         std::copy(first, last, pubkey.begin());
         return pubkey;


Test patch:
diff --git a/ci/test/00_setup_env_s390x.sh b/ci/test/00_setup_env_s390x.sh
index ca84ecce5153c..2fd94e253cac7 100755
--- a/ci/test/00_setup_env_s390x.sh
+++ b/ci/test/00_setup_env_s390x.sh
@@ -9,8 +9,8 @@ export LC_ALL=C.UTF-8
 export HOST=s390x-linux-gnu
 export PACKAGES="python3-zmq"
 export CONTAINER_NAME=ci_s390x
-export CI_IMAGE_NAME_TAG="docker.io/s390x/debian:bookworm"
-export TEST_RUNNER_EXTRA="--exclude feature_init,rpc_bind,feature_bind_extra"  # Excluded for now, see https://github.com/bitcoin/bitcoin/issues/17765#issuecomment-602068547
+export CI_IMAGE_NAME_TAG="docker.io/s390x/ubuntu:24.04"
+export TEST_RUNNER_EXTRA="--exclude rpc_bind,feature_bind_extra"  # Excluded for now, see https://github.com/bitcoin/bitcoin/issues/17765#issuecomment-602068547
 export RUN_FUNCTIONAL_TESTS=true
 export GOAL="install"
 export BITCOIN_CONFIG="--enable-reduce-exports"
diff --git a/src/test/rpc_tests.cpp b/src/test/rpc_tests.cpp
index 0d2460c6064a3..3a1cb45e8dcc7 100644
--- a/src/test/rpc_tests.cpp
+++ b/src/test/rpc_tests.cpp
@@ -291,6 +291,7 @@ BOOST_AUTO_TEST_CASE(rpc_parse_monetary_values)
     BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("1e-8")), COIN/100000000);
     BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.1e-7")), COIN/100000000);
     BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.01e-6")), COIN/100000000);
+    BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.00000000000000000000000000000000000001e+30")), 1);
     BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.0000000000000000000000000000000000000000000000000000000000000000000000000001e+68")), COIN/100000000);
     BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("10000000000000000000000000000000000000000000000000000000000000000e-64")), COIN);
     BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000e64")), COIN);
diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp
index ac457d9c77bbb..f61eb38679d8b 100644
--- a/src/test/script_tests.cpp
+++ b/src/test/script_tests.cpp
@@ -1277,6 +1277,30 @@ BOOST_AUTO_TEST_CASE(script_combineSigs)
     BOOST_CHECK(combined.scriptSig == partial3c);
 }
 
+/**
+ * Reproduction of an exception incorrectly raised when parsing a public key inside a TapMiniscript.
+ */
+BOOST_AUTO_TEST_CASE(sign_invalid_miniscript)
+{
+    FillableSigningProvider keystore;
+    SignatureData sig_data;
+    CMutableTransaction prev, curr;
+
+    // Create a Taproot output which contains a leaf in which a non-32 bytes push is used where a public key is expected
+    // by the Miniscript parser. This offending Script was found by the RPC fuzzer.
+    const auto invalid_pubkey{ParseHex("173d36c8c9c9c9ffffffffffff0200000000021e1e37373721361818181818181e1e1e1e19000000000000000000b19292929292926b006c9b9b9292")};
+    TaprootBuilder builder;
+    builder.Add(0, {invalid_pubkey}, 0xc0);
+    XOnlyPubKey nums{ParseHex("50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0")};
+    builder.Finalize(nums);
+    prev.vout.emplace_back(0, GetScriptForDestination(builder.GetOutput()));
+    curr.vin.emplace_back(COutPoint{prev.GetHash(), 0});
+    sig_data.tr_spenddata = builder.GetSpendData();
+
+    // SignSignature can fail but it shouldn't raise an exception (nor crash).
+    BOOST_CHECK(!SignSignature(keystore, CTransaction(prev), curr, 0, SIGHASH_ALL, sig_data));
+}
+
 BOOST_AUTO_TEST_CASE(script_standard_push)
 {
     ScriptError err;
diff --git a/src/univalue/test/object.cpp b/src/univalue/test/object.cpp
index 8b90448b362bf..1c724555f3cef 100644
--- a/src/univalue/test/object.cpp
+++ b/src/univalue/test/object.cpp
@@ -421,7 +421,7 @@ void univalue_readwrite()
     // Valid, with leading or trailing whitespace
     BOOST_CHECK(v.read(" 1.0") && (v.get_real() == 1.0));
     BOOST_CHECK(v.read("1.0 ") && (v.get_real() == 1.0));
-    BOOST_CHECK(v.read("0.00000000000000000000000000000000000001e+30 ") && v.get_real() == 1e-8);
+    BOOST_CHECK(v.read("0.00000000000000000000000000000000000001e+30 "));
 
     BOOST_CHECK(!v.read(".19e-6")); //should fail, missing leading 0, therefore invalid JSON
     // Invalid, initial garbage
diff --git a/test/functional/rpc_psbt.py b/test/functional/rpc_psbt.py
index 016aa3ba119bc..117a65121de09 100755
--- a/test/functional/rpc_psbt.py
+++ b/test/functional/rpc_psbt.py
@@ -886,7 +886,7 @@ def test_psbt_input_keys(psbt_input, keys):
             assert_equal(comb_psbt, psbt)
 
         self.log.info("Test walletprocesspsbt raises if an invalid sighashtype is passed")
-        assert_raises_rpc_error(-8, "all is not a valid sighash parameter.", self.nodes[0].walletprocesspsbt, psbt, sighashtype="all")
+        assert_raises_rpc_error(-8, "'all' is not a valid sighash parameter.", self.nodes[0].walletprocesspsbt, psbt, sighashtype="all")
 
         self.log.info("Test decoding PSBT with per-input preimage types")
         # note that the decodepsbt RPC doesn't check whether preimages and hashes match
@@ -992,7 +992,7 @@ def test_psbt_input_keys(psbt_input, keys):
         self.nodes[2].sendrawtransaction(processed_psbt['hex'])
 
         self.log.info("Test descriptorprocesspsbt raises if an invalid sighashtype is passed")
-        assert_raises_rpc_error(-8, "all is not a valid sighash parameter.", self.nodes[2].descriptorprocesspsbt, psbt, [descriptor], sighashtype="all")
+        assert_raises_rpc_error(-8, "'all' is not a valid sighash parameter.", self.nodes[2].descriptorprocesspsbt, psbt, [descriptor], sighashtype="all")
 
 
 if __name__ == '__main__':
diff --git a/test/functional/rpc_signrawtransactionwithkey.py b/test/functional/rpc_signrawtransactionwithkey.py
index 0913f5057e510..268584331ec32 100755
--- a/test/functional/rpc_signrawtransactionwithkey.py
+++ b/test/functional/rpc_signrawtransactionwithkey.py
@@ -124,7 +124,7 @@ def invalid_sighashtype_test(self):
         self.log.info("Test signing transaction with invalid sighashtype")
         tx = self.nodes[0].createrawtransaction(INPUTS, OUTPUTS)
         privkeys = [self.nodes[0].get_deterministic_priv_key().key]
-        assert_raises_rpc_error(-8, "all is not a valid sighash parameter.", self.nodes[0].signrawtransactionwithkey, tx, privkeys, sighashtype="all")
+        assert_raises_rpc_error(-8, "'all' is not a valid sighash parameter.", self.nodes[0].signrawtransactionwithkey, tx, privkeys, sighashtype="all")
 
     def run_test(self):
         self.successful_signing_test()
diff --git a/test/functional/rpc_uptime.py b/test/functional/rpc_uptime.py
index cb99e483ece29..f8df59d02ad39 100755
--- a/test/functional/rpc_uptime.py
+++ b/test/functional/rpc_uptime.py
@@ -23,7 +23,7 @@ def run_test(self):
         self._test_uptime()
 
     def _test_negative_time(self):
-        assert_raises_rpc_error(-8, "Mocktime cannot be negative: -1.", self.nodes[0].setmocktime, -1)
+        assert_raises_rpc_error(-8, "Mocktime must be in the range [0, 9223372036], not -1.", self.nodes[0].setmocktime, -1)
 
     def _test_uptime(self):
         wait_time = 10
diff --git a/test/functional/wallet_signrawtransactionwithwallet.py b/test/functional/wallet_signrawtransactionwithwallet.py
index b0517f951dd7d..612a2542e7425 100755
--- a/test/functional/wallet_signrawtransactionwithwallet.py
+++ b/test/functional/wallet_signrawtransactionwithwallet.py
@@ -55,7 +55,7 @@ def test_with_lock_outputs(self):
 
     def test_with_invalid_sighashtype(self):
         self.log.info("Test signrawtransactionwithwallet raises if an invalid sighashtype is passed")
-        assert_raises_rpc_error(-8, "all is not a valid sighash parameter.", self.nodes[0].signrawtransactionwithwallet, hexstring=RAW_TX, sighashtype="all")
+        assert_raises_rpc_error(-8, "'all' is not a valid sighash parameter.", self.nodes[0].signrawtransactionwithwallet, hexstring=RAW_TX, sighashtype="all")
 
     def script_verification_error_test(self):
         """Create and sign a raw transaction with valid (vin 0), invalid (vin 1) and one missing (vin 2) input script.