-
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
geninfo: Error mismatch #209
Comments
As you figured out: the message is telling you that lcov is confused, because it found some branch data for that particular line which says "this branch is related to an exception" and some other data that says "this branch is not related to an exception". There are only a few (less than optimal) things you can do about it:
Sorry to be less than helpful. Henry |
This might be a stupid question but I can run gcov fine and it can parse everything with no problem... I understand the issue of having a branch marked as both excep and no-except. What I don't get is how can gcov parse it with no errors but lcov can't? |
I think that the stupid questions are the ones that don't get asked - and thus lead to long term misunderstanding and/or a lot of later debugging and rework. I think that the key point that you missed is the lcov is really just calling gcov under the hood.
The error message that lcov is giving you is saying that it parsed the gcov output data - and found that the data was inconsistent. (LLVM supports the above model as well as a similar model that uses different file formats. The basic lcov idea is the same, though. Unfortunately, llvm is not bug free either - and is also not entirely consistent.) We use coverage data to drive the verification/validation process - so it is extremely important that the data be correct and reliable. Escapes are just WAY too costly (monetary as well as reputational - not to mention stressful). As a result: we try to check everything - but also to leave escape hatches ("sign off") so that errors can be ignored (once we decide that the tools are wrong and the chip is OK). |
I understand better the flow now but understand less why it wouldn't work..... When I run gcov I can get all the coverage info about the code in I want to test this a bit further. Adding verbose and debug flags don't give much info on what lcov is doing.... Is there an easy way to get more debug info or keep the temporary files lcov generates? How can I find the exact command lcov uses to invoke gcov? Is there a way for lcov to tell what's the exact line in the code that has this conflict? Finally, when I use the ignore-error flag, what does lcov do exactly? From what I get the error appears because the info about one branch says it comes both from an exception and not from an exception. Does it merge both even though they say they are different? Does it split them into different branches and reports them individually? Is the mismatched branch info dropped? |
Not quite. When passed the
Yes. I believe that this is what happens (but I have not checked the gcov implementation to be certain what it does. We observe that it doesn't care about inconsistent branch marks, though.)
Yes (I added that to my sandbox but haven't pushed it yet).
Right now, when you ignore the error, then we just merge the count data and ignore the 'is_exception' flag. You are also correct that a Better Idea (tm) might be to keep the data sets separate (not merge) when they appear to be conflicting. Henry |
https://github.com/gcc-mirror/gcc/blob/0f3b4d38d4bad8994150fe7a1e5428055d29a4bf/gcc/gcov.cc#L2382-L2409 In other words, The code doesn't have comments explaining the behaviour, but I can speculate that when optimizations remove code, too many blocks stay marked as exceptional and preferring unexceptional in reports might be an intentional correction for that. No idea if that's correct or not :) |
pushed 1c16cc3 - which prints source code location information of the inconsistency. |
lcov 2.0 and newer does additional error and consistency checking compared to previous versions. This can lead to CI jobs failing due to new/unexpected errors showing up. See: - https://edk2.groups.io/g/devel/message/116138 - linux-test-project/lcov#209 - linux-test-project/lcov#238 Signed-off-by: Oliver Steffen <[email protected]>
lcov 2.0 and newer does additional error and consistency checking compared to previous versions. This can lead to CI jobs failing due to new/unexpected errors showing up. See: - https://edk2.groups.io/g/devel/message/116138 - linux-test-project/lcov#209 - linux-test-project/lcov#238 Signed-off-by: Oliver Steffen <[email protected]>
lcov 2.0 and newer does additional error and consistency checking compared to previous versions. This can lead to CI jobs failing due to new/unexpected errors showing up. See: - https://edk2.groups.io/g/devel/message/116138 - linux-test-project/lcov#209 - linux-test-project/lcov#238 Signed-off-by: Oliver Steffen <[email protected]>
lcov 2.0 and newer does additional error and consistency checking compared to previous versions. This can lead to CI jobs failing due to new/unexpected errors showing up. See: - https://edk2.groups.io/g/devel/message/116138 - linux-test-project/lcov#209 - linux-test-project/lcov#238 Signed-off-by: Oliver Steffen <[email protected]>
lcov 2.0 and newer does additional error and consistency checking compared to previous versions. This can lead to CI jobs failing due to new/unexpected errors showing up. See: - https://edk2.groups.io/g/devel/message/116138 - linux-test-project/lcov#209 - linux-test-project/lcov#238 Signed-off-by: Oliver Steffen <[email protected]>
lcov 2.0 and newer does additional error and consistency checking compared to previous versions. This can lead to CI jobs failing due to new/unexpected errors showing up. See: - https://edk2.groups.io/g/devel/message/116138 - linux-test-project/lcov#209 - linux-test-project/lcov#238 Signed-off-by: Oliver Steffen <[email protected]>
lcov 2.0 and newer does additional error and consistency checking compared to previous versions. This can lead to CI jobs failing due to new/unexpected errors showing up. See: - https://edk2.groups.io/g/devel/message/116138 - linux-test-project/lcov#209 - linux-test-project/lcov#238 Signed-off-by: Oliver Steffen <[email protected]>
lcov 2.0 and newer does additional error and consistency checking compared to previous versions. This can lead to CI jobs failing due to new/unexpected errors showing up. See: - https://edk2.groups.io/g/devel/message/116138 - linux-test-project/lcov#209 - linux-test-project/lcov#238 Signed-off-by: Oliver Steffen <[email protected]>
lcov 2.0 and newer does additional error and consistency checking compared to previous versions. This can lead to CI jobs failing due to new/unexpected errors showing up. See: - https://edk2.groups.io/g/devel/message/116138 - linux-test-project/lcov#209 - linux-test-project/lcov#238 Signed-off-by: Oliver Steffen <[email protected]>
I started getting this error and I'm not sure why...
Command executed:
I more or less found the code that is causing this. The issue is the following loop:
Trying to execute lcov even when there is nothing inside the loop causes that error to pop up. When i comment the for the error goes away. This only happens when I have branch coverage enabled.
The weird part is that the for is not on the main.cpp but the mismatch occurs on main.gcda.... Even weirder is that this error occurs even if the code is unreachable...
I'm at a loss and have no idea what could be wrong.... I know I can just use
--ignore-errors mismatch
but I'd rather fix the issue. Not sure if by using that flag some information could be discarded or if I get other errors in the future they could be hidden by the flag and those could discard coverage information...The text was updated successfully, but these errors were encountered: