Re: Coverage with make coverage-html is broken on latest Debian using lcov v2

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Álvaro Herrera <alvherre(at)kurilemu(dot)de>, Narek Galstyan <narek(dot)galstyan(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org, "narekg(at)berkeley(dot)edu" <narekg(at)berkeley(dot)edu>, ngalstyan4(at)gmail(dot)com
Subject: Re: Coverage with make coverage-html is broken on latest Debian using lcov v2
Date: 2026-10-04 18:16:24
Message-ID: dwpelwvlrf4caxrjrl4imdr5eg65b6llfavojnb2ew627x3dqh@kzje3nnvtj4g
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2026-10-03 19:07:02 -0400, Andres Freund wrote:
> On October 3, 2026 5:03:27 PM EDT, Andres Freund <andres(at)anarazel(dot)de> wrote:
> >I think there are definitely some bugs in lcov around multi-line statements
> >that contain branches. That's where it seems to very often get confused and
> >claims the data is inconsistent, but afaict it's due to it misunderstanding
> >the data that gcov spits out. I'll try to make a bug report out of that.
>
> Oh, huh. At least one of the two bugs is actually a behavioral difference between gcc versions, not lcov versions. The gcov data starting with gcc 15 reports
>
> var =
> cond ? a : b;
>
> i.e. a variable assignment with a conditional in a new line, different than before. And the new output actually triggers errors in lcov back to at least lcov 2.0. It's actually an error in geninfo.
>
> I found another small repro for multi line conditionals where some branches are never reached triggering errors in lcov itself, and that one is not gcc version dependent...
>
> Will report bugs later today or tomorrow, food is more important now.

Bug triggering at least with lcov >= 2.0:
https://github.com/linux-test-project/lcov/issues/554

At first I though this was only reachable with gcc 15, but with some LLM help
I found a version that triggered down to gcc 12.

Bug triggering with lcov >= 2.2:
https://github.com/linux-test-project/lcov/issues/555

this seems independent of the gcc version.

It's kinda interesting that both only trigger for multi-line statements.
Which may be related to why we're seeing them more - we use more multi-line
statements than we used to.

Greetings,

Andres Freund

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message shihao zhong 2026-10-04 18:49:39 Re: Report relation extension blockers within parallel lock groups
Previous Message Alexander Korotkov 2026-10-04 17:36:34 Re: Asynchronous MergeAppend