Lost covered lines, empty tags are gone

Hello,

There are basically two issues I’m facing now:
1 - Some files that has coverage are missed from the report (I can’t say for sure but looks like data is present in gcov file).
2 - We have several flags configured in yml but if there is no coverage for certain flags, they are missed from the report and thus overall code coverage in increased (that is definitely wrong).

Here’s the coverage report where everything was ok (correct report):

Here’s the broken coverage report:

For me it looks like the behavior of coverage parsing engine of Codecov was changed.

Thanks in advance for you help.

— Update —

‘Good’ coverage report was generated on Ubuntu 18.04 (gcov (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0)
‘Bad’ coverage report was generated on Ubuntu 20.04 (gcov (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0)

Ok, the latest update.
On gcov 7.5.0 when source file is not found (and this is true because codecov is always running from the root folder, and src/gcda/gcno could be in subfolder), gcov file is generated with lines that has hit number but no source, and this file is processed correctly by codecov.
On gcov 9.3.0 (I didn’t check versions between 7.5.0 and 9.3.0) when source file is not found, gcov file is generated empty (ok, almost empty, but the main is that it doesn’t contains any lines with hit number).
Looks like this is either a regression of gcov (I briefly took a look at gcov 10.2.0 and looks like it still have the same broken behavior) or a feature.

@AenBleidd any update here? I looked at the raw coverage reports and I noticed that the bad coverage report is missing coverage on files. As an example, on db/db_base.cpp the good coverage has this

# path=^#db#db_base.cpp.gcov.reduced
        -:    0:Source:../db/db_base.cpp
func
func
1:36:
1:37:
1:38:
func
func
...

while the bad coverage has

# path=^#db#db_base.cpp.gcov.reduced
        -:    0:Source:../db/db_base.cpp
<<<<<< EOF

This leads me to believe there is an issue with coverage generation on gcov

@tom, exactly, but not sure it’s an issue, for me it looks like a feature of them and they now require to run gcov from the folder where all three files are present:

  • gcda
  • gcno
  • source file

Ok, this is called ‘read documentation first before reporting bugs’.

Since gcc 8.1.0 release, source file is needed to generate correct coverage report.
New compilation flag -fprofile-abs-path was introduced to preserve correct path to source file in *.gcno file.

Ticket could be closed now (probably as invalid)

1 Like