-
Notifications
You must be signed in to change notification settings - Fork 274
Omitting property checking flags changes coverage checking #5543
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
Comments
For the second case, we have UB at the line |
For your first case I have now merged PR#5635 which will cause all lines of a multiple line statement to be included in the reporting. This will mean that running cbmc both with and without @hannes-steffenhagen-diffblue and @NlightNFotis are currently looking into your second case, |
As to your second issue: The coverage here is changing because the default behavior is that in coverage assertions are turned into assumptions – including the ones added by the various checks. So as @danielsn correctly guessed, the problem here is that the dereference would be an error in the null case, which is caught by If you do want line coverage for lines that are guarded by failing assertions, that currently doesn’t seem to be possible but I’ve added PR #5636 to address this, which will add a flag to change the behaviour for that instead. |
@markrtuttle I have added the |
@markrtuttle @hannes-steffenhagen-diffblue any updates on this issue? Should we close it? |
@markrtuttle From our perspective it doesn't seem like there's anything left to do. Let us know if you're having a related issue. |
CBMC version: 5.17.0 (cbmc-5.17.0-12-ga46f12d66
Operating system: Ubuntu 20
Exact command line resulting in the issue: see below
What behaviour did you expect: see below
What happened instead: see below
Summary
My coverage checking results are affected by whether or not I include property checking flags on the command line.
I had been in the habit of doing property checking with flags like --pointer-check, and doing coverage checking with the same set of flags. I was advised that I could accelerate coverage checking by omitting the property checking flags when I'm doing coverage checking. But omitting the flags changes the coverage results.
Decreased coverage
Omitting property checking flags when doing coverage checking results in lower coverage (lower percentage of lines hit).
Consider the attached file example2.c containing
My results are
and
The differences are the lines
and the missing line 9 is the second argument
*ptr
to the invocation offoo
.So omitting property checking flags when doing coverage checking results in lower coverage (percent of lines hit).
Incorrect coverage
Including property checking flags when doing coverage changes coverage results.
Consider the attached file example1.c containing
My results are
and
The results differ only in line 10 which is
a = 1;
. Without pointer checking the line is considered hit and with pointer checking the line is considered missed.The text was updated successfully, but these errors were encountered: