Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
gcovr fails with GCC 8.0.1 #226
This is actually a different trace than I got the first time, but trying to generate a coverage report in a CI pipeline results in this:
The one I saw before was an
The distro is current Fedora Rawhide with gcovr installed via pip, as the distro package is outdated now.
Thank you for this report. Gcovr depends on GCOV to pre-process the coverage reports. We then parse the human-readable .gcov files. Our tests currently only use GCC 5, but other versions are known to work as well. Your report suggests that GCC 8 may change the GCOV report format.
In order to debug this problem, could you run gcovr in verbose mode (
Until I can address the root cause, it might be possible to make gcovr more robust. If parsing one file fails, it will be excluded and gcovr continues with the next file. After generating the reports, gcovr would exit with an error. Would such a fail-later behaviour be helpful for you?
In the meanwhile, please consider only collecting coverage with an earlier compiler, e.g. GCC 7.x.
I was hoping I wouldn’t have to do this, because I have 7.3.1 installed on my machine, but I’ll report back if I can reproduce the issue locally.
Really, I’d be happy with anything, including a
That’s not a problem, just that I switched from F27 to Rawhide for a dependency that hasn’t hit stable yet.
Ok, the development version of the GCOV documentation shows major changes to the .gcov file format. These changes are good, but break our current parser in many ways.
Here is an excerpt of such a .gcov file from their docs:
That is really cool, but complicates parsing. This weekend I want to clean up the gcov parsing code. As part of that, I'll try to add a few GCC 8-related improvements:
However, I don't have a way to test this myself. I'll update this issue if I have something that I believe might work ;-)
This one causes this error:
And this one seems to be causing this error:
Hope these files help.
Thank you, this data is very helpful. I'll try to synthesize a test case from these files (can't use them directly due to GPL). I think I understand how these files cause those exceptions, so I should be able to fix the problem. 2018-02-24 13:54 GMT+01:00 Ernestas Kulik <email@example.com>:…
This one <https://github.com/gcovr/gcovr/files/1754368/libnautilus-extension.nautilus-column.c.gcov.txt> causes this error: Traceback (most recent call last): File "/home/ernestas/.local/bin/gcovr", line 2412, in <module> process_datafile(file_, covdata, options) File "/home/ernestas/.local/bin/gcovr", line 884, in process_datafile process_gcov_data(fname, covdata, abs_filename, options) File "/home/ernestas/.local/bin/gcovr", line 616, in process_gcov_data covered[lineno] = int(segments.strip()) ValueError: invalid literal for int() with base 10: '2*' And this one <https://github.com/gcovr/gcovr/files/1754370/src.nautilus-freedesktop-dbus.c.gcov.txt> seems to be causing this error: Traceback (most recent call last): File "/home/ernestas/.local/bin/gcovr", line 2412, in <module> process_datafile(file_, covdata, options) File "/home/ernestas/.local/bin/gcovr", line 884, in process_datafile process_gcov_data(fname, covdata, abs_filename, options) File "/home/ernestas/.local/bin/gcovr", line 601, in process_gcov_data code = segments.strip() IndexError: list index out of range Hope these files help. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#226 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABs0j1FByyUEOfq91dLchAIk0IFdCY61ks5tYAaRgaJpZM4SPZ7t> .
added a commit
Feb 24, 2018
I've implemented something that should mostly work. Please install from my branch to test this:
Gcovr should now always carry on even when there are parse errors, and will report problems on STDERR. Please let me know if there are remaining issues.