-
Notifications
You must be signed in to change notification settings - Fork 274
Invariant violation due to add/sub with mixed types #6731
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
I haven't looked in detail but when we were getting errors like this with gnat2goto it was because of a type mismatch in the goto that we were generating. It looks like you might be mixing up signed and unsigned numbers:
Somewhere you are adding on a constant of type HTH. |
@martin-cs there is a related discussion on mixing signed/unsigned on model-checking/kani#708 |
Thanks for the crosslink @zhassan-aws . I am pleased that I was right about it being array indexing but even more pleased that @tautschnig is on the case. |
@zhassan-aws Does Kani use signed types when doing pointer arithmetic? #6541 would fix this issue, but then @kroening suggested that we might want to enforce stricter rules when generating expressions, ensuring that all pointer arithmetic use signed types. |
I think it does, but we might not be using signed types consistently. @danielsn, can you provide some insight? |
For the example that you provided, the source statement triggering this bug is:
where |
We currently enforce |
Resolving as #6541 has been merged. Kani may nevertheless want to move to a model where all pointer arithmetic uses signed bitvectors. |
CBMC crashes on the attached example generated by Kani with the following output:
CBMC version: 5.52.0
Operating system: Ubuntu 20.04
Exact command line resulting in the issue: cbmc test.out
What behaviour did you expect: Verification successful
What happened instead: Crash
test.out.tar.gz
The text was updated successfully, but these errors were encountered: