Re: Having problems generating a code coverage report - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Having problems generating a code coverage report
Date
Msg-id 1035642.1777589139@sss.pgh.pa.us
Whole thread
In response to Re: Having problems generating a code coverage report  (Álvaro Herrera <alvherre@kurilemu.de>)
Responses Re: Having problems generating a code coverage report
List pgsql-hackers
=?utf-8?Q?=C3=81lvaro?= Herrera <alvherre@kurilemu.de> writes:
> On 2026-Feb-18, Michael Paquier wrote:
>> Based on your ideas, I have been able to get my way through today with
>> this modified artistic flavor, for a non-VPATH build, in a Fedora
>> environment:
>> make coverage-html \
>> LCOVFLAGS="-q --ignore-errors gcov,gcov" \
>> GENHTML_FLAGS="-q --legend --ignore-errors unmapped,corrupt,unmapped,inconsistent"

> FWIW this has been failing all along (last report dates back Feb 17th),
> now because of this:
> lcov: ERROR: (negative) Unexpected negative hit count '-9' for line
/home/coverage/pgsrc/pgsql/src/port/snprintf.c:529"while capturing from ./src/port/snprintf_shlib.gcda. 
>         (use "lcov --ignore-errors negative ..." to bypass this error)
> I added this flag as well, and the report is now running; we should have
> results soon.

Another data point: I got around to updating my dev machine to RHEL
10.1 (with lcov version 2.0-1), and unsurprisingly coverage-html
stopped working for me too.  But here, it seems sufficient to use

    LCOVFLAGS="-q --ignore-errors gcov,gcov"
    GENHTML_FLAGS="-q --legend --ignore-errors unmapped,unmapped"

That still leaves me with a "no functions found" warning for each file
that compiles to empty with my build options.  I saw those on my old
installation too, but for some reason it seems like there are more
now.  I didn't find a way to suppress those, so that what my script
actually does now is

make -j16 -s coverage-html \
    LCOVFLAGS="-q --ignore-errors gcov,gcov" \
    GENHTML_FLAGS="-q --legend --ignore-errors unmapped,unmapped" \
    2>&1 | grep -v -e 'gcno:no functions found$' -e '^stderr:$' \
    -e 'WARNING: Duplicate specification "base-directory' \
    -e 'WARNING: Duplicate specification "build-directory'

Silence is golden ;-)

            regards, tom lane



pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Startup process deadlock: WaitForProcSignalBarriers vs aux process
Next
From: Chao Li
Date:
Subject: Re: Fix race condition in XLogLogicalInfo and ProcSignal initialization.