-
Notifications
You must be signed in to change notification settings - Fork 241
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
lcov fails with gcc 14 #296
Comments
I fear that I'm not entirely sure which fixes/workarounds you are looking for.
|
Closing this issue now. If you think that there is still an lcov bug here, please feel free to reopen this issue or file a new one. |
Thanks @henry2cox for all of the info on this thread. Is there already a bug report upstream in gcc for this that can be tracked? If not I'd be happy to open one, although my understanding of how to identify and properly communicate the root cause is limited |
I don't know of any related bugs filed against either GCC or LLVM (both have bugs...we all have bugs). WRT how to identify: the gcov output is what lcov is reading - and the error will be obvious there (run lcov to have it tell you where the error is, then highlight that in your gcc/llvm report). It isn't clear if the issues are in gcc (llvm) generating the data (very likely) or gcov (llvm-cov) extracting it. Yet another workaround that I forgot to mention, is to exclude either the files which contain fishy data (see the |
When you refer to the gcc/llvm report are you asking about the geninfo: ERROR: mismatched end line for _ZN32HppBuffer_BufferInitWrapped_Test8TestBodyEv at /home/willayd/clones/arrow-nanoarrow/src/nanoarrow/hpp/buffer_test.cc:41: 41 -> 56 I can trace that function back to a line in the FN:41,41,_ZN32HppBuffer_BufferInitWrapped_Test8TestBodyEv Back in Ubuntu 22.04 it appears as if this was the line being generated: FN:41,_ZN32HppBuffer_BufferInitWrapped_Test8TestBodyEv Does the added FWIW I'm running this all through the ninja / meson wrapper. The inner workings of how those dispatch to lcov and how that relates to gcov / gcc are a bit foreign to me, though I can see from the meson logs it executes this command on failure:
|
Sorry to have been incomplete/confusing. In your case, at least one file containing data for that function was
From that gcov data: we can find two records for The
I hope this helps. Henry |
Thanks for the steps. I am inspecting the gcov output but I don't think I am seeing exactly what you described. There is only one entry with that function name that looks like this: {
"name": "_ZN32HppBuffer_BufferInitWrapped_Test8TestBodyEv",
"demangled_name": "HppBuffer_BufferInitWrapped_Test::TestBody()",
"start_line": 41,
"start_column": 1,
"end_line": 56,
"end_column": 1,
"blocks": 99,
"blocks_executed": 22,
"execution_count": 1
}, In the {
"line_number": 41,
"function_name": "_ZN32HppBuffer_BufferInitWrapped_Test8TestBodyEv",
"count": 1,
"unexecuted_block": false,
"branches": []
},
{
"line_number": 42,
"function_name": "_ZN32HppBuffer_BufferInitWrapped_Test8TestBodyEv",
"count": 1,
"unexecuted_block": false,
"branches": []
},
{
"line_number": 43,
"function_name": "_ZN32HppBuffer_BufferInitWrapped_Test8TestBodyEv",
"count": 1,
"unexecuted_block": false,
"branches": []
},
{
"line_number": 46,
"function_name": "_ZN32HppBuffer_BufferInitWrapped_Test8TestBodyEv",
"count": 1,
"unexecuted_block": false,
"branches": []
},
{
"line_number": 47,
"function_name": "_ZN32HppBuffer_BufferInitWrapped_Test8TestBodyEv",
"count": 1,
"unexecuted_block": true,
"branches": []
},
{
"line_number": 48,
"function_name": "_ZN32HppBuffer_BufferInitWrapped_Test8TestBodyEv",
"count": 1,
"unexecuted_block": true,
"branches": []
},
{
"line_number": 50,
"function_name": "_ZN32HppBuffer_BufferInitWrapped_Test8TestBodyEv",
"count": 1,
"unexecuted_block": true,
"branches": []
},
{
"line_number": 55,
"function_name": "_ZN32HppBuffer_BufferInitWrapped_Test8TestBodyEv",
"count": 1,
"unexecuted_block": true,
"branches": []
},
{
"line_number": 56,
"function_name": "_ZN32HppBuffer_BufferInitWrapped_Test8TestBodyEv",
"count": 1,
"unexecuted_block": false,
"branches": []
}, |
Just a few other assorted things I've noticed so far.
FWIW the version of lcov I get with ubuntu 24.04 is 2.0-1. I see from another issue that the PR implementing that keyword is 10c6ea0 and is tagged 2.3. I don't get a failure message using that argument, but it also doesn't seem to have any effect, so maybe its a version thing? If I try to exclude the offending file altogether I can work around the immediate issue, but there are more files affected in the code base (FWIW they all use googletest, so might be something specifically with that library). However, after excluding all of the files I still get the following error from lcov: geninfo: WARNING: /usr/include/c++/13/bits/hashtable.h:592: unexecuted block on non-branch line with non-zero hit count. Use "geninfo --rc geninfo_unexecuted_blocks=1 to set count to zero.
geninfo: ERROR: "/usr/include/c++/13/bits/vector.tcc":469: mismatched exception tag for id 1, 1: '0' -> '1'
(use "geninfo --ignore-errors mismatch ..." to bypass this error) The larger traceback is provided below, in case that is helpful
The fact that those errors point to the stdlib makes me even more uncertain - is there perhaps an issue with the 2.0-1 version that comes bundled with ubuntu 24.04,? |
Also unsure if this matters to the lcov project at all but it appears that gcovr is able to produce coverage reports against the same code base |
...and one potentially last useful bit of information is that lcov-2.2 doesn't have the issue from the OP but does end up with an error similar to #296 (comment) /usr/bin/meson --internal coverage /data /data/subprojects /data/builddir2 /data/builddir2/meson-logs
genhtml: LCOV version 2.2-1
Capturing coverage data from /data/builddir2
geninfo cmd: '/usr/local/bin/geninfo /data/builddir2 --output-filename /data/builddir2/meson-logs/coverage.info.initial --initial --config-file /data/.lcovrc --exclude nanoarrow/hpp/buffer_test.cc --exclude nanoarrow/integration/c_data_integration_test.cc --exclude nanoarrow/common/schema_test.cc --exclude nanoarrow/common/buffer_test.cc --exclude src/nanoarrow/common/array_stream_test.cc --exclude nanoarrow/hpp/exception_test.cc --exclude nanoarrow/hpp/array_stream_test.cc --exclude nanoarrow/hpp/unique_test.cc --exclude nanoarrow/common/array_test.cc --exclude src/nanoarrow/hpp/view_test.cc --exclude nanoarrow/common/utils_test.cc'
Found gcov version: 13.3.0
Using intermediate gcov format
Recording 'internal' directories:
/data/builddir2
Writing temporary data to /tmp/geninfo_datV99V
Scanning /data/builddir2 for .gcno files ...
Found 49 graph files in /data/builddir2
using: chunkSize: 1, nchunks:49, intervalLength:2
geninfo: WARNING: using JSON module "JSON::PP" - which is much slower than some alternatives. Consider installing one of JSON::XS or Cpanel::JSON::XS
Excluding file '/data/src/nanoarrow/hpp/view_test.cc'
Excluding file '/data/src/nanoarrow/common/utils_test.cc'
Excluding file '/data/src/nanoarrow/common/array_test.cc'
Excluding file '/data/src/nanoarrow/hpp/unique_test.cc'
Excluding file '/data/src/nanoarrow/hpp/array_stream_test.cc'
Excluding file '/data/src/nanoarrow/hpp/exception_test.cc'
Excluding file '/data/src/nanoarrow/common/array_stream_test.cc'
Excluding file '/data/src/nanoarrow/common/buffer_test.cc'
Excluding file '/data/src/nanoarrow/common/schema_test.cc'
Excluding file '/data/src/nanoarrow/integration/c_data_integration_test.cc'
Excluding file '/data/src/nanoarrow/hpp/buffer_test.cc'
Finished processing 49 GCNO files
Excluded data for 11 files due to include/exclude options
Apply filtering..
Finished filter file processing
Finished .info-file creation
Summary coverage rate:
source files: 117
lines.......: 0.0% (0 of 12147 lines)
functions...: 0.0% (0 of 2757 functions)
Filter suppressions:
region:
13 instances
Message summary:
no messages were reported
Capturing coverage data from /data/builddir2
geninfo cmd: '/usr/local/bin/geninfo /data/builddir2 --output-filename /data/builddir2/meson-logs/coverage.info.run --no-checksum --branch-coverage --config-file /data/.lcovrc --rc branch_coverage=1 --exclude nanoarrow/hpp/buffer_test.cc --exclude nanoarrow/integration/c_data_integration_test.cc --exclude nanoarrow/common/schema_test.cc --exclude nanoarrow/common/buffer_test.cc --exclude src/nanoarrow/common/array_stream_test.cc --exclude nanoarrow/hpp/exception_test.cc --exclude nanoarrow/hpp/array_stream_test.cc --exclude nanoarrow/hpp/unique_test.cc --exclude nanoarrow/common/array_test.cc --exclude src/nanoarrow/hpp/view_test.cc --exclude nanoarrow/common/utils_test.cc'
Found gcov version: 13.3.0
Using intermediate gcov format
Recording 'internal' directories:
/data/builddir2
Writing temporary data to /tmp/geninfo_datYPzA
Scanning /data/builddir2 for .gcda files ...
Found 49 data files in /data/builddir2
using: chunkSize: 1, nchunks:49, intervalLength:2
geninfo: WARNING: using JSON module "JSON::PP" - which is much slower than some alternatives. Consider installing one of JSON::XS or Cpanel::JSON::XS
geninfo: WARNING: (inconsistent) /usr/include/c++/13/bits/unique_ptr.h:99: unexecuted block on non-branch line with non-zero hit count. Use "geninfo --rc geninfo_unexecuted_blocks=1 to set count to zero.
(use "geninfo --ignore-errors inconsistent,inconsistent ..." to suppress this warning)
Message summary:
1 error message:
mismatch: 1
2 warning messages:
inconsistent: 2
geninfo: WARNING: (inconsistent) /data/subprojects/googletest-1.14.0/googletest/src/gtest-internal-inl.h:439: unexecuted block on non-branch line with non-zero hit count. Use "geninfo --rc geninfo_unexecuted_blocks=1 to set count to zero.
geninfo: ERROR: (mismatch) "/usr/include/c++/13/bits/stl_vector.h":606: mismatched exception tag for id 1, 1: '0' -> '1' |
I haven't checked the gcovr implementation - but I very, very strongly suspect that the reason it is happy is that it doesn't check for errors and inconsistency in the data. You can get a similar effect by telling lcov to ignore certain errors, or to keep going despite errors. Note that the results you see from gcovr and lcov in that case might not be identical as they might treat the inconsistent data differently (e.g. first one wins, last one wins, drop, ...) From your most recent update: it also seems that there may be some bug fixes and/or enhancements in lcov/2.2 and/or in TOT - so some messages no longer appear. |
gcov produces "geninfo: ERROR: mismatched end line" error msg, that most likely produced by a bug in gcc linux-test-project/lcov#296 Signed-off-by: Mykola Kobets <[email protected]>
gcov produces "geninfo: ERROR: mismatched end line" error msg, that most likely produced by a bug in gcc linux-test-project/lcov#296 Signed-off-by: Mykola Kobets <[email protected]>
gcov produces "geninfo: ERROR: mismatched end line" error msg, that most likely produced by a bug in gcc From: linux-test-project/lcov#296 " There appears to be a bug or bugs in gcc/14(and/or in the corresponding gcov) which causes gcov to generate coverage data which is inconsistent in several ways. " Signed-off-by: Mykola Kobets <[email protected]>
## Changes * Fix geninfo line number mismatch error - We fixed a CI error that's occurring during the code coverage data collection step for the C++ tests. The error is happening with the geninfo tool and indicates a line number mismatch in the C++ hpp file. - This appears to be a bug of gcc 14 as indicated in the issue linux-test-project/lcov#296. Since [GitHub Actions set the ubuntu-latest to ubuntu-24.04](actions/runner-images#10636), the default compiler is replaced with gcc 14. - We fixed the error by adding `--ignore-errors mismatch` to `geninfo`. - The following process using gcov is temporarily skipped. * Modify `setup.cfg` and test command - modify `setup.cfg` by replacing `tests_require` with `extras_require`. - replace `python setup.py test` to `pytest`. ## Related issue - linux-test-project/lcov#296
## Changes * Fix geninfo line number mismatch error - We fixed a CI error that's occurring during the code coverage data collection step for the C++ tests. The error is happening with the geninfo tool and indicates a line number mismatch in the C++ hpp file. - This appears to be a bug of gcc 14 as indicated in the issue linux-test-project/lcov#296. Since [GitHub Actions set the ubuntu-latest to ubuntu-24.04](actions/runner-images#10636), the default compiler is replaced with gcc 14. - We fixed the error by adding `--ignore-errors mismatch` to `geninfo`. - The following process using gcov is temporarily skipped. * Modify `setup.cfg` and test command - modify `setup.cfg` by replacing `tests_require` with `extras_require`. - replace `python setup.py test` to `pytest`. ## Related issue - linux-test-project/lcov#296
I tried to run my coverage reports and got the following errors:
lcov --gcov-tool gcov --base-directory . --directory ./build/ --directory ./ -c -o ./build/test_coverage_report.info
Capturing coverage data from ./build/ ./
geninfo cmd: '/usr/bin/geninfo ./build/ ./ --output-filename ./build/test_coverage_report.info --gcov-tool gcov --base-directory . --memory 0'
geninfo: WARNING: Duplicate specification "base-directory|b=s" for option "b"
Found gcov version: 14.1.1
Using intermediate gcov format
Writing temporary data to /tmp/geninfo_datG4GC
Scanning ./build/ for .gcda files ...
Found 31 data files in ./build/
Processing ./build/file1.gcda
geninfo: WARNING: /file1.c:2811: unexecuted block on non-branch line with non-zero hit count. Use "geninfo --rc geninfo_unexecuted_blocks=1 to set count to zero.
Processing ./build/build-utradgw-std-rsysg-nomemdbg-o2-dynamic-cov/test1.gcda
geninfo: WARNING: /usr/include/c++/14/bits/stl_iterator_base_funcs.h:100: unexecuted block on non-branch line with non-zero hit count. Use "geninfo --rc geninfo_unexecuted_blocks=1 to set count to zero.
(use "geninfo --ignore-errors gcov,gcov ..." to suppress this warning)
geninfo: ERROR: mismatched end line for _ZN17TEST1_SUITE1_Test8TestBodyEv at /home/krud/git_my_checkout/rrs/radgw/test1.cpp:9: 9 -> 19
(use "geninfo --ignore-errors mismatch ..." to bypass this error)
I found some similar report in this mailing archive: https://www.mail-archive.com/[email protected]/msg101150.html
Do I have any chance of a workaround or even better a fix :-)
Thanks!
The text was updated successfully, but these errors were encountered: