Skip to content

[error] geninfo: ERROR: mismatched end line for #398

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

Open
paulocoutinhox opened this issue Apr 3, 2025 · 4 comments
Open

[error] geninfo: ERROR: mismatched end line for #398

paulocoutinhox opened this issue Apr 3, 2025 · 4 comments

Comments

@paulocoutinhox
Copy link

Hi,

Im started getting this error geninfo: ERROR: mismatched end line for.

I don't know why, since no code was updated.

Run python3 nativium.py target tests coverage
[INFO] Running "coverage" on target "tests"...
[INFO] Code coverage for: x86_64/debug...
[INFO] Generating coverage data for: x86_64/debug...
Capturing coverage data from /home/runner/work/nativium/nativium/build/tests/debug/x86_64
geninfo cmd: '/usr/bin/geninfo /home/runner/work/nativium/nativium/build/tests/debug/x86_64 --output-filename /home/runner/work/nativium/nativium/build/tests/debug/x86_64/lcov.coverage.info --memory 0'
Found gcov version: [13](https://github.com/nativium/nativium/actions/runs/14247900320/job/39933396293#step:15:14).3.0
Using intermediate gcov format
Writing temporary data to /tmp/geninfo_datJmLv
Scanning /home/runner/work/nativium/nativium/build/tests/debug/x86_64 for .gcda files ...
Found 2 data files in /home/runner/work/nativium/nativium/build/tests/debug/x86_64
Processing /home/runner/work/nativium/nativium/build/tests/debug/x86_64/target/CMakeFiles/tests.dir/modules/app-core/implementation/cpp/nativium/core/ApplicationCoreImpl.cpp.gcda
geninfo: WARNING: /usr/include/c++/13/ext/atomicity.h:52: unexecuted block on non-branch line with non-zero hit count.  Use "geninfo --rc geninfo_unexecuted_blocks=1 to set count to zero.
Processing /home/runner/work/nativium/nativium/build/tests/debug/x86_64/target/CMakeFiles/tests.dir/modules/tests/implementation/cpp/src/app/core.cpp.gcda
geninfo: ERROR: mismatched end line for _ZN26SampleFixture_Version_Test8TestBodyEv at /home/runner/work/nativium/nativium/modules/tests/implementation/cpp/src/app/core.cpp:9: 9 -> 13
	(use "geninfo --ignore-errors mismatch ..." to bypass this error)
COMMAND: lcov -d /home/runner/work/nativium/nativium/build/tests/debug/x86_64 -c -o /home/runner/work/nativium/nativium/build/tests/debug/x86_64/lcov.coverage.info
WORKING DIR: /home/runner/work/nativium/nativium

Ref: https://github.com/nativium/nativium/actions/runs/14247900320/job/39933396293

Can you help me?

Thanks.

@henry2cox
Copy link
Collaborator

henry2cox commented Apr 3, 2025

The error message is telling you that lcov found at least reports for your SampleFixture method, and that at least one of them claimed that that the last line of the function is .../core.cpp:9 and at lest one other report claims line 13.
Both cannot be correct. Should be easy to see which is wrong (or if they are both wrong).

There are two common common causes:

  • build issue: part of your code was built with one source version and part with another. Almost certainly not what you wanted. Most common with shared utilities.
  • compiler bug such that it reports wrong information for one or another compilation unit.

The workaround for the second case is moderately complicated.

Your other option is to add --ignore-error mismatch to your command line to turn this error (fatal) into a warning (nonfatal), or to add --keep-going to your command line so lcov will continue, regardless of fishy data.
If ignored, the tool will assume that the actual end line is the largest number it sees.

The only effects of this particular issue (inconsistent end line) are:

  • the --erase-functions option might take out more data than you expected
  • the genhtml --show-proportion option may miscategorize some coverpoints.

Note that a newer version of lcov than what you are currently using calls this error inconsistent (as opposed to mismatch - mismatch is used only for certain kinds of coverage data inconsistency).

@paulocoutinhox
Copy link
Author

Hi,

Maybe some compiler bug or something like this, because nothing was changed and macOS still working:
https://github.com/nativium/nativium/actions/runs/14248105299/job/39934062419

Run python3 nativium.py target tests coverage
[INFO] Running "coverage" on target "tests"...
[INFO] Code coverage for: x86_64/debug...
[INFO] Generating coverage data for: x86_64/debug...
Capturing coverage data from /Users/runner/work/nativium/nativium/build/tests/debug/x86_64
Found LLVM gcov version 15.0.0, which emulates gcov version 4.2.0
Using intermediate gcov format
Scanning /Users/runner/work/nativium/nativium/build/tests/debug/x86_64 for .gcda files ...
Found 2 data files in /Users/runner/work/nativium/nativium/build/tests/debug/x86_64
Processing x86_64/core.gcda
Processing x86_64/ApplicationCoreImpl.gcda
Finished .info-file creation
[INFO] Remove unuseful coverage data for: x86_64/debug...
Reading tracefile /Users/runner/work/nativium/nativium/build/tests/debug/x86_64/lcov.coverage.info
Removing /Users/runner/.conan2/p/b/gtest0fe755c482d00/p/include/gtest/gtest-assertion-result.h
Removing /Users/runner/.conan2/p/b/gtest0fe755c482d00/p/include/gtest/gtest-printers.h
Removing /Users/runner/.conan2/p/b/gtest0fe755c482d00/p/include/gtest/gtest.h
Removing /Users/runner/.conan2/p/b/gtest0fe755c482d00/p/include/gtest/internal/gtest-internal.h
Removing /Users/runner/.conan2/p/b/gtest0fe755c482d00/p/include/gtest/internal/gtest-port.h
Removing /Users/runner/work/nativium/nativium/modules/tests/implementation/cpp/include/fixtures/SampleFixture.hpp
Removing /Users/runner/work/nativium/nativium/modules/tests/implementation/cpp/src/app/core.cpp
Deleted 7 files
Writing data to /Users/runner/work/nativium/nativium/build/tests/debug/x86_64/lcov.coverage.info
Summary coverage rate:
  lines......: 74.5% (470 of 631 lines)
  functions..: 80.8% (206 of 255 functions)
  branches...: no data found
[INFO] Generating HTML report for: x86_64/debug...
Reading data file /Users/runner/work/nativium/nativium/build/tests/debug/x86_64/lcov.coverage.info
Found 30 entries.
Found common filename prefix "/Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX[14](https://github.com/nativium/nativium/actions/runs/14248105299/job/39934062419#step:15:15).5.sdk/usr/include/c++"
Writing .css and .png files.
Generating output.
Processing file v1/ios
Processing file v1/ostream
Processing file v1/new
Processing file v1/limits
Processing file v1/stdexcept
Processing file v1/__locale
Processing file v1/string
Processing file v1/istream
Processing file v1/streambuf
Processing file v1/locale
Processing file v1/sstream
Processing file v1/__algorithm/comp.h
Processing file v1/__algorithm/max.h
Processing file v1/__ios/fpos.h
Processing file v1/__iterator/ostreambuf_iterator.h
Processing file v1/__iterator/distance.h
Processing file v1/__memory/unique_ptr.h
Processing file v1/__memory/allocator_traits.h
Processing file v1/__memory/allocation_guard.h
Processing file v1/__memory/shared_ptr.h
Processing file v1/__memory/compressed_pair.h
Processing file v1/__memory/pointer_traits.h
Processing file v1/__memory/allocator.h
Processing file v1/__memory/allocate_at_least.h
Processing file v1/__string/constexpr_c_functions.h
Processing file v1/__string/char_traits.h
Processing file v1/__utility/swap.h
Processing file /Users/runner/work/nativium/nativium/modules/app-core/gluecode/generated-src/cpp/nativium/core/ApplicationCore.hpp
Processing file /Users/runner/work/nativium/nativium/modules/app-core/implementation/cpp/nativium/core/ApplicationCoreImpl.hpp
Processing file /Users/runner/work/nativium/nativium/modules/app-core/implementation/cpp/nativium/core/ApplicationCoreImpl.cpp
Writing directory view page.
Overall coverage rate:
  lines......: 74.5% (470 of 631 lines)
  functions..: 80.8% ([20](https://github.com/nativium/nativium/actions/runs/14248105299/job/39934062419#step:15:21)6 of 255 functions)
[INFO] Code coverage report: /Users/runner/work/nativium/nativium/build/tests/debug/x86_64/coverage-html/index.html
[OK]

@henry2cox
Copy link
Collaborator

You could try a newer llvm version - some issues may or may not have been fixed - or you could try the profdata path (as oppsed to the llvm-cov path). Both contain bugs, though :-( (We all have bugs.)
It is a moderately interesting experiment to generate coverage data for the same sources using llvm /w llvm-cov, or with llvm-profdata, and with gcc - and to look at the various differential reports.

@henry2cox
Copy link
Collaborator

Incidentally: that last line:
functions..: 80.8% ([20](https://github.com/nativium/nativium/actions/runs/14248105299/job/39934062419#step:15:21)6 of 255 functions)
looks a bit strange. lcov should have generated a plain text log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants