Skip to content

Commit 4a6dc39

Browse files
Merge #6641: backport: trivial 2025 04 22
1e04c56 Merge bitcoin#30556: doc: multisig-tutorial: remove obsolete mention and link to closed PR (merge-script) fd43510 Merge bitcoin#30453: test: Non-Shy version sender (glozow) e3c3a11 Merge bitcoin#30327: build: Drop redundant `sys/sysctl.h` header check (merge-script) 808a77d Merge bitcoin#30156: fuzz: More accurate coverage reports (merge-script) 3ca42ba Merge bitcoin#28874: doc: fixup help output for -upnp and -natpmp (merge-script) ea32090 Merge bitcoin#28461: build: Windows SSP roundup (fanquake) e71c422 Merge bitcoin#28151: build: use `-muse-unaligned-vector-move` for Windows builds (fanquake) 077bbb4 Merge bitcoin#28131: test: Add UBSan `-fsanitize=integer` suppressions for `src/secp256k1` subtree (fanquake) de5a2d1 Merge bitcoin#27940: test: Add implicit-signed-integer-truncation:*/include/c++/ suppression (fanquake) Pull request description: ## Issue being fixed or feature implemented Batch of trivial backports ## How Has This Been Tested? Built locally ## Breaking Changes ## Checklist: _Go over all the following points, and put an `x` in all the boxes that apply._ - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: UdjinM6: utACK 1e04c56 knst: utACK 1e04c56 Tree-SHA512: 5e9a3fc4ac2ea06e8da48952bbdb43e7ed0c3d9ab3fdae3d8753bbe10b957c6cbb06e01b9860db4cd5ade91c8cd419dbbc8ee76073d00b4d6ff0f6ae6a4cbfd2
2 parents db5d000 + 1e04c56 commit 4a6dc39

File tree

7 files changed

+60
-22
lines changed

7 files changed

+60
-22
lines changed

configure.ac

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,10 @@ case $host in
728728

729729
dnl We require Windows 7 (NT 6.1) or later
730730
AX_CHECK_LINK_FLAG([-Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1], [CORE_LDFLAGS="$CORE_LDFLAGS -Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1"], [], [$LDFLAG_WERROR])
731+
732+
dnl Avoid the use of aligned vector instructions when building for Windows.
733+
dnl See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412.
734+
AX_CHECK_COMPILE_FLAG([-Wa,-muse-unaligned-vector-move], [CORE_CXXFLAGS="$CORE_CXXFLAGS -Wa,-muse-unaligned-vector-move"], [], [$CXXFLAG_WERROR])
731735
;;
732736
*darwin*)
733737
TARGET_OS=darwin
@@ -992,12 +996,6 @@ if test "$use_hardening" != "no"; then
992996
AX_CHECK_LINK_FLAG([-Wl,-z,now], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,now"], [], [$LDFLAG_WERROR])
993997
AX_CHECK_LINK_FLAG([-Wl,-z,separate-code], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,separate-code"], [], [$LDFLAG_WERROR])
994998
AX_CHECK_LINK_FLAG([-fPIE -pie], [PIE_FLAGS="-fPIE"; HARDENED_LDFLAGS="$HARDENED_LDFLAGS -pie"], [], [$CXXFLAG_WERROR])
995-
996-
case $host in
997-
*mingw*)
998-
AC_CHECK_LIB([ssp], [main], [], [AC_MSG_ERROR([libssp missing])])
999-
;;
1000-
esac
1001999
fi
10021000

10031001
dnl These flags are specific to ld64, and may cause issues with other linkers.
@@ -1009,7 +1007,7 @@ if test "$TARGET_OS" = "darwin"; then
10091007
AX_CHECK_LINK_FLAG([-Wl,-fixup_chains], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-fixup_chains"], [], [$LDFLAG_WERROR])
10101008
fi
10111009

1012-
AC_CHECK_HEADERS([sys/select.h sys/prctl.h sys/sysctl.h vm/vm_param.h sys/vmmeter.h sys/resources.h])
1010+
AC_CHECK_HEADERS([sys/select.h sys/prctl.h vm/vm_param.h sys/vmmeter.h sys/resources.h])
10131011

10141012
AC_CHECK_DECLS([getifaddrs, freeifaddrs],[CHECK_SOCKET],,
10151013
[#include <sys/types.h>

contrib/guix/manifest.scm

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -427,12 +427,8 @@ inspecting signatures in Mach-O binaries.")
427427
`(append ,flags
428428
;; https://gcc.gnu.org/install/configure.html
429429
(list "--enable-threads=posix",
430-
building-on)))
431-
((#:make-flags flags)
432-
;; Uses the SSP functions from glibc instead of from libssp.so.
433-
;; Our 'symbol-check' script will complain if we link against libssp.so,
434-
;; and thus will ensure that this works properly.
435-
`(cons "gcc_cv_libc_provides_ssp=yes" ,flags))))))
430+
"--enable-default-ssp=yes",
431+
building-on)))))))
436432

437433
(define-public linux-base-gcc
438434
(package

doc/multisig-tutorial.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ This tutorial also uses the default PKH derivation path to get the xpubs and doe
1616

1717
At the time of writing, there is no way to extract a specific path from wallets in Dash Core. For this, an external signer/xpub can be used.
1818

19-
[PR #22341](https://github.com/bitcoin/bitcoin/pull/22341), which is still under development, introduces a new wallet RPC `getxpub`. It takes a BIP32 path as an argument and returns the xpub, along with the master key fingerprint.
20-
2119
## 1.1 Basic Multisig Workflow
2220

2321
### 1.1 Create the Descriptor Wallets

src/init.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -589,16 +589,12 @@ void SetupServerArgs(ArgsManager& argsman)
589589
argsman.AddArg("-torcontrol=<ip>:<port>", strprintf("Tor control port to use if onion listening enabled (default: %s)", DEFAULT_TOR_CONTROL), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
590590
argsman.AddArg("-torpassword=<pass>", "Tor control port password (default: empty)", ArgsManager::ALLOW_ANY | ArgsManager::SENSITIVE, OptionsCategory::CONNECTION);
591591
#ifdef USE_UPNP
592-
#if USE_UPNP
593-
argsman.AddArg("-upnp", "Use UPnP to map the listening port (default: 1 when listening and no -proxy)", ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
594-
#else
595-
argsman.AddArg("-upnp", strprintf("Use UPnP to map the listening port (default: %u)", 0), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
596-
#endif
592+
argsman.AddArg("-upnp", strprintf("Use UPnP to map the listening port (default: %u)", DEFAULT_UPNP), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
597593
#else
598594
hidden_args.emplace_back("-upnp");
599595
#endif
600596
#ifdef USE_NATPMP
601-
argsman.AddArg("-natpmp", strprintf("Use NAT-PMP to map the listening port (default: %s)", DEFAULT_NATPMP ? "1 when listening and no -proxy" : "0"), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
597+
argsman.AddArg("-natpmp", strprintf("Use NAT-PMP to map the listening port (default: %u)", DEFAULT_NATPMP), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
602598
#else
603599
hidden_args.emplace_back("-natpmp");
604600
#endif // USE_NATPMP

src/test/fuzz/fuzz.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,26 @@ void FuzzFrameworkRegisterTarget(std::string_view name, TypeTestOneInput target,
7676
static std::string_view g_fuzz_target;
7777
static const TypeTestOneInput* g_test_one_input{nullptr};
7878

79+
80+
#if defined(__clang__) && defined(__linux__)
81+
extern "C" void __llvm_profile_reset_counters(void) __attribute__((weak));
82+
extern "C" void __gcov_reset(void) __attribute__((weak));
83+
84+
void ResetCoverageCounters()
85+
{
86+
if (__llvm_profile_reset_counters) {
87+
__llvm_profile_reset_counters();
88+
}
89+
90+
if (__gcov_reset) {
91+
__gcov_reset();
92+
}
93+
}
94+
#else
95+
void ResetCoverageCounters() {}
96+
#endif
97+
98+
7999
void initialize()
80100
{
81101
// Terminate immediately if a fuzzing harness ever tries to create a TCP socket.
@@ -126,6 +146,8 @@ void initialize()
126146
Assert(!g_test_one_input);
127147
g_test_one_input = &it->second.test_one_input;
128148
it->second.opts.init();
149+
150+
ResetCoverageCounters();
129151
}
130152

131153
#if defined(PROVIDE_FUZZ_MAIN_FUNCTION)

test/functional/p2p_add_connections.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
2-
# Copyright (c) 2020-2021 The Bitcoin Core developers
2+
# Copyright (c) 2020-present The Bitcoin Core developers
33
# Distributed under the MIT software license, see the accompanying
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55
"""Test add_outbound_p2p_connection test framework functionality"""
@@ -11,6 +11,14 @@
1111
check_node_connections,
1212
)
1313

14+
15+
class VersionSender(P2PInterface):
16+
def on_open(self):
17+
assert self.on_connection_send_msg is not None
18+
self.send_version()
19+
assert self.on_connection_send_msg is None
20+
21+
1422
class P2PFeelerReceiver(P2PInterface):
1523
def on_version(self, message):
1624
# The bitcoind node closes feeler connections as soon as a version
@@ -107,5 +115,19 @@ def run_test(self):
107115
# Feeler connections do not request tx relay
108116
assert_equal(feeler_conn.last_message["version"].relay, 0)
109117

118+
self.log.info("Send version message early to node")
119+
# Normally the test framework would be shy and send the version message
120+
# only after it received one. See the on_version method. Check that
121+
# bitcoind behaves properly when a version is sent unexpectedly (but
122+
# tolerably) early.
123+
#
124+
# This checks that bitcoind sends its own version prior to processing
125+
# the remote version (and replying with a verack). Otherwise it would
126+
# be violating its own rules, such as "non-version message before
127+
# version handshake".
128+
ver_conn = self.nodes[0].add_outbound_p2p_connection(VersionSender(), p2p_idx=6, connection_type="outbound-full-relay", supports_v2_p2p=False, advertise_v2_p2p=False)
129+
ver_conn.sync_with_ping()
130+
131+
110132
if __name__ == '__main__':
111133
P2PAddConnections().main()

test/sanitizer_suppressions/ubsan

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ unsigned-integer-overflow:bench/bench.h
1919
unsigned-integer-overflow:FuzzedDataProvider.h
2020
unsigned-integer-overflow:leveldb/
2121
unsigned-integer-overflow:minisketch/
22+
unsigned-integer-overflow:secp256k1/
2223
unsigned-integer-overflow:test/fuzz/crypto_diff_fuzz_chacha20.cpp
2324
implicit-integer-sign-change:*/include/boost/
2425
implicit-integer-sign-change:*/include/c++/
@@ -27,15 +28,20 @@ implicit-integer-sign-change:crc32c/
2728
# implicit-integer-sign-change in FuzzedDataProvider's ConsumeIntegralInRange
2829
implicit-integer-sign-change:FuzzedDataProvider.h
2930
implicit-integer-sign-change:minisketch/
31+
implicit-integer-sign-change:secp256k1/
32+
implicit-signed-integer-truncation:*/include/c++/
3033
implicit-signed-integer-truncation:leveldb/
34+
implicit-signed-integer-truncation:secp256k1/
3135
implicit-unsigned-integer-truncation:*/include/c++/
3236
implicit-unsigned-integer-truncation:leveldb/
37+
implicit-unsigned-integer-truncation:secp256k1/
3338
implicit-unsigned-integer-truncation:test/fuzz/crypto_diff_fuzz_chacha20.cpp
3439
# std::variant warning fixed in https://github.com/gcc-mirror/gcc/commit/074436cf8cdd2a9ce75cadd36deb8301f00e55b9
3540
implicit-unsigned-integer-truncation:std::__detail::__variant::_Variant_storage
3641
shift-base:*/include/c++/
3742
shift-base:leveldb/
3843
shift-base:minisketch/
44+
shift-base:secp256k1/
3945
shift-base:test/fuzz/crypto_diff_fuzz_chacha20.cpp
4046
# Unsigned integer overflow occurs when the result of an unsigned integer
4147
# computation cannot be represented in its type. Unlike signed integer overflow,

0 commit comments

Comments
 (0)