Skip to content

Conversation

@ryanofsky
Copy link
Collaborator

Fix ubuntu 22.04 compatibility issue reported by fanquake in bitcoin/bitcoin#33176 and add CI job to make sure libmultiprocess stays compatible with old versions of Cap'n Proto.

Changes are described in more detail in commit messages.

@DrahtBot
Copy link

DrahtBot commented Aug 12, 2025

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK Sjors, TheCharlatan

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

@ryanofsky
Copy link
Collaborator Author

ryanofsky commented Aug 12, 2025

Updated 151ef65 -> c659685 (pr/string.1 -> pr/string.2, compare) testing some more intermediate versions
Updated c659685 -> 88d9504 (pr/string.2 -> pr/string.3, compare) adding missing file

rev = "v${capnprotoVersion}";
hash = lib.attrByPath [capnprotoVersion] "" capnprotoHashes;
};
patches = lib.optionals (lib.versionAtLeast capnprotoVersion "0.9.0" && lib.versionOlder capnprotoVersion "0.10.4") [ ./ci/patches/spaceship.patch ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

88d9504: do I read this correctly as: apply patch to versions 0.9.0 <= ... < 0.10.4?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re: #194 (comment)

88d9504: do I read this correctly as: apply patch to versions 0.9.0 <= ... < 0.10.4?

Yes that's right. These versions of capnproto added some c++20 support which didn't actually work with later compiler versions.

@Sjors
Copy link
Member

Sjors commented Aug 13, 2025

utACK 88d9504

The kj/string.h header installed by capnproto 0.8 doesn't work well when
compiling with -std=c++20 or later because the reverse StringPtr/char*
comparison function it provides is broken in c++20:

inline bool operator==(const char* a, const StringPtr& b) { return b == a; }

Before C++20 this would implicitly convert `a` to a StringPtr and call the
StringPtr::operator== method. But starting with C++20 it actually calls itself
recursively and either loops forever or crashes.

This problem was fixed upstream by
capnproto/capnproto#1170 in Cap'n Proto 0.9.0. Avoid
the problem here for older versions by just not using the operator. A CI job
testing older versions is added in the next commit to avoid similar breakage in
the future.
The CI job currently just tests old Cap'n Proto versions, but it might be nice
to extend in the future to test old compilers & build tools too.

Support for versions of Cap'n Proto before 0.7.0 was dropped in
bitcoin-core#88 in order to avoid
compiler warnings and simplify code. Before that, versions back to 0.5 were
supported and are basically still compatible since the Cap'n Proto API hasn't
changed and libmultiprocess does not rely on newer features.
ryanofsky added a commit that referenced this pull request Aug 13, 2025
30930df build: require CapnProto 0.7.0 or better (Sjors Provoost)

Pull request description:

  Although 1.0.1. is the oldest version currently covered by Bitcoin Core's extensive CI, Debian Bookwork ships 0.9.2 and #194 introduces test coverage for even older versions. 0.7 has been required since #88.

  The CI run of Sjors/bitcoin#100 @ [3d55222](https://github.com/Sjors/bitcoin/pull/100/checks?sha=3d552223712eed88d17e5ead1ef7d1ba6fd7e89e) previously checked Bitcoin Core CI against 1.0.1 as the minimum. Lowering the minimum further should not be a problem for that CI.

ACKs for top commit:
  ryanofsky:
    Code review ACK 30930df. Planning to follow up in #194 to actually test minimum version and error if capnproto version detected is affected by CVE-2022-46149

Tree-SHA512: bed5843973c8ff1f0b2bd93efe7169824c2306097efefaace1752efeb06606df765b68b7ef50c07f5d703010c4d1b324099d6780fa0363e126d34ac1307fba1a
Also document minimum Cap'n Proto version in doc/install.md
Copy link
Collaborator Author

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased 88d9504 -> dc3ba22 (pr/string.3 -> pr/string.4, compare) on top of #193 and added explicit check for CVE-2022-46149

rev = "v${capnprotoVersion}";
hash = lib.attrByPath [capnprotoVersion] "" capnprotoHashes;
};
patches = lib.optionals (lib.versionAtLeast capnprotoVersion "0.9.0" && lib.versionOlder capnprotoVersion "0.10.4") [ ./ci/patches/spaceship.patch ];
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re: #194 (comment)

88d9504: do I read this correctly as: apply patch to versions 0.9.0 <= ... < 0.10.4?

Yes that's right. These versions of capnproto added some c++20 support which didn't actually work with later compiler versions.

@Sjors
Copy link
Member

Sjors commented Aug 13, 2025

utACK dc3ba22

Thanks for adding the CVE version check.

Copy link
Collaborator

@TheCharlatan TheCharlatan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK dc3ba22

OR CapnProto_VERSION STREQUAL "0.10.0"
OR CapnProto_VERSION STREQUAL "0.10.1"
OR CapnProto_VERSION STREQUAL "0.10.2")
message(FATAL_ERROR
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't ipc a trusted interface, where anyone having access can already fully control the process (like calling createTransaction), so leaking memory should not make anything worse? A warning seems fine here? Also, a cve check seems a bit unrelated from a C++20 code workaround (from the title).

Just a nit and not a blocker, but I wanted to mention it, since this will lead to a compile error on Ubuntu 22.04 (bitcoin/bitcoin#33176 (comment)), for an option that will be enabled by default?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For ubuntu 22.04 if this will create confusion, I feel like a good solution might be to improve error message and documentation to specifically suggest disabling ENABLE_IPC, or installing a newer version of capnproto. Ideally it seems like ubuntu could update from 0.8.0 to 0.8.1 given 0.8.1 was released to fix the CVE and doesn't have any other changes.

On IPC being a trusted interface, it's definitely true with the current interface, a malicious client could do a lot of things to crash the node and maybe even take control of it. But this doesn't have to be the case. We could provide capnproto interfaces that do rigorously check all their inputs and enforce resource constraints. It would even be possible to adapt the Mining interface to do this, but it hasn't been a reason to make the extra effort. I also feel like showing an error after discovering a package with a CVE is kind of a public service, since we don't know if there may be other software using the package.

willcl-ark added a commit to willcl-ark/bitcoin-core-docker that referenced this pull request Aug 21, 2025
Currently the version of capnproto on Debian 12, 0.9.2, does not play
well with `mpgen` used by recently-merged multiprocess PR #31802.

This is currently being worked on: bitcoin-core/libmultiprocess#194

... but in the meantime bump Debian versions to fix.
@ryanofsky ryanofsky merged commit 1b8d4a6 into bitcoin-core:master Aug 22, 2025
5 checks passed
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In commit "mpgen: Work around c++20 / capnproto 0.8 incompatibility" (c4cb758)

I think commit message is wrong in suggesting that with c++20 the operator== function is buggy and will call itself recursively. It seems the reason this happens is not really because of c++20 but because of a gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53499. See also bitcoin/bitcoin#33176 (comment)

ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Aug 22, 2025
…6f1e54

1b8d4a6f1e54 Merge bitcoin-core/libmultiprocess#194: mpgen: Work around c++20 / capnproto 0.8 incompatibility
f1fad396bf5f Merge bitcoin-core/libmultiprocess#195: ci: Add openbsd
eed42f210d17 ci: Bump all tasks to actions/checkout@v5
486a510bbeff ci: Remove ancient and problematic -lstdc++fs in mpexample
dd40897efe79 Add missing thread include
98414e7d2867 ci: Add openbsd
dc3ba2204606 cmake, doc: Add check for CVE-2022-46149
cb170d4913a2 Merge bitcoin-core/libmultiprocess#193: build: require CapnProto 0.7.0 or better
8ceeaa6ae401 ci: Add olddeps job to test old dependencies versions
c4cb758eccb5 mpgen: Work around c++20 / capnproto 0.8 incompatibility
30930dff7b06 build: require CapnProto 0.7.0 or better

git-subtree-dir: src/ipc/libmultiprocess
git-subtree-split: 1b8d4a6f1e54b92708bd2ad627ec6d440a1daf3d
Sjors added a commit to Sjors/bitcoin that referenced this pull request Aug 25, 2025
1b8d4a6f1e Merge bitcoin-core/libmultiprocess#194: mpgen: Work around c++20 / capnproto 0.8 incompatibility
f1fad396bf Merge bitcoin-core/libmultiprocess#195: ci: Add openbsd
eed42f210d ci: Bump all tasks to actions/checkout@v5
486a510bbe ci: Remove ancient and problematic -lstdc++fs in mpexample
dd40897efe Add missing thread include
98414e7d28 ci: Add openbsd
dc3ba22046 cmake, doc: Add check for CVE-2022-46149
cb170d4913 Merge bitcoin-core/libmultiprocess#193: build: require CapnProto 0.7.0 or better
8ceeaa6ae4 ci: Add olddeps job to test old dependencies versions
c4cb758ecc mpgen: Work around c++20 / capnproto 0.8 incompatibility
30930dff7b build: require CapnProto 0.7.0 or better

git-subtree-dir: src/ipc/libmultiprocess
git-subtree-split: 1b8d4a6f1e54b92708bd2ad627ec6d440a1daf3d
Sjors added a commit to Sjors/bitcoin that referenced this pull request Aug 25, 2025
1b8d4a6f1e Merge bitcoin-core/libmultiprocess#194: mpgen: Work around c++20 / capnproto 0.8 incompatibility
f1fad396bf Merge bitcoin-core/libmultiprocess#195: ci: Add openbsd
eed42f210d ci: Bump all tasks to actions/checkout@v5
486a510bbe ci: Remove ancient and problematic -lstdc++fs in mpexample
dd40897efe Add missing thread include
98414e7d28 ci: Add openbsd
dc3ba22046 cmake, doc: Add check for CVE-2022-46149
cb170d4913 Merge bitcoin-core/libmultiprocess#193: build: require CapnProto 0.7.0 or better
8ceeaa6ae4 ci: Add olddeps job to test old dependencies versions
c4cb758ecc mpgen: Work around c++20 / capnproto 0.8 incompatibility
30930dff7b build: require CapnProto 0.7.0 or better

git-subtree-dir: src/ipc/libmultiprocess
git-subtree-split: 1b8d4a6f1e54b92708bd2ad627ec6d440a1daf3d
Sjors added a commit to Sjors/bitcoin that referenced this pull request Aug 25, 2025
1b8d4a6f1e Merge bitcoin-core/libmultiprocess#194: mpgen: Work around c++20 / capnproto 0.8 incompatibility
f1fad396bf Merge bitcoin-core/libmultiprocess#195: ci: Add openbsd
eed42f210d ci: Bump all tasks to actions/checkout@v5
486a510bbe ci: Remove ancient and problematic -lstdc++fs in mpexample
dd40897efe Add missing thread include
98414e7d28 ci: Add openbsd
dc3ba22046 cmake, doc: Add check for CVE-2022-46149
cb170d4913 Merge bitcoin-core/libmultiprocess#193: build: require CapnProto 0.7.0 or better
8ceeaa6ae4 ci: Add olddeps job to test old dependencies versions
c4cb758ecc mpgen: Work around c++20 / capnproto 0.8 incompatibility
30930dff7b build: require CapnProto 0.7.0 or better

git-subtree-dir: src/ipc/libmultiprocess
git-subtree-split: 1b8d4a6f1e54b92708bd2ad627ec6d440a1daf3d
achow101 added a commit to bitcoin/bitcoin that referenced this pull request Aug 25, 2025
dd68d0f Squashed 'src/ipc/libmultiprocess/' changes from b4120d34bad2..1b8d4a6f1e54 (Ryan Ofsky)

Pull request description:

  Includes:

  - bitcoin-core/libmultiprocess#193
  - bitcoin-core/libmultiprocess#195
  - bitcoin-core/libmultiprocess#194

  These changes are needed to build fix libmultiprocess build issue that happens on OpenBSD and work around an incompatibility between GCC versions <14 and cap'nproto versions  <0.9 when compiling with c++20 that was fixed upstream in capnproto/capnproto#1170. The issues were reported:

  - #33219
  - #33176
  - willcl-ark/bitcoin-core-docker#43

  The fixes added CI jobs upstream to catch these issues earlier.

  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)

ACKs for top commit:
  Sjors:
    ACK 323b3fd
  achow101:
    ACK 323b3fd
  hebasto:
    ACK 323b3fd, I've reproduced the subtree update locally. The two issues noted in this PR are unrelated to its changes and can be addressed separately.

Tree-SHA512: 3d03693d269c04d9ed10e8dd03e8059062929f37616d974c6fdf346ee62737c990ec550e013575e7474bfa4efcead3938bf9b259d62c073d76e720ebafe4ff66
@willcl-ark
Copy link
Member

I'm not sure, as you say this was fixed upstream in v0.9 , but I think I might still be hitting this on debian bookworm with 0.9.2?:

<snip>

-- Checking for module 'capnp'
--   Found capnp, version 0.9.2
-- Checking for module 'capnpc'
--   Found capnpc, version 0.9.2
-- Checking for module 'capnp-rpc'
--   Found capnp-rpc, version 0.9.2
-- Checking for module 'capnp-json'
--   Found capnp-json, version 0.9.2
-- Checking for module 'capnp-websocket'
--   Found capnp-websocket, version 0.9.2
-- Checking for module 'kj'
--   Found kj, version 0.9.2
-- Checking for module 'kj-async'
--   Found kj-async, version 0.9.2
-- Checking for module 'kj-http'
--   Found kj-http, version 0.9.2
-- Checking for module 'kj-gzip'
--   Found kj-gzip, version 0.9.2
-- Checking for module 'kj-tls'
--   Found kj-tls, version 0.9.2
-- Checking for module 'kj-test'
--   Found kj-test, version 0.9.2

<snip>

C++ compiler .......................... Clang 19.1.4, /usr/bin/clang++-19
CMAKE_BUILD_TYPE ...................... RelWithDebInfo
Preprocessor defined macros ...........
C++ compiler flags .................... -O2 -g -std=c++20 -fPIC -fdebug-prefix-map=/src/bitcoin/src=. -fmacro-prefix-map=/src/bitcoin/src=. -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -Wstack-protector -fstack-protector-all -fcf-protection=full -fstack-clash-protection -Wall -Wextra -Wgnu -Wformat -Wformat-security -Wvla -Wshadow-field -Wthread-safety -Wloop-analysis -Wredundant-decls -Wunused-member-function -Wdate-time -Wconditional-uninitialized -Woverloaded-virtual -Wsuggest-override -Wimplicit-fallthrough -Wunreachable-code -Wdocumentation -Wself-assign -Wundef -Wno-unused-parameter
Linker flags .......................... -O2 -g -fstack-protector-all -fcf-protection=full -fstack-clash-protection -Wl,-z,relro -Wl,-z,now -Wl,-z,separate-code -fPIE -pie

<snip>

In file included from /src/bitcoin/src/ipc/libmultiprocess/src/mp/util.cpp:6:
In file included from /src/bitcoin/src/ipc/libmultiprocess/include/mp/util.h:8:
In file included from /usr/include/capnp/schema.h:39:
In file included from /usr/include/capnp/schema.capnp.h:6:
In file included from /usr/include/capnp/generated-header-support.h:27:
In file included from /usr/include/capnp/layout.h:34:
/usr/include/capnp/blob.h:176:74: error: invalid operands to binary expression ('const char *' and 'kj::StringPtr')
  176 | inline bool operator==(const char* a, const Text::Builder& b) { return a == b.asString(); }
      |                                                                        ~ ^  ~~~~~~~~~~~~
/usr/include/kj/common.h:744:13: note: candidate function template not viable: no known conversion from 'kj::StringPtr' to 'MaxValue_' for 2nd argument
  744 | inline bool operator==(T t, MaxValue_) { return t == Decay<T>(maxValue); }
      |             ^               ~~~~~~~~~
/usr/include/kj/common.h:746:13: note: candidate function template not viable: no known conversion from 'kj::StringPtr' to 'MinValue_' for 2nd argument
  746 | inline bool operator==(T t, MinValue_) { return t == Decay<T>(minValue); }
      |             ^               ~~~~~~~~~
/usr/include/capnp/blob.h:176:13: note: candidate function not viable: no known conversion from 'kj::StringPtr' to 'const Text::Builder' for 2nd argument
  176 | inline bool operator==(const char* a, const Text::Builder& b) { return a == b.asString(); }
      |             ^                         ~~~~~~~~~~~~~~~~~~~~~~
/usr/include/kj/common.h:744:13: note: candidate function (with reversed parameter order) template not viable: no known conversion from 'const char *' to 'MaxValue_' for 1st argument
  744 | inline bool operator==(T t, MaxValue_) { return t == Decay<T>(maxValue); }
      |             ^          ~~~
/usr/include/kj/common.h:746:13: note: candidate function (with reversed parameter order) template not viable: no known conversion from 'const char *' to 'MinValue_' for 1st argument
  746 | inline bool operator==(T t, MinValue_) { return t == Decay<T>(minValue); }
      |             ^          ~~~
/usr/include/capnp/blob.h:176:13: note: candidate function (with reversed parameter order) not viable: no known conversion from 'const char *' to 'const Text::Builder' for 1st argument
  176 | inline bool operator==(const char* a, const Text::Builder& b) { return a == b.asString(); }
      |             ^          ~~~~~~~~~~~~~
/usr/include/capnp/blob.h:177:74: error: invalid operands to binary expression ('const char *' and 'kj::StringPtr')
  177 | inline bool operator!=(const char* a, const Text::Builder& b) { return a != b.asString(); }
      |                                                                        ~ ^  ~~~~~~~~~~~~
/usr/include/kj/common.h:744:13: note: candidate function template not viable: no known conversion from 'kj::StringPtr' to 'MaxValue_' for 2nd argument
  744 | inline bool operator==(T t, MaxValue_) { return t == Decay<T>(maxValue); }
      |             ^               ~~~~~~~~~
/usr/include/kj/common.h:746:13: note: candidate function template not viable: no known conversion from 'kj::StringPtr' to 'MinValue_' for 2nd argument
  746 | inline bool operator==(T t, MinValue_) { return t == Decay<T>(minValue); }
      |             ^               ~~~~~~~~~
/usr/include/capnp/blob.h:176:13: note: candidate function not viable: no known conversion from 'kj::StringPtr' to 'const Text::Builder' for 2nd argument
  176 | inline bool operator==(const char* a, const Text::Builder& b) { return a == b.asString(); }
      |             ^                         ~~~~~~~~~~~~~~~~~~~~~~
/usr/include/capnp/blob.h:177:13: note: candidate function not viable: no known conversion from 'kj::StringPtr' to 'const Text::Builder' for 2nd argument
  177 | inline bool operator!=(const char* a, const Text::Builder& b) { return a != b.asString(); }
      |             ^                         ~~~~~~~~~~~~~~~~~~~~~~
/usr/include/kj/common.h:744:13: note: candidate function (with reversed parameter order) template not viable: no known conversion from 'const char *' to 'MaxValue_' for 1st argument
  744 | inline bool operator==(T t, MaxValue_) { return t == Decay<T>(maxValue); }
      |             ^          ~~~
/usr/include/kj/common.h:746:13: note: candidate function (with reversed parameter order) template not viable: no known conversion from 'const char *' to 'MinValue_' for 1st argument
  746 | inline bool operator==(T t, MinValue_) { return t == Decay<T>(minValue); }
      |             ^          ~~~
2 errors generated.
gmake[2]: *** [src/ipc/libmultiprocess/CMakeFiles/mputil.dir/build.make:76: src/ipc/libmultiprocess/CMakeFiles/mputil.dir/src/mp/util.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:900: src/ipc/libmultiprocess/CMakeFiles/mputil.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....

log.txt

May also be a different issue (in which case I can open a new issue here or in bitcoin/bitcoin if that would be more appropriate).

@maflcko
Copy link
Contributor

maflcko commented Sep 1, 2025

I'm not sure, as you say this was fixed upstream in v0.9 , but I think I might still be hitting this on debian bookworm with 0.9.2?:

Yeah, to reproduce:

diff --git a/ci/configs/openbsd.bash b/ci/configs/openbsd.bash
index a404e2b..70ae010 100644
--- a/ci/configs/openbsd.bash
+++ b/ci/configs/openbsd.bash
@@ -1,5 +1,6 @@
 CI_DESC="CI config for OpenBSD"
 CI_DIR=build-openbsd
+export CXX=clang++-16
 export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter"
 CMAKE_ARGS=(-G Ninja)
 BUILD_ARGS=(-k 0)

And (on debian:bookworm !):

# CI_CLEAN=1 CI_CONFIG="ci/configs/openbsd.bash" bash ci/scripts/ci.sh 
+ '[' x ']'
+ source ci/configs/openbsd.bash
++ CI_DESC='CI config for OpenBSD'
++ CI_DIR=build-openbsd
++ export CXX=clang++-16
++ CXX=clang++-16
++ export 'CXXFLAGS=-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter'
++ CXXFLAGS='-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter'
++ CMAKE_ARGS=(-G Ninja)
++ BUILD_ARGS=(-k 0)
+ : build-openbsd
+ '[' -v BUILD_TARGETS ']'
+ BUILD_TARGETS=(all tests mpexamples)
+ '[' -n 1 ']'
+ rm -rf build-openbsd
+ cmake -B build-openbsd -G Ninja
-- The CXX compiler identification is Clang 16.0.6
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++-16 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "3.0.17") found components: Crypto SSL 
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1") 
-- Checking for module 'capnp'
--   Found capnp, version 0.9.2
-- Checking for module 'capnpc'
--   Found capnpc, version 0.9.2
-- Checking for module 'capnp-rpc'
--   Found capnp-rpc, version 0.9.2
-- Checking for module 'capnp-json'
--   Found capnp-json, version 0.9.2
-- Checking for module 'capnp-websocket'
--   Found capnp-websocket, version 0.9.2
-- Checking for module 'kj'
--   Found kj, version 0.9.2
-- Checking for module 'kj-async'
--   Found kj-async, version 0.9.2
-- Checking for module 'kj-http'
--   Found kj-http, version 0.9.2
-- Checking for module 'kj-gzip'
--   Found kj-gzip, version 0.9.2
-- Checking for module 'kj-tls'
--   Found kj-tls, version 0.9.2
-- Checking for module 'kj-test'
--   Found kj-test, version 0.9.2
-- Performing Test HAVE_PTHREAD_GETNAME_NP
-- Performing Test HAVE_PTHREAD_GETNAME_NP - Success
-- Performing Test HAVE_PTHREAD_THREADID_NP
-- Performing Test HAVE_PTHREAD_THREADID_NP - Failed
-- Performing Test HAVE_PTHREAD_GETTHREADID_NP
-- Performing Test HAVE_PTHREAD_GETTHREADID_NP - Failed
-- Configuring done
-- Generating done
-- Build files have been written to: /libmultiprocess/build-openbsd
+ cmake --build build-openbsd -t all tests mpexamples -- -k 0
[1/59] Building CXX object CMakeFiles/mputil.dir/src/mp/util.cpp.o
FAILED: CMakeFiles/mputil.dir/src/mp/util.cpp.o 
/usr/bin/clang++-16  -I/libmultiprocess/include -I/libmultiprocess/build-openbsd/include -Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter -std=gnu++20 -MD -MT CMakeFiles/mputil.dir/src/mp/util.cpp.o -MF CMakeFiles/mputil.dir/src/mp/util.cpp.o.d -o CMakeFiles/mputil.dir/src/mp/util.cpp.o -c /libmultiprocess/src/mp/util.cpp
In file included from /libmultiprocess/src/mp/util.cpp:6:
In file included from /libmultiprocess/include/mp/util.h:8:
In file included from /usr/include/capnp/schema.h:39:
In file included from /usr/include/capnp/schema.capnp.h:6:
In file included from /usr/include/capnp/generated-header-support.h:27:
In file included from /usr/include/capnp/layout.h:34:
/usr/include/capnp/blob.h:176:74: error: invalid operands to binary expression ('const char *' and 'kj::StringPtr')
inline bool operator==(const char* a, const Text::Builder& b) { return a == b.asString(); }
                                                                       ~ ^  ~~~~~~~~~~~~
/usr/include/kj/common.h:744:13: note: candidate function template not viable: no known conversion from 'kj::StringPtr' to 'MaxValue_' for 2nd argument
inline bool operator==(T t, MaxValue_) { return t == Decay<T>(maxValue); }
            ^
/usr/include/kj/common.h:744:13: note: candidate function (with reversed parameter order) template not viable: no known conversion from 'const char *' to 'MaxValue_' for 1st argument
/usr/include/kj/common.h:746:13: note: candidate function template not viable: no known conversion from 'kj::StringPtr' to 'MinValue_' for 2nd argument
inline bool operator==(T t, MinValue_) { return t == Decay<T>(minValue); }
            ^
/usr/include/kj/common.h:746:13: note: candidate function (with reversed parameter order) template not viable: no known conversion from 'const char *' to 'MinValue_' for 1st argument
/usr/include/capnp/blob.h:176:13: note: candidate function not viable: no known conversion from 'kj::StringPtr' to 'const Text::Builder' for 2nd argument
inline bool operator==(const char* a, const Text::Builder& b) { return a == b.asString(); }
            ^                                                               ~~~~~~~~~~~~
/usr/include/capnp/blob.h:176:13: note: candidate function (with reversed parameter order) not viable: no known conversion from 'const char *' to 'const Text::Builder' for 1st argument
inline bool operator==(const char* a, const Text::Builder& b) { return a == b.asString(); }
            ^                                                          ~
/usr/include/capnp/blob.h:177:74: error: invalid operands to binary expression ('const char *' and 'kj::StringPtr')
inline bool operator!=(const char* a, const Text::Builder& b) { return a != b.asString(); }
                                                                       ~ ^  ~~~~~~~~~~~~
/usr/include/kj/common.h:744:13: note: candidate function template not viable: no known conversion from 'kj::StringPtr' to 'MaxValue_' for 2nd argument
inline bool operator==(T t, MaxValue_) { return t == Decay<T>(maxValue); }
            ^
/usr/include/kj/common.h:744:13: note: candidate function (with reversed parameter order) template not viable: no known conversion from 'const char *' to 'MaxValue_' for 1st argument
/usr/include/kj/common.h:746:13: note: candidate function template not viable: no known conversion from 'kj::StringPtr' to 'MinValue_' for 2nd argument
inline bool operator==(T t, MinValue_) { return t == Decay<T>(minValue); }
            ^
/usr/include/kj/common.h:746:13: note: candidate function (with reversed parameter order) template not viable: no known conversion from 'const char *' to 'MinValue_' for 1st argument
/usr/include/capnp/blob.h:176:13: note: candidate function not viable: no known conversion from 'kj::StringPtr' to 'const Text::Builder' for 2nd argument
inline bool operator==(const char* a, const Text::Builder& b) { return a == b.asString(); }
            ^
/usr/include/capnp/blob.h:177:13: note: candidate function not viable: no known conversion from 'kj::StringPtr' to 'const Text::Builder' for 2nd argument
inline bool operator!=(const char* a, const Text::Builder& b) { return a != b.asString(); }
            ^                                                               ~~~~~~~~~~~~
2 errors generated.
[2/59] Building CXX object CMakeFiles/mpgen.dir/src/mp/gen.cpp.o
FAILED: CMakeFiles/mpgen.dir/src/mp/gen.cpp.o 
/usr/bin/clang++-16  -I/libmultiprocess/build-openbsd/include -I/libmultiprocess/include -Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter -std=gnu++20 -MD -MT CMakeFiles/mpgen.dir/src/mp/gen.cpp.o -MF CMakeFiles/mpgen.dir/src/mp/gen.cpp.o.d -o CMakeFiles/mpgen.dir/src/mp/gen.cpp.o -c /libmultiprocess/src/mp/gen.cpp
In file included from /libmultiprocess/src/mp/gen.cpp:6:
In file included from /libmultiprocess/include/mp/util.h:8:
In file included from /usr/include/capnp/schema.h:39:
In file included from /usr/include/capnp/schema.capnp.h:6:
In file included from /usr/include/capnp/generated-header-support.h:27:
In file included from /usr/include/capnp/layout.h:34:
/usr/include/capnp/blob.h:176:74: error: invalid operands to binary expression ('const char *' and 'kj::StringPtr')
inline bool operator==(const char* a, const Text::Builder& b) { return a == b.asString(); }
                                                                       ~ ^  ~~~~~~~~~~~~
/usr/include/kj/common.h:744:13: note: candidate function template not viable: no known conversion from 'kj::StringPtr' to 'MaxValue_' for 2nd argument
inline bool operator==(T t, MaxValue_) { return t == Decay<T>(maxValue); }
            ^
/usr/include/kj/common.h:744:13: note: candidate function (with reversed parameter order) template not viable: no known conversion from 'const char *' to 'MaxValue_' for 1st argument
/usr/include/kj/common.h:746:13: note: candidate function template not viable: no known conversion from 'kj::StringPtr' to 'MinValue_' for 2nd argument
inline bool operator==(T t, MinValue_) { return t == Decay<T>(minValue); }
            ^
/usr/include/kj/common.h:746:13: note: candidate function (with reversed parameter order) template not viable: no known conversion from 'const char *' to 'MinValue_' for 1st argument
/usr/include/capnp/blob.h:176:13: note: candidate function not viable: no known conversion from 'kj::StringPtr' to 'const Text::Builder' for 2nd argument
inline bool operator==(const char* a, const Text::Builder& b) { return a == b.asString(); }
            ^                                                               ~~~~~~~~~~~~
/usr/include/capnp/blob.h:176:13: note: candidate function (with reversed parameter order) not viable: no known conversion from 'const char *' to 'const Text::Builder' for 1st argument
inline bool operator==(const char* a, const Text::Builder& b) { return a == b.asString(); }
            ^                                                          ~
/usr/include/capnp/blob.h:177:74: error: invalid operands to binary expression ('const char *' and 'kj::StringPtr')
inline bool operator!=(const char* a, const Text::Builder& b) { return a != b.asString(); }
                                                                       ~ ^  ~~~~~~~~~~~~
/usr/include/kj/common.h:744:13: note: candidate function template not viable: no known conversion from 'kj::StringPtr' to 'MaxValue_' for 2nd argument
inline bool operator==(T t, MaxValue_) { return t == Decay<T>(maxValue); }
            ^
/usr/include/kj/common.h:744:13: note: candidate function (with reversed parameter order) template not viable: no known conversion from 'const char *' to 'MaxValue_' for 1st argument
/usr/include/kj/common.h:746:13: note: candidate function template not viable: no known conversion from 'kj::StringPtr' to 'MinValue_' for 2nd argument
inline bool operator==(T t, MinValue_) { return t == Decay<T>(minValue); }
            ^
/usr/include/kj/common.h:746:13: note: candidate function (with reversed parameter order) template not viable: no known conversion from 'const char *' to 'MinValue_' for 1st argument
/usr/include/capnp/blob.h:176:13: note: candidate function not viable: no known conversion from 'kj::StringPtr' to 'const Text::Builder' for 2nd argument
inline bool operator==(const char* a, const Text::Builder& b) { return a == b.asString(); }
            ^
/usr/include/capnp/blob.h:177:13: note: candidate function not viable: no known conversion from 'kj::StringPtr' to 'const Text::Builder' for 2nd argument
inline bool operator!=(const char* a, const Text::Builder& b) { return a != b.asString(); }
            ^                                                               ~~~~~~~~~~~~
2 errors generated.
ninja: build stopped: cannot make progress due to previous errors.

@ryanofsky
Copy link
Collaborator Author

re: @willcl-ark #194 (comment)

I'm not sure, as you say this was fixed upstream in v0.9 , but I think I might still be hitting this on debian bookworm with 0.9.2?:

If I'm interpreting correctly, debian bookworm uses clang 14 according to https://packages.debian.org/bookworm/clang so maybe doesn't have this issue by default, but I think you will run into this problem with clang-16 and newer. I made a new issue for this #199 so maybe we can figure out a solution there

janus pushed a commit to BitgesellOfficial/bitgesell that referenced this pull request Sep 15, 2025
…6f1e54

1b8d4a6f1e54 Merge bitcoin-core/libmultiprocess#194: mpgen: Work around c++20 / capnproto 0.8 incompatibility
f1fad396bf5f Merge bitcoin-core/libmultiprocess#195: ci: Add openbsd
eed42f210d17 ci: Bump all tasks to actions/checkout@v5
486a510bbeff ci: Remove ancient and problematic -lstdc++fs in mpexample
dd40897efe79 Add missing thread include
98414e7d2867 ci: Add openbsd
dc3ba2204606 cmake, doc: Add check for CVE-2022-46149
cb170d4913a2 Merge bitcoin-core/libmultiprocess#193: build: require CapnProto 0.7.0 or better
8ceeaa6ae401 ci: Add olddeps job to test old dependencies versions
c4cb758eccb5 mpgen: Work around c++20 / capnproto 0.8 incompatibility
30930dff7b06 build: require CapnProto 0.7.0 or better

git-subtree-dir: src/ipc/libmultiprocess
git-subtree-split: 1b8d4a6f1e54b92708bd2ad627ec6d440a1daf3d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants