Unable to generate coverage report using lcov on MacOs 15.3.1 #31927

issue Prabhat1308 opened this issue on February 21, 2025
  1. Prabhat1308 commented at 12:39 PM on February 21, 2025: contributor

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    While trying to get a coverage report , the report generation fails complaining of duplicate function definitions.

    Expected behaviour

    Generate a coverage report for the branch.

    Steps to reproduce

    cmake -B build -DCMAKE_BUILD_TYPE=Coverage
    cmake --build build
    cmake -P build/Coverage.cmake
    

    Relevant log output

    Capturing coverage data from src
    geninfo cmd: '/opt/homebrew/Cellar/lcov/2.3/bin/geninfo src --toolname lcov --output-filename baseline.info --initial --gcov-tool /Users/prabhatverma/projects/bitcoin/build/cov_tool_wrapper.sh'
    Found LLVM gcov version 16.0.0, which emulates gcov version 4.2.0
    Using intermediate gcov format
    Recording 'internal' directories:
            /Users/prabhatverma/projects/bitcoin/build/src
            src
    Writing temporary data to /tmp/geninfo_datI48l
    Scanning src for .gcno files ...
    Found 401 graph files in src
    using: chunkSize: 1, nchunks:401, intervalLength:20
    lcov: WARNING: (gcov) GCOV did not produce any data for /Users/prabhatverma/projects/bitcoin/build/src/secp256k1/src/CMakeFiles/secp256k1_precomputed.dir/precomputed_ecmult.c.gcno
            (use "lcov --ignore-errors gcov,gcov ..." to suppress this warning)
    lcov: WARNING: (gcov) GCOV did not produce any data for /Users/prabhatverma/projects/bitcoin/build/src/secp256k1/src/CMakeFiles/secp256k1_precomputed.dir/precomputed_ecmult_gen.c.gcno
    Message summary:
      1 error message:
        inconsistent: 1
      2 warning messages:
        gcov: 2
    lcov: ERROR: (inconsistent) "/Users/prabhatverma/projects/bitcoin/src/secp256k1/src/scalar_impl.h":67: duplicate function 'secp256k1_scalar_split_lambda' starts on line 67 but previous definition started on 142 while capturing from src/secp256k1/src/CMakeFiles/exhaustive_tests.dir/tests_exhaustive.c.gcno.
            (use "lcov --ignore-errors inconsistent ..." to bypass this error)
    CMake Error at build/CoverageInclude.cmake:45 (execute_process):
      execute_process failed command indexes:
    
        1: "Child return code: 1"
    
    Call Stack (most recent call first):
      build/Coverage.cmake:5 (include)
    

    How did you obtain Bitcoin Core

    Compiled from source

    What version of Bitcoin Core are you using?

    master@5b8fd7c

    Operating system and version

    MacOs Sequoia 15.3.1

    Machine specifications

    No response

  2. maflcko commented at 1:12 PM on February 21, 2025: member

    This is a known issue. While I don't have macOS, some reported that it was working with clang/llvm tooling.

    You can try -DCMAKE_C_COMPILER='clang' -DCMAKE_CXX_COMPILER='clang++' -DCMAKE_CXX_FLAGS='-fprofile-instr-generate -fcoverage-mapping' and llvm-cov/llvm-profdata and see if that works for you.

  3. maflcko added the label Tests on Feb 21, 2025
  4. maflcko commented at 2:29 PM on February 21, 2025: member

    If it works for you, feel free to update the doc/developer-notes.md to mention it. Also, I wonder it it could make sense to add a CMakePreset for a clang coverage build based on the flags?

  5. jonatack commented at 6:32 PM on February 22, 2025: member

    Reproduced the issue on macOS 15.3.1 arm64 m1 max.

  6. fanquake referenced this in commit cfa7f70f6c on Apr 2, 2025
  7. fanquake closed this on Apr 2, 2025

  8. Kino1994 referenced this in commit 45bb84e8d3 on Jun 28, 2026
  9. BigcoinBGC referenced this in commit 38d58a675e on Jun 30, 2026
  10. bitcoin locked this on Jul 30, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-08-23 22:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me