Coverage (lcov) failing with inconsistent error in versions 2.x

Jonathan Gonzalez V. <jonathan.abdiel@gmail.com>

From: "Jonathan Gonzalez V." <jonathan.abdiel@gmail.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2026-07-01T12:12:35Z
Lists: pgsql-hackers

Attachments

Hi all

While working on another patch I was suggested to check the coverage of
the tests, but I hit some errors while trying to build the coverage.

The first error and that it's fixed here are:

lcov: ERROR: (inconsistent) "/home/zeus/src/postgresql/src/interfaces/libpq/fe-auth-oauth.c":869: duplicate function 'use_builtin_flow' starts on line "/home/zeus/src/postgresql/src/interfaces/libpq/fe-auth-oauth.c":869 but previous definition started on 991 while capturing from /home/zeus/src/postgresql/build/src/interfaces/libpq/libpq.so.5.19.p/fe-auth-oauth.c.gcno.
	(use "lcov --ignore-errors inconsistent ..." to bypass this error)

lcov: ERROR: (inconsistent) "/home/zeus/src/postgresql/worktrees/lcov/src/include/lib/simplehash.h":450: duplicate function 'blockreftable_create' starts on line "/home/zeus/src/postgresql/worktrees/lcov/src/include/lib/simplehash.h":450 but previous definition started on 447 while capturing from /home/zeus/src/postgresql/worktrees/lcov/build/src/common/libpgcommon_srv.a.p/blkreftable.c.gcno.
	(use "lcov --ignore-errors inconsistent ..." to bypass this error)

These error are due to duplicated declaration of SH_CREATE() and
use_builtin_flow(), and will only appear in version of lcov >= 2.0
which is the version, but with version 1.16 this doesn't happens.

These failure has already been discussed here[0], but this is a
patch on the code rather than add an exception. That thread still having
some valid points related to another failure that should be discussed
there.


[0] https://www.postgresql.org/message-id/flat/CAHsn6_xCDQWe8_vVFhtFk27_xTdyVV%2BDr0yWzaooBZ6%2B-VH-5w%40mail.gmail.com

--
Jonathan Gonzalez V.
EDB
https://www.enterprisedb.com