Skip to content

lcov -l (or lcov --list) output showing mistaken rate values in LCOV >=2.0? #335

@hartwork

Description

@hartwork

Hi, thanks for making and maintaining LCOV! 🙏

I'm using LCOV in Expat upstream CI and it came to my attention that lcov -l (or lcov --list) broke at some point in the past:

  • LCOV 1.15 (as found in Ubuntu 22.04.5) works fine in current CI
  • LCOV 2.0 shows wrongly small rate values
  • LCOV 2.2 shows 99.9% for all rate values and # for all hit values

I should note that command genhtml of the same release produces more healthy result for all three releases.

PS: The issue started out at mozilla/grcov#1239 but turned out to be about LCOV more than grcov when I saw the same issue with coverage reporting on Expat…

Below are the precise outputs from each version for comparison:

1.15 — healthy

# lcov -q -l coverage__R_2_6_4-14-ga0dc7d5e/coverage.info
                           |Lines       |Functions  |Branches    
Filename                   |Rate     Num|Rate    Num|Rate     Num
=================================================================
lib/siphash.h              |98.8%     80| 100%    16|    -      0
lib/xmlparse.c             |94.8%   4706|97.8%   186|    -      0
lib/xmlrole.c              |99.8%    645| 100%    54|    -      0
lib/xmltok.c               |97.3%    515|97.7%    44|    -      0
lib/xmltok_impl.c          |99.2%   1057| 100%    84|    -      0
lib/xmltok_ns.c            | 100%     34| 100%    14|    -      0
xmlwf/codepage.c           | 0.0%     24| 0.0%     2|    -      0
xmlwf/readfilemap.c        |53.7%     41| 100%     1|    -      0
xmlwf/xmlfile.c            |48.6%    111|75.0%     8|    -      0
xmlwf/xmlwf.c              |37.6%    758|32.7%    49|    -      0
=================================================================
                     Total:|89.4%   7971|90.8%   458|    -      0

2.0 — rate values way off (too small)

# lcov -q -l coverage__R_2_6_4-14-ga0dc7d5e/coverage.info
                           |Lines       |Functions  |Branches    
Filename                   |Rate     Num|Rate    Num|Rate     Num
=================================================================
lib/siphash.h              |20.5%     78| 0.0%    16|    -      0
lib/xmlparse.c             | 3.8%   4433| 0.0%   163|    -      0
lib/xmlrole.c              | 8.2%    644| 0.0%    53|    -      0
lib/xmltok.c               | 8.8%    433| 0.0%    32|    -      0
lib/xmltok_impl.c          | 8.0%   1052| 0.0%    84|    -      0
lib/xmltok_ns.c            |43.8%     32| 0.0%    12|    -      0
xmlwf/codepage.c           |    -      0|    -     0|    -      0
xmlwf/readfilemap.c        | 4.5%     22| 0.0%     1|    -      0
xmlwf/xmlfile.c            |14.6%     48| 0.0%     5|    -      0
xmlwf/xmlwf.c              |17.1%    280| 0.0%    15|    -      0
=================================================================
                     Total:| 6.1%   7022| 0.0%   381|    -      0

2.2 — rate values all 99.9%

# lcov -q -l coverage__R_2_6_4-14-ga0dc7d5e/coverage.info
                           |Lines       |Functions  |Branches    
Filename                   |Rate     Num|Rate    Num|Rate     Num
=================================================================
lib/siphash.h              |99.9%      #|99.9%     #|99.9%      #
lib/xmlparse.c             |99.9%      #|99.9%     #|99.9%      #
lib/xmlrole.c              |99.9%      #|99.9%     #|99.9%      #
lib/xmltok.c               |99.9%      #|99.9%     #|99.9%      #
lib/xmltok_impl.c          |99.9%      #|99.9%     #|99.9%      #
lib/xmltok_ns.c            |99.9%      #|99.9%     #|99.9%      #
xmlwf/codepage.c           |99.9%      #|99.9%     #|99.9%      #
xmlwf/readfilemap.c        |99.9%      #|99.9%     #|99.9%      #
xmlwf/xmlfile.c            |99.9%      #|99.9%     #|99.9%      #
xmlwf/xmlwf.c              |99.9%      #|99.9%     #|99.9%      #
=================================================================
                     Total:|99.9%      #|99.9%     #|99.9%      #
Message summary:
  no messages were reported

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions