-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gcc 8 creates gcno files that are unreadable by lcov #38
Comments
Thanks for reporting. The issue actually appears to occur for any kind of source code compiled with GCC 8. I've added commit a5dd952 to address the changes introduced with GCC 8. Could you verify if this fixes the problem you are seeing? |
I confirm that works for the simple demo program I was given by the original bug reporter. So that's good enough for me until someone complains about something else :-) |
As being developer of GCOV in GCC, I would recommend to use intermediate format (-i) of gcov tool instead of reading of *.gc{da,no} files. Thanks for understanding. |
@marxin: GCOV's intermediate format looks promising. Can it be used to generate zero coverage data for .gcno files where no .gcda file is present? This is relevant for example for projects which consist of multiple executables, to get a total coverage view independent of the number of executables actually run during a test. Some additional thoughts/observations:
|
Thanks for the ideas, I've just created: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84846 which I will implement in next GCC release (9.1).
Can you please provide an example of a source file that causes that? |
Excellent! Looking forward to those gcov improvements.
Edit: this is on s390x (big-endian) if that makes a difference. |
Thanks again, useful feedback. I've just created: |
This is great. Thanks! Will there be a new version released with this fix? |
It makes sense to release a new version of LCOV including this and other fixes. I'll have to see when I get the time to create it. |
The GCC 8.1 has been released. A new version of LCOV would be great. |
Things worked for compilation as they stood. When running an lcov command lots of warning messages like the following were generated: geninfo: WARNING: cannot find an entry for #usr#local#include#c++#8.1.0#ext#alloc_traits.h.gcov in .gcno file, skipping file! geninfo: WARNING: cannot find an entry for #usr#local#include#c++#8.1.0#ext#atomicity.h.gcov in .gcno file, skipping file! geninfo: WARNING: cannot find an entry for #usr#local#include#c++#8.1.0#ext#new_allocator.h.gcov in .gcno file, skipping file! The solution was not to change user setup as suggested in previous commit. It seems that lcov has great difficulty in handling gcc version 8 output. The gcc base image I use moved to v8 as the latest a few days ago. Fix out gcc base image as gcc:7 until the lcov bug is updated and a packaged released with the fix into Debian. lcov bug: linux-test-project/lcov#38 Which depends on https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84846
@oberpar, you've saved my day, thanks! |
@oberpar This works now:
|
Implemented in current trunk:
Likewise.
This should be done at consumer's side. Now we provide version which tools should follow and adjust parsing in a corresponding way. Thus all feature requests mentioned in this issue are done at GCC's side. |
@marxin: Excellent, thank you! This should provide a path for LCOV to no longer require parsing of binary .gcno files in the future. Intermediate file support is now at the top of my list for lcov enhancements to work on, though at this time I cannot yet provide a time frame for when it will be done. |
Don't hurry, you have the whole year before GCC 9.1 will be released ;) If you see any feature requests that will be handy, don't hesitate and create a PR: |
@oberpar Is this the right issue to follow for progress on lcov supporting gcov intermediate file format? |
@iirina No, I don't think so. This issue is closed and it was about a different problem that only touched on the subject of intermediate files as a side note. That said, there has not been any progress on intermediate file support in lcov so far on my side. Code contributions in that direction are of course always welcome. |
Gcc version 8.0.2 produces coverage reports that are not readable by lcov(linux-test-project/lcov#38) As a result we are required to downgrade the gcc-toolchain Download older gcc version from http://repo.msys2.org/mingw/x86_64/ Disable optimizations flags for better coverage reports
Gcc version 8.0.2 produces coverage reports that are not readable by lcov(linux-test-project/lcov#38) As a result we are required to downgrade the gcc-toolchain Download older gcc version from http://repo.msys2.org/mingw/x86_64/ Disable optimizations flags for better coverage reports
Gcc version 8.0.2 produces coverage reports that are not readable by lcov(linux-test-project/lcov#38) As a result we are required to downgrade the gcc-toolchain Download older gcc version from http://repo.msys2.org/mingw/x86_64/ Disable optimizations flags for better coverage reports
Gcc version 8.0.2 produces coverage reports that are not readable by lcov(linux-test-project/lcov#38) As a result we are required to downgrade the gcc-toolchain Download older gcc version from http://repo.msys2.org/mingw/x86_64/ Disable optimizations flags for better coverage reports
Gcc version 8.0.2 produces coverage reports that are not readable by lcov(linux-test-project/lcov#38) As a result we are required to downgrade the gcc-toolchain Download older gcc version from http://repo.msys2.org/mingw/x86_64/ Disable optimizations flags for better coverage reports
Gcc version 8.0.2 produces coverage reports that are not readable by lcov(linux-test-project/lcov#38) As a result we are required to downgrade the gcc-toolchain Download older gcc version from http://repo.msys2.org/mingw/x86_64/ Disable optimizations flags for better coverage reports
Gcc version 8.0.2 produces coverage reports that are not readable by lcov(linux-test-project/lcov#38) As a result we are required to downgrade the gcc-toolchain Download older gcc version from http://repo.msys2.org/mingw/x86_64/ Disable optimizations flags for better coverage reports
@oberpar How does it look regarding a release? 1.13 is over 2 years old now and newer distros are defaulting to gcc 8 (although I think for example ubuntu has manually included this patch on top of 1.13). |
With @Zitrax. |
I'm planning for a release in February (2019). Ideally this will include the intermediate file format support that I've started working on. |
I would like to mention that as written in #43, GCOV intermediate format will change in GCC 9.1 into a JSON-based format. I would consider implementing the new one and use current output for older versions of GCC. |
Yes, I am aware of that. I checked all intermediate file format implementations in gcov starting from GCC 5 to 9 and found that even pre-9, the fact that gcov can be run in any directory when using the intermediate format can be leveraged to implement parallel lcov processing even with older versions of GCC. I'm currently planning to start with support for the old format, and add the GCC 9 format after that. |
Great, maybe you would be interested in newly created wrapper that can help you: |
This fixes bug: linux-test-project/lcov#38
Gcc version 8.0.2 produces coverage reports that are not readable by lcov(linux-test-project/lcov#38) As a result we are required to downgrade the gcc-toolchain Download older gcc version from http://repo.msys2.org/mingw/x86_64/ Disable optimizations flags for better coverage reports
Gcc version 8.0.2 produces coverage reports that are not readable by lcov(linux-test-project/lcov#38) As a result we are required to downgrade the gcc-toolchain Download older gcc version from http://repo.msys2.org/mingw/x86_64/ Disable optimizations flags for better coverage reports
If a *.c file only contains some global constant the gcno file produced by the --coverage option is not readable by lcov
eg using gcc-8.0.1-0.16.fc29.x86_64 (forthcoming GCC 8 release currently in Fedora 29 rawhide)
[build@localhost tmp]$ cat t.c
const int a = 5;
[build@localhost tmp]$ gcc -Wall -Wextra -Werror -c ./t.c --coverage
[build@localhost tmp]$ lcov --capture --initial --directory .
Capturing coverage data from .
Found gcov version: 8.0.1
Scanning . for .gcno files ...
Found 2 graph files in .
Processing t.gcno
geninfo: ERROR: /tmp/t.gcno: reached unexpected end of file
The same works as expected with gcc-7.3.1-2.fc27.x86_64 on Fedora 27:
[sbose@p50 y]$ cat t.c
const int a = 5;
[sbose@p50 y]$ gcc -Wall -Wextra -Werror --coverage -c t.c
[sbose@p50 y]$ lcov --capture --initial --directory .
Capturing coverage data from .
Found gcov version: 7.3.1
Scanning . for .gcno files ...
Found 1 graph files in .
Processing t.gcno
TN:
Finished .info-file creation
Originally reported at https://bugzilla.redhat.com/show_bug.cgi?id=1552042
The text was updated successfully, but these errors were encountered: