Re: Bogus reports from coverage.postgresql.org

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL WWW <pgsql-www(at)lists(dot)postgresql(dot)org>
Subject: Re: Bogus reports from coverage.postgresql.org
Date: 2018-03-15 16:00:32
Message-ID: 17442.1521129632@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-www

I wrote:
> ... I have a question in
> to the lcov mailing list at sourceforge to see if anyone wants to offer
> a more informed opinion, though.

And the authoritative answer is: the bug is in gcc/gcov. The
branch_coverage switch implies passing "-a" to gcov, and if you do
that (with "make coverage GCOVFLAGS=-a" in our infrastructure),
you get output like this (tested with gcc 7.3.1):

-: 485: clause,
-: 486: weak);
-: 487: }
#####: 488: break;
$$$$$: 488-block 0
-: 489: }
-: 490:
-: 491: /* can't get here */
5134: 492: elog(ERROR, "predicate_classify returned a bogus value");
$$$$$: 492-block 0
call 0 never executed
call 1 never executed
call 2 never executed
5134: 492-block 1
-: 493: return false;
-: 494:}

which is clearly claiming that the second basic block in line 492 gets
executed.

With gcc 8.0.1 I instead get:

-: 485: clause,
-: 486: weak);
-: 487: }
#####: 488: break;
%%%%%: 488-block 0
-: 489: }
-: 490:
-: 491: /* can't get here */
#####: 492: elog(ERROR, "predicate_classify returned a bogus value");
%%%%%: 492-block 0
call 0 never executed
call 1 never executed
call 2 never executed
-: 493: return false;
-: 494:}

The fact that they changed the gcov data format at the same time hints
that it may be unfixable without such a change, though I've not tried to
excavate in their changelog for more info. It could also just be a code
generation change, seeing that 8.0.1 is not claiming there are 2 basic
blocks anymore. (Hm, I wonder whether our "pg_unreachable" stuff confuses
the earlier releases.)

regards, tom lane

In response to

Browse pgsql-www by date

  From Date Subject
Next Message Alexander Korotkov 2018-03-15 22:26:17 Re: [HACKERS] GSoC 2017: weekly progress reports (week 6)
Previous Message Peter Eisentraut 2018-03-14 20:55:19 Re: Bogus reports from coverage.postgresql.org