Bug 829514 - lcov does not work with new "=====" gcov output
lcov does not work with new "=====" gcov output
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: lcov (Show other bugs)
17
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Daniel Berrange
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-06 20:09 EDT by Ben Webb
Modified: 2013-06-04 17:10 EDT (History)
3 users (show)

See Also:
Fixed In Version: lcov-1.10-1.fc18
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-04 17:08:18 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
lcov-except-unreach.patch (391 bytes, patch)
2012-06-06 20:09 EDT, Ben Webb
no flags Details | Diff

  None (edit)
Description Ben Webb 2012-06-06 20:09:20 EDT
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 10:28:23 EDT
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 Berrange 2013-03-19 10:28:55 EDT
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 10:37:57 EDT
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 17:39:45 EDT
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 17:08:18 EDT
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 17:10:53 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.