Thread

  1. Coverage with make coverage-html is broken on latest Debian using lcov v2

    Narek Galstyan <narek.galstyan@enterprisedb.com> — 2026-04-21T14:36:11Z

    Hi all,
    
    On Debian 13 (trixie), `make coverage-html` command triggers an lcov
    failure.
    There have been past reports of this failure in pgsql-hackers here
    <https://www.postgresql.org/message-id/202602261231.mlk2icrqrwpw%40alvherre.pgsql>
    .
    
    APT package repositories on Debian 13  default to lcov v2 (2.3.1-1) which
    is stricter about a few warnings and triggers an error. This commit
    <https://github.com/linux-test-project/lcov/commit/5f659f63801ef7f94c50a0eb5cffa1ea70f73651>in
    lcov details some of the changes for lcov v2, including the stricter error
    handling (see bullet b)).
    
    After applying the attached patches to the current master branch, `make
    coverage-html` starts working with lcov v2.
    
    ---
    
    More details:
    
    Without applying any of the patches, with --enable-coverage and in-tree
    build (no vpath), make check && make coverage-html results in the following
    error:
    
    ```
    /usr/bin/lcov --gcov-tool /usr/bin/gcov -q --no-external -c -i -d . -d . -o
    lcov_base.info
    lcov: ERROR: (usage) duplicate file ./src/backend/access/table/tableam.gcno
    in both . and .
            (use "lcov --ignore-errors usage ..." to bypass this error)
    Message summary:
      1 error message:
        usage: 1
    make: *** [src/Makefile.global:1064: lcov_base.info] Error 1
    ```
    
    
    After applying the first patch, I get this error:
    
    ```
    
    genhtml: ERROR: (corrupt) unable to read trace file 'lcov_base.info':
    genhtml: ERROR: (inconsistent) "lcov_base.info":507880: duplicate function
    'blockreftable_create' starts on line
    "/home/admin/postgres/src/include/lib/simplehash.h":450 but previous
    definition started on 447 while merging lcov_base.info while loading
    lcov_base.info.
            (use "genhtml --ignore-errors inconsistent ..." to bypass this
    error)
            (use "genhtml --ignore-errors corrupt ..." to bypass this error)
    make: *** [src/Makefile.global:1055: coverage-html-stamp] Error 1
    
    ```
    
    
    With the other 2 patches also applied, make check && make coverage-html
    starts producing proper reports.
    I tested `make coverage-html` on Debian 13 with lcov v1 and everything
    worked there as well.
    
    Narek
    --
    
  2. Re: Coverage with make coverage-html is broken on latest Debian using lcov v2

    Álvaro Herrera <alvherre@kurilemu.de> — 2026-06-15T18:22:45Z

    Hi Narek,
    
    On 2026-Apr-21, Narek Galstyan wrote:
    
    > On Debian 13 (trixie), `make coverage-html` command triggers an lcov
    > failure.
    [...]
    > Without applying any of the patches, with --enable-coverage and in-tree
    > build (no vpath), make check && make coverage-html results in the following
    > error:
    > 
    > ```
    > /usr/bin/lcov --gcov-tool /usr/bin/gcov -q --no-external -c -i -d . -d . -o
    > lcov_base.info
    > lcov: ERROR: (usage) duplicate file ./src/backend/access/table/tableam.gcno
    > in both . and .
    
    Handling this part with your 0001 seems reasonable to me.  I think we
    should backpatch that one.
    
    I'm not sure sure about the 0002 patch though.  It builds in the
    assumption that lcov is broken and that we're going to ignore these
    warnings by default [forever].  Do we really want to bake those flags
    into our build system?
    
    -- 
    Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
    "El número de instalaciones de UNIX se ha elevado a 10,
    y se espera que este número aumente" (UPM, 1972)