Skip to content

Test interface_ipc.py fails with Duplicate ID error when libmultiprocess is installed system-wide #33417

@zaidmstrr

Description

@zaidmstrr

When I tried to run the interface_ipc.py functional test it failed with the error:

2025-09-17T08:33:50.642653Z TestFramework (INFO): PRNG seed is: 5837581670543711780
2025-09-17T08:33:50.643144Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_qg32uhlp
terminate called after throwing an instance of 'kj::ExceptionImpl'
  what():  mp/proxy.capnp:0: failed: Duplicate ID @0xcc316e3f71a040fb.
Aborted (core dumped)

After further investigating the issue I found that when I have the libmultiprocess library installed system wide this test is failing, and removing the library from the system will make the test run as normal.
The main reason for this is the load_capnp_modules function, which imports certain files and libraries. Here is the breakdown for the issue:

  1. If you have already installed capnp globally on your system. The function will detect it and add the whole path of the /include directory of your system. Which contains all other libraries of your system including capnp and mp (if installed system-wide) library.
  1. This line of code mp_dir = src_dir / "ipc" / "libmultiprocess" / "include" includes the path of libmultiprocess directory inside the Bitcoin source tree.
  2. Now, when the capnp.load() function parses the imports, it will see multiple declarations of the same file. The first implementation was included from the /include path (as this is also the default path for the libmultiprocess library when you install system-wide) and secondly from the Bitcoin internal source tree.

How to reproduce

To reproduce the error you must have capnp and libmultiprocess installed system wide.

Possible Solution

One possible solution is to track when we have libmultiprocess installed system-wide or not. If it's installed system-wide, then don't add the one from the Bitcoin source tree.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions