Bug 829514

Summary: lcov does not work with new "=====" gcov output
Product: [Fedora] Fedora Reporter: Ben Webb <benmwebb>
Component: lcovAssignee: Daniel Berrangé <berrange>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 17CC: berrange, roland, wcohen
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lcov-1.10-1.fc18 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-04 21:08:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
lcov-except-unreach.patch none

Description Ben Webb 2012-06-07 00:09:20 UTC
Created attachment 590034 [details]
lcov-except-unreach.patch

Description of problem:
The format of gcov output files changed slightly in gcc 4.7, and lcov does not understand the new format. Unreachable code that can only be accessed via an exceptional path is now marked as ===== in the gcov output file (aside: the gcov manpage says ====, i.e. one '=' is missed) but lcov only understands ##### for unreachable code (which is now only used for non-exceptional paths). If given a gcov file containing the new syntax, lcov will generate an invalid .info file.

Version-Release number of selected component (if applicable):
lcov-1.9-2.fc17.noarch
gcc-4.7.0-5.fc17.x86_64

How reproducible:
Always.

Steps to Reproduce:
1. Compile the following simple C++ file:

#include <iostream>

int main()
{
  try {
    std::cout << "hello world" << std::endl;
  } catch (const std::exception &e) {
    std::cout << "caught exception" << std::endl;
  }
  return 0;
}

with
g++ -Wall -fprofile-arcs -ftest-coverage test.cpp 


2. Run with ./a.out
3. Process with lcov:
lcov -c -b . -d . -o test.info
  
Actual results:
Perl complains with:
geninfo: Argument "=====" isn't numeric in numeric gt (>) at /usr/bin/geninfo line 1126.

and the ===== lines get passed through to the .info file, which results in invalid lines:
DA:7,=====
DA:8,=====

Expected results:
No Perl errors; correctly formatted .info file.

Additional info:
It is straightforward to fix geninfo to work with the new format; see attached patch "lcov-except-unreach.patch".

Comment 1 Fedora Update System 2013-03-19 14:28:23 UTC
lcov-1.10-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/lcov-1.10-1.fc18

Comment 2 Daniel Berrangé 2013-03-19 14:28:55 UTC
It turns out upstream have fixed this too, so I pulled in their patch, which achieves the same as yours.

Comment 3 Fedora Update System 2013-03-19 14:37:57 UTC
lcov-1.10-1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/lcov-1.10-1.fc17

Comment 4 Fedora Update System 2013-03-20 21:39:45 UTC
Package lcov-1.10-1.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing lcov-1.10-1.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-4076/lcov-1.10-1.fc18
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2013-06-04 21:08:18 UTC
lcov-1.10-1.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 6 Fedora Update System 2013-06-04 21:10:53 UTC
lcov-1.10-1.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.