Coverage with make coverage-html is broken on latest Debian using lcov v2 - Mailing list pgsql-hackers

From Narek Galstyan
Subject Coverage with make coverage-html is broken on latest Debian using lcov v2
Date
Msg-id CAHsn6_xCDQWe8_vVFhtFk27_xTdyVV+Dr0yWzaooBZ6+-VH-5w@mail.gmail.com
Whole thread
List pgsql-hackers
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.

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 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
--




Attachment

pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Non-robust plpgsql_trap test
Next
From: Melanie Plageman
Date:
Subject: Re: Two issues leading to discrepancies in FSM data on the standby server