gcovr fails with GCC 8.0.1 #226
Comments
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:
They explain:
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 ;-) |
That’s awesome, thank you for looking into this. I haven’t had time to set up a testing environment properly, but I’ll test whatever you throw my way. |
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 <notifications@github.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[0].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[2].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>
.
|
See gcovr#226 for background. At this opportunity, the parsing was made a bit more robust. - Any exceptions during parsing are swallowed. Parsing will always succeed, but may be garbage. - After parsing, failed lines and any exceptions are summarized. - These errors are shown always, not just in verbose mode. - The error message links directly to the Github issues.
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. |
I don’t see anything in stderr and the coverage is as pathetic as ever (it works!). ;) |
OK, the changes have now been merged into master. You can use this feature by pip-installing the development version from this repository. A PyPI release is still some time away. Thanks again for bringing this issue to my attention! |
Cool, thanks for you work. :) |
See gcovr#226 for background. At this opportunity, the parsing was made a bit more robust. - Any exceptions during parsing are swallowed. Parsing will always succeed, but may be garbage. - After parsing, failed lines and any exceptions are summarized. - These errors are shown always, not just in verbose mode. - The error message links directly to the Github issues.
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
IndexError
at this line:gcovr/gcovr/gcov.py
Line 232 in 5b0e68f
The distro is current Fedora Rawhide with gcovr installed via pip, as the distro package is outdated now.
Full log: https://gitlab.gnome.org/GNOME/nautilus/-/jobs/8807/raw.
The text was updated successfully, but these errors were encountered: