Bug 829514 - lcov does not work with new "=====" gcov output
Summary: lcov does not work with new "=====" gcov output
Alias: None
Product: Fedora
Classification: Fedora
Component: lcov
Version: 17
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Daniel Berrangé
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2012-06-07 00:09 UTC by Ben Webb
Modified: 2013-06-04 21:10 UTC (History)
3 users (show)

Fixed In Version: lcov-1.10-1.fc18
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2013-06-04 21:08:18 UTC
Type: Bug

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

Description Ben Webb 2012-06-07 00:09:20 UTC
Created attachment 590034 [details]

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):

How reproducible:

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;

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:

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.

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.

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:
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.

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