-
Notifications
You must be signed in to change notification settings - Fork 274
CBMC reporting incosistently assertion failures #8196
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
After removing the assumption, I get the following result: |
This is what I get when removing the assertion:
So I do not get warnings about out-of-bounds accesses. Also how come that the verification result differs once I replace usages of j by 5? |
On version 5.95.1 you need to add the option |
Even with --bounds-check, we get the following results:
Version without assumption:
It is very confusing from a user's perspective that when there is must-undefined-behavior (for the version with the assumption), the assertion on line 15 fails, and when there is may-undefined-behavior (for the version without the assumption), the assertion succeeds. Shouldn't CBMC be consistent in handling these two programs? |
Once there is undefined behavior, there can't be a promise of consistency anymore (because then you are defining behaviour). We'll make the assertion report s.th. like "inconclusive" going forward. |
When removing the assumption we now (with #8314 in place) print:
Resolving. |
Hi,
I notice that if I invoke cbmc without any arguments on the following code I see a warning about the assertion:
Result:
[main.assertion.1] line 15 assertion arr[j] == 5: FAILURE
I know that arr[j] is out-of bounds. Still the behavior is surprising since dropping the assumption results in 0 warnings even tough the array access might also be out of bounds in this case.
CBMC version: 5.95.1
Operating system: Ubuntu 22.04.3
Exact command line resulting in the issue:
cbmc test.c
The text was updated successfully, but these errors were encountered: