-
Notifications
You must be signed in to change notification settings - Fork 240
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
Possible root causes of geninfo 'mismatched end line for main at start.c' ? #316
Comments
Yes - this looks like a gcc/gcov bug. (You did not mention which version of gcc you are using.) The specific thing which appears to be happening is that some gcov-generated data file claims that 'main' ends on line 742, whereas some other data file claims that it ends on line 885. In v2.0 - and in current TOT - if you ignore the error, then the first encounter wins. In the current implementation: function end lines matter only of you happen to be trying to exclude functions by name. |
Thanks for the the help, the given explanation, and the quick reply.
I am using gcc 14.2.1.
So since I am not trying to exclude functions by name, I am now assuming I can safely ignore this (for this particular instance.) I feel I should at least try to not use '--ignore-errors mismatch' immediately and try out '--keep-going' to see if anything else pops up. Thanks again. |
I should probably have also said that inconsistent end-line reporting matters only if the particular function(s) you are trying to exclude happen to belong to the mismatch set or are found within the extents of some function in the mismatched set. (The above statement is true today - but may not be true at some point in the future, if somebody thinks of something else to do with end-line information.) Edited/correction:
All of these features are disabled for those functions whose end line is unknown - and all of these features may go off the rails if the compiler-reported or tool-computed end lines are wrong. |
Just to be thorough, I tried out older gcc/gcov versions than 14.2.1 to see if that changed anything, but I got the exact same result with lcov-2.0 on gcc 13.3.1 (Fedora 39) and gcc 12.3.1 (Fedora 37). Unfortunately, I couldn't try out older gcc versions (gcc 11.3.1, Fedora 35), as the codebase I am experiencing this with requires at least gcc 12 to build. So if this is indeed a gcc/gcov bug, then it seems to have been there for a few major releases now. (Not sure if this helps or not). |
Thanks for the update...yeah, I think that the bug has existed for quite some time. For cases that you care deeply about that are wrongly reported, some kind of ugly workarounds are possible. |
Conveniently, GitHub will hyperlink this to related issue #116, from long back. |
Thanks. Currently I am not looking to exclude any code by function name, and do not use any of the three options (omit-functions|show-proportion|filter trivial) you mentioned. I do use the "--remove" option to remove entire directory's from the resulting tracefile (containing third-party code) though, but that seems safe the way I understand things now. As far as modifying/fixing the incorrect results go: I guess if it was really required by the developers of the codebase (it isn't currently) - and I felt really energetic - I could add some lines to the shell script I wrote to automate the procedure for them to modify the results using sed, but I very much doubt I could get the developers to start putting gcov specific comments in the codebase. Anyway, currently not a requirement. For now then I will just add '--ignore-errors mismatch', and see where that gets me. Well I guess that's it for this issue for the moment; feel free to close it or leave it open as you see fit. Thanks for all the assistance, it's really appreciated. |
…ponding error is ignored. See #316. Signed-off-by: Henry Cox <henry.cox@mediatek.com>
Closing this one now, as the update described above has been pushed. Feel free to reopen if there is still an issue. |
Hi,
While running lcov (capturing initial zero coverage data) I have run into the following error :
I get that I can suppress this error and continue, but I was wondering what a possible root causes for this error might be ? Could there be a bug in lcov or gcov, a problem with the codebase that needs to get fixed, or perhaps I am simply doing something wrong here ?
I am running lcov 2.0 on Fedora 40.
Please note I am not a developer (I am just trying to show the developers of the codebase how much of their code gets covered by their test suite). Also, I have successfully run lcov in the past on the same codebase, but that was with both an older version of lcov and an older version of the codebase.
I've included the source file that triggered the error: start.tar.gz
Any and all help is appreciated, and please let me know if I need to supply more information or details.
The text was updated successfully, but these errors were encountered: