Skip to content

cbmc misses an error #7953

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

Closed
salvadorer opened this issue Oct 12, 2023 · 1 comment · Fixed by #7954
Closed

cbmc misses an error #7953

salvadorer opened this issue Oct 12, 2023 · 1 comment · Fixed by #7954

Comments

@salvadorer
Copy link

Dear all,
it seems like cbmc misses an assertion violation in the program:

#include <assert.h>
extern void __VERIFIER_assume(int cond);
extern int __VERIFIER_nondet_int(void);
int main() {
  int z = __VERIFIER_nondet_int();
  int k = __VERIFIER_nondet_int();
__VERIFIER_assume(1 < z);
__VERIFIER_assume(1 <= z && k <= 1);
assert(0);
}

Calling "cbmc test.c" gives:
** Results:
test.c function main
[main.assertion.1] line 9 assertion 0: SUCCESS
but clearly the assertion is reachable.

CBMC version: 5.93.0
Operating system: Ubuntu

@tautschnig
Copy link
Collaborator

Thank you for this bug report! We end up rewriting __VERIFIER_assume(1 <= z && k <= 1); to assume(z == 1), I am trying to figure out why this is happening.

tautschnig added a commit to tautschnig/cbmc that referenced this issue Oct 12, 2023
We must not blindly assume that that <exprA> and <exprB> in
<exprA> >= C1 && !(<exprB> >= C2) are the same.

Fixes: diffblue#7953
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants