Repository navigation
ipc: Update libmultiprocess subtree and drop fuzz test workaround - #35720
Conversation
e8de5c7 Merge bitcoin-core/libmultiprocess#305: refactor: memcpy to std::ranges::copy to work around ubsan warn 9307e68 Merge bitcoin-core/libmultiprocess#306: doc: Bump version 12 > 13 fac7b9b refactor: memcpy to std::ranges::copy to work around ubsan warn 1bd7025 Merge bitcoin-core/libmultiprocess#297: test: add map serialization round-trip coverage 438fdd2 doc: Bump version 12 > 13 463d073 test: rename vBool to vector_bool 85df233 test: add mapStringInt to foo.capnp to cover map serialization and deserialization git-subtree-dir: src/ipc/libmultiprocess git-subtree-split: e8de5c7
HEAD is the prior subtree update commit 'a9d1b652f324126ef7e80d9ab0b9e4f60019dade'
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35720. ReviewsSee the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
|
@willcl-ark Looks like you added an |
ryanofsky
left a comment
There was a problem hiding this comment.
Code review ACK fa1ecc201d08dd17110804685fb0318f7f1c8416. Nice fuzz test improvements and it is interesting to see how LIMITED_WHILE works. Seems like it should help the fuzzer generate better inputs.
|
|
||
| for (size_t i = 0; i < iterations; ++i) { | ||
| LIMITED_WHILE(fuzzed_data_provider.ConsumeBool(), 64) | ||
| { |
There was a problem hiding this comment.
In commit "fuzz: Use LIMITED_WHILE over for-loop with consumed size integral" (fa8266748abb0f3057ae2e81f9f4fd8dd220fe12)
Would seem more consistent to use trailing brace
There was a problem hiding this comment.
Sure, done. Also added two clang-format commits. Let me know if they are too spicy and if they should be dropped, but I think they should be harmless and fine.
There was a problem hiding this comment.
re: #35720 (comment)
Sure, done. Also added two clang-format commits. Let me know if they are too spicy and if they should be dropped, but I think they should be harmless and fine.
Thanks for the formatting fix. IMO, the new commits seem fine to keep but I do think separate PRs are better in cases like this to make sure changes get better review, and reviewers aren't put in a position of having to do partial reviews or rubber stamp changes they are not interested in. This case is not a big deal, but unfocused PRs in general seem like a risk it's nice to avoid
sedited
left a comment
There was a problem hiding this comment.
ACK fa1ecc201d08dd17110804685fb0318f7f1c8416
This is a style cleanup. The general pattern to use `LIMITED_WHILE`, which all other fuzz tests use, has some benefits: * When no data is available, a simple and single (let's say) 64 value in the fuzz input will not result in 64 loops over the same body with the same default/fallback values. * When no data is available, `ConsumeBool` falls back to `false` and breaks the loop early. * When further data is available, the overhead is just a single byte, making it also possibly easier for the fuzz engine to mutate the data, as a single int that influences the whole remainder of the fuzz input can lead to the 'havoc' effect. * When a crash is reduced, deleting bytes will directly influence the execution length, so byte-length of the fuzz input roughly corresponds to run-time length.
janb84
left a comment
There was a problem hiding this comment.
cr ACK fa1ecc201d08dd17110804685fb0318f7f1c8416
Also checked that subtree matches upstream and is an ancestor of upstream master, all green.
This is a whitespace-only clang-format change. To verify it, one can run: ```sh (git show | git apply --reverse ) && ( git diff -U0 | ./contrib/devtools/clang-format-diff.py -p1 -i -v ) && git diff HEAD ``` A few minor, non-macro formatting adjustments were made in touched files: * `src/wallet/test/fuzz/crypter.cpp`: Removed a redundant double semicolon * `src/test/fuzz/txorphan.cpp`: Corrected indentation on an `else if` block. * `src/test/fuzz/mini_miner.cpp`: Removed an unnecessary empty line.
fa1ecc2 to
fab8eee
Compare
|
|
||
| for (size_t i = 0; i < iterations; ++i) { | ||
| LIMITED_WHILE(fuzzed_data_provider.ConsumeBool(), 64) | ||
| { |
There was a problem hiding this comment.
re: #35720 (comment)
Sure, done. Also added two clang-format commits. Let me know if they are too spicy and if they should be dropped, but I think they should be harmless and fine.
Thanks for the formatting fix. IMO, the new commits seem fine to keep but I do think separate PRs are better in cases like this to make sure changes get better review, and reviewers aren't put in a position of having to do partial reviews or rubber stamp changes they are not interested in. This case is not a big deal, but unfocused PRs in general seem like a risk it's nice to avoid
…drop fuzz test workaround 7644642 fuzz: clang-format LIMITED_WHILE (MarcoFalke) a4f98f0 fuzz: Clang-format LIMITED_WHILE like while (MarcoFalke) 98ceaa9 fuzz: Remove unused workaround after fix in libmultiprocess byte-span serializer (MarcoFalke) 87f8d3f fuzz: Use LIMITED_WHILE over for-loop with consumed size integral (MarcoFalke) 6d5f753 Squashed 'src/ipc/libmultiprocess/' changes from 28e056576a..e8de5c7b68 (MarcoFalke) Pull request description: Includes several changes, to first update the subtree. Then, modify the fuzz test to address review comments: * bitcoin/bitcoin#35118 (comment) * bitcoin/bitcoin#35118 (comment) ACKs for top commit: ryanofsky: Code review ACK 7644642. Just fuzz test clang-format cleanups added since last review, which seem nice Tree-SHA512: 0836628f8ee54adf02571025456211a74f63d05058b72280b10111ecfbb93d30945f4a48f30cc790774de4e2b489907313e86b0fa6729f3480c64850c94848b4
…d9ec7f3d4 70d9ec7f3d4 Merge bitcoin/bitcoin#34538: net: advertise -externalip addresses 7bff765d514 Merge bitcoin/bitcoin#35639: external_signer: validate fingerprint from enumerate response 773b1c9aa58 Merge bitcoin/bitcoin#35572: coins: make cursor iteration DB-only 8d9e4f8dbd8 Merge bitcoin/bitcoin#35633: wallet: avoid call bumpfeediscount with negative values c4216e885a6 Merge bitcoin/bitcoin#35723: fuzz: Drop unnecessary mutexes 240d5f743aa fuzz: Drop unnecessary mutexes cf0368fb76e Merge bitcoin/bitcoin#35720: ipc: Update libmultiprocess subtree and drop fuzz test workaround 2d4065d1fe4 Merge bitcoin/bitcoin#35718: ci: Update lint container dependencies 8d9fbf76664 Merge bitcoin/bitcoin#35380: kernel: expose witness stack and scriptSig for btck_TransactionInput fab8eeed82c fuzz: clang-format LIMITED_WHILE fa0d777ce2a fuzz: Clang-format LIMITED_WHILE like while fa1a9bde5a6 fuzz: Remove unused workaround after fix in libmultiprocess byte-span serializer fa55385ab36 fuzz: Use LIMITED_WHILE over for-loop with consumed size integral fa911d815db Merge commit '6d5f753921578eefdd3fce64cfc8ee7951b6cbc4' into HEAD 6d5f7539215 Squashed 'src/ipc/libmultiprocess/' changes from 28e056576a..e8de5c7b68 900a7785bf5 ci: use Ubuntu 26.04 for lint container 058a73a0aea ci: use uv 11.x 14f4ddcb554 ci: mypy 2.3.0 54e1a95a12e Merge bitcoin/bitcoin#35719: ci: disable Qt build in OpenBSD cross job b0e09511586 ci: disable Qt build in OpenBSD cross job 734c34bafda Merge bitcoin/bitcoin#35427: depends: Build `qt` and `qrencode` packages on OpenBSD ee61b11a9e7 Merge bitcoin/bitcoin#35200: node: smooth oversized `dbcache` warnings e3554bf361f Merge bitcoin/bitcoin#35579: wallet: reserve walletrescan before checking wallet is at the tip 11ae4265522 Merge bitcoin/bitcoin#35715: cmake: Fix WITH_EXTERNAL_LIBMULTIPROCESS + BUILD_FUZZ_BINARY e544413c0de Merge bitcoin/bitcoin#32763: wallet: Replace CWalletTx::mapValue and vOrderForm with explicit class members fe1cb6e40d7 Merge bitcoin/bitcoin#35690: wallet: Introduce WalletError with machine-readable error code 441f3114f57 Merge bitcoin/bitcoin#35659: Clarify supported *BSD releases and drop outdated workarounds 0399df827c6 Merge bitcoin/bitcoin#35708: depends: capnp 1.5.0 1ab1fdd4696 Merge bitcoin/bitcoin#35705: bench: replace CreateMockableWalletDatabase with MakeInMemoryWalletDatabase db35b9238fc ipc # build: Fix fuzz target CMakeLists.txt for external libmultiprocess d18fec892e2 Merge bitcoin/bitcoin#35698: doc: Update enum class constant naming style guide a2e4cd7ad2a depends: capnp 1.5.0 7508ac319d9 bench: replace CreateMockableWalletDatabase with MakeInMemoryWalletDatabase 907e284e303 Merge bitcoin/bitcoin#35701: test: Remove `mock_process.cpp` c8459b6bdcd Merge bitcoin/bitcoin#35568: txospenderindex: disable bloom filters to optimize disk usage 63c5f9d22c0 test: Remove `mock_process.cpp` ef101b04a8d Merge bitcoin/bitcoin#35655: wallet: Use in-memory SQLite for temporary wallet in exportwatchonlywallet b6becf3534c Merge bitcoin/bitcoin#35684: Update libmultiprocess subtree to add `max_connections` option 930f25050f7 Merge bitcoin/bitcoin#35700: doc: archive release notes for v29.4 9b2b3f4ec6f doc: archive release notes for v29.4 297fd1489bb Merge bitcoin/bitcoin#35412: ci: add NetBSD Clang cross job e314869066b Merge bitcoin/bitcoin#35695: Remove myself as security contact e3d67a5eae5 Merge bitcoin/bitcoin#35691: chainparams: delete my DNS seed a8223bb4e62 wallet: Introduce WalletError with machine-readable error code fad5809cb92 doc: Update enum class constant naming style guide 7d8137c1417 Merge bitcoin/bitcoin#34897: indexes: Don't commit ahead of the flushed chainstate 629df81e4c6 Remove myself as security contact d164a043426 node: smooth oversized `-dbcache` warnings d9080639804 chainparams: delete my DNS seed e9ed898a0da validation: Don't use m_chain.Tip() in FlushStateToDisk 3679f1ecf5e index: Don't commit ahead of the flushed chainstate 65735728a5a index: Remove return value from Commit() 09c06960c6a validation: track last flushed block 13c02b5466d test: add test for index commits ahead of the last flushed block c43b7a1115f ci: add netBSD cross CI job 699c21aea47 depends: add netbsd_LDFLAGS 777d23f25c7 test: add regression test for in-memory SQLiteDatabase reopen d1e7f8c986f wallet: use in-memory SQLite for temporary wallet in exportwatchonlywallet ee43743f126 wallet: store m_additional_flags in SQLiteDatabase to fix reopen path a9d1b652f32 Merge commit '707d0ded84563386f770ec17970834c65f8fa938' into pr/subtree-12 707d0ded845 Squashed 'src/ipc/libmultiprocess/' changes from 16bf05dea02..28e056576a3 6667dc4eec7 kernel: expose scriptSig for btck_TransactionInput e6de3a2d3c7 kernel: expose witness stack for btck_TransactionInput 3ae3a94f2bd wallet: avoid call bumpfeediscount with negative values dab7f2c984b test: cover -externalip/onlynet interaction in functional test 657a5aa3f3d test: cover -externalip bypassing -onlynet 8c87e32bd39 net: let -externalip bypass -onlynet f4af02e827b net: add an add_even_if_unreachable argument to AddLocal 2bab6bc73f2 refactor: Drop support for FreeBSD < 14 91b5c8a07c6 refactor: Remove FreeBSD-specific workaround 56701ff6d5c doc: Clarify supported *BSD releases 6d0ea4cf5bd doc: add release notes a2b1c86903a txospenderindex: disable bloom filters to optimize disk usage 4c9de7d5b32 external_signer: validate fingerprint from enumerate response fed3cf6f0ed wallet: Replace CWalletTx's vOrderForm with specific fields 4f8823e8e11 wallet: Drop vOrderForm from CommitTransaction 9e62e4b1f34 test: slow down rescaning process a2b0bfcd854 wallet: Drop mapValue from CWalletTx cb99864c91c wallet: Throw if unknown entry is found in mapValue 98d5cdae663 wallet: Make CWalletTx "replaces_txid" and "replaced_by_txid" member variables 7ef8a6efc2a wallet: Make CWalletTx "comment" and "to" member variables 2155e913d3e wallet: Make CWalletTx "from" and "message" member variables c6ba98dcc8a wallet: Drop mapValue from CommitTransaction 00abb174a80 wallet: Pass comment and comment_to to CommitTransaction 1a219a37a21 wallet: Pass replaces_txid to CommitTransaction outside of mapValue 72db4accbf5 coins: drop stale cursor null checks 3d2f2d8de09 coins: pass UTXO stats view by reference 35aedb28236 coins: drop cursor from base view c6fbe2f66cf coins: pass DB view to cursor users 336f5a738b3 wallet: reserve walletrescan before checking wallet is at the tip a54ec373a69 depends: Build `qt` and `qrencode` packages for OpenBSD hosts git-subtree-dir: libbitcoinkernel-sys/bitcoin git-subtree-split: 70d9ec7f3d452789d04dce81dc02db0b3b778bb5
…drop fuzz test workaround fab8eeed82cc784f05a7407da0245e6f44563778 fuzz: clang-format LIMITED_WHILE (MarcoFalke) fa0d777ce2a91816ab0a6bd8a0f389e4840e84c5 fuzz: Clang-format LIMITED_WHILE like while (MarcoFalke) fa1a9bde5a614d052a188a2e0756d2475ce777e0 fuzz: Remove unused workaround after fix in libmultiprocess byte-span serializer (MarcoFalke) fa55385ab36c6989a8583416759612195389c1b6 fuzz: Use LIMITED_WHILE over for-loop with consumed size integral (MarcoFalke) 6d5f753 Squashed 'src/ipc/libmultiprocess/' changes from 28e056576a..e8de5c7b68 (MarcoFalke) Pull request description: Includes several changes, to first update the subtree. Then, modify the fuzz test to address review comments: * bitcoin/bitcoin#35118 (comment) * bitcoin/bitcoin#35118 (comment) ACKs for top commit: ryanofsky: Code review ACK fab8eeed82cc784f05a7407da0245e6f44563778. Just fuzz test clang-format cleanups added since last review, which seem nice Tree-SHA512: 0836628f8ee54adf02571025456211a74f63d05058b72280b10111ecfbb93d30945f4a48f30cc790774de4e2b489907313e86b0fa6729f3480c64850c94848b4
…support and fix race conditions d5f7524 doc: Bump minimum required Cap'n Proto version to 0.9.2 (Ryan Ofsky) 4898199 build: suppress -Wc++23-lambda-attributes in warn_interface (Ryan Ofsky) 270f5db Squashed 'src/ipc/libmultiprocess/' changes from e8de5c7..acded1aafae (Ryan Ofsky) Pull request description: The changes can be verified by running `test/lint/git-subtree-check.sh src/ipc/libmultiprocess` as described in [developer notes](https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#subtrees) and [lint instructions](https://github.com/bitcoin/bitcoin/tree/master/test/lint#git-subtree-checksh). Changes since last subtree update (#35720): - Adds support for nonunix platforms, making API changes that are not backwards compatible ([#274](bitcoin-core/libmultiprocess#274)). Follow-ups add a `CurrentThread()` accessor matching compatibility code in [#35084](#35084) ([#323](bitcoin-core/libmultiprocess#323)) and remove code for Cap'n Proto versions before 0.9 ([#331](bitcoin-core/libmultiprocess#331)). - Fixes a data race between IPC calls running on worker threads and disconnects, found by Antithesis ([#349](bitcoin-core/libmultiprocess#349)). - Fixes a use-after-free when a socket disconnects before `ConnectStream` connects, and leaks and hangs when a client `construct()` call throws ([#298](bitcoin-core/libmultiprocess#298)). - Fixes a race where file descriptors from `SpawnProcess` could leak into processes forked at the same time by other threads, by clearing `FD_CLOEXEC` in the child after forking ([#311](bitcoin-core/libmultiprocess#311)). - Makes `SpawnProcess` report `exec` failures back to the parent and throw, reaping the child ([#312](bitcoin-core/libmultiprocess#312)). - Adds support for `std::chrono::time_point` fields ([#303](bitcoin-core/libmultiprocess#303)) and for serializing lists of interface objects that need to be moved from ([#304](bitcoin-core/libmultiprocess#304)), both needed by [#10102](#10102). - Accepts container fields and parameters with any comparator, hash, and allocator types, like Bitcoin Core's `GCSFilter::ElementSet`, needed by [#29409](#29409) ([#379](bitcoin-core/libmultiprocess#379)). - Finds the `capnp` tool in vcpkg and Windows builds, needed by [#32387](#32387) ([#317](bitcoin-core/libmultiprocess#317)). - Adds a `destroy_connection` option to `ServeStream` and `ConnectStream`, lets `ServeStream` take ownership of the init object and return the new server and its connection, and adds an `EventLoop::incomingConnections()` accessor, simplifying test setup in both repositories and needed by [#35932](#35932) ([#365](bitcoin-core/libmultiprocess#365)). - Replaces `EventLoop::post()` with `sync()` taking a `kj::FunctionParam`, avoiding a heap allocation per call ([#347](bitcoin-core/libmultiprocess#347)). - Names threads spawned by the event loop so they can be told apart in tools and logs ([#324](bitcoin-core/libmultiprocess#324)). - Fixes warnings that Bitcoin Core enables or plans to enable: adds `[[noreturn]]` attributes for `-Wmissing-noreturn` ([#339](bitcoin-core/libmultiprocess#339), for [#35911](#35911)), and fixes `-Wunused` ([#362](bitcoin-core/libmultiprocess#362), for [#36167](#36167)), `-Wunused-const-variable` and `-Wundef` ([#370](bitcoin-core/libmultiprocess#370)), and `-Wmissing-prototypes` ([#386](bitcoin-core/libmultiprocess#386), for [#36743](#36743)) warnings. - Fails at compile time with a suggested workaround when Cap'n Proto misdetects exception support (`KJ_NO_EXCEPTIONS`), as happens on NetBSD ([#364](bitcoin-core/libmultiprocess#364)). - Build improvements: fixes stale generated code when the `mpgen` binary changes ([#316](bitcoin-core/libmultiprocess#316)), fixes `mpgen` link order for static Cap'n Proto builds ([#367](bitcoin-core/libmultiprocess#367)), links `mpgen` against `kj-async` instead of `capnp-rpc` ([#327](bitcoin-core/libmultiprocess#327)), shows Cap'n Proto `find_package` diagnostics ([#325](bitcoin-core/libmultiprocess#325)), installs `type-unordered-set.h` and `version.h` ([#350](bitcoin-core/libmultiprocess#350)), and shows include-what-you-use errors instead of failing silently ([#371](bitcoin-core/libmultiprocess#371)). - Test, CI, documentation, and minor code improvements: fix for a startup race in the example program ([#315](bitcoin-core/libmultiprocess#315)), new test for immediate client disconnects in `ListenConnections` ([#310](bitcoin-core/libmultiprocess#310)), `ReadList` return value check ([#338](bitcoin-core/libmultiprocess#338)), connect test race fix ([#343](bitcoin-core/libmultiprocess#343)) and cleanups ([#344](bitcoin-core/libmultiprocess#344)), `std::ranges::copy` follow-ups ([#307](bitcoin-core/libmultiprocess#307)), trailing whitespace removal ([#345](bitcoin-core/libmultiprocess#345)), Cap'n Proto version documentation fix ([#357](bitcoin-core/libmultiprocess#357)), clang-tidy updates ([#358](bitcoin-core/libmultiprocess#358), [#360](bitcoin-core/libmultiprocess#360), [#380](bitcoin-core/libmultiprocess#380), [#389](bitcoin-core/libmultiprocess#389)), new CI job testing newer cmake and Cap'n Proto versions ([#212](bitcoin-core/libmultiprocess#212), [#359](bitcoin-core/libmultiprocess#359)), CI coverage for the minimum supported g++ ([#330](bitcoin-core/libmultiprocess#330), [#366](bitcoin-core/libmultiprocess#366)), new CI warnings ([#332](bitcoin-core/libmultiprocess#332), [#341](bitcoin-core/libmultiprocess#341)), CI parallelism ([#334](bitcoin-core/libmultiprocess#334), [#356](bitcoin-core/libmultiprocess#356)), CI diagnostics ([#351](bitcoin-core/libmultiprocess#351), [#352](bitcoin-core/libmultiprocess#352)), Nix and LLVM updates ([#296](bitcoin-core/libmultiprocess#296), [#363](bitcoin-core/libmultiprocess#363)), NetBSD and OpenBSD CI fixes ([#321](bitcoin-core/libmultiprocess#321), [#340](bitcoin-core/libmultiprocess#340), [#381](bitcoin-core/libmultiprocess#381)), building Cap'n Proto with GCC in the 32-bit CI job to avoid an ABI mismatch ([#383](bitcoin-core/libmultiprocess#383)), and GitHub Actions updates ([#387](bitcoin-core/libmultiprocess#387)). The second commit suppresses the clang `-Wc++23-lambda-attributes` warning, which the new `[[noreturn]]` lambda attribute in `mp/proxy-types.h` triggers in C++20 builds. Since #31507 the Windows build uses clang-cl, so the same flag covers it. The third commit updates the minimum Cap'n Proto version in `doc/dependencies.md` to 0.9.2 (1.0 with Clang). This update raises libmultiprocess's own minimum from 0.7 to 0.9 (bitcoin-core/libmultiprocess#331), and libmultiprocess rejects 0.9.0 and 0.9.1 for CVE-2022-46149 and, with Clang 16 or newer, every version before 1.0. ACKs for top commit: fanquake: ACK d5f7524 willcl-ark: ACK d5f7524 Tree-SHA512: 4064944f4d8bb6c1665ddc7d5fae838492235d7dfdafab88b19b687ff6892460a3f450b90a145b287866330c569b862d748c941a70c65abc7f273ef13e490fd7
Includes several changes, to first update the subtree. Then, modify the fuzz test to address review comments: