-
Notifications
You must be signed in to change notification settings - Fork 274
Behavior of infinite loops with goto-instrument --unwind N --unwinding-assertions
differs from cbmc --unwind N --unwinding-assertions
#6433
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
CBMC has a special case for "while (1) {}" to convert to "assume(false);". There is a flag to disable this. This was added for code in SVCOMP. But, maybe the default should have been the other way around, or maybe we should be giving you a warning when this special case is invoked. |
@jimgrundy is correct, As I described in #6432 (comment) the goto-instrument unwinder is a different piece of code. It will duplicate the body. This might break the heuristic that CBMC uses to recognise The "reachable" failing after seems weird and might well be a bug. |
Unless CBMC is invoked with --no-self-loops-to-assumptions, self-loops are replaced by assumptions. This commit now introduces a status output that such replacement is happening, and also a warning when --unwinding-assertions is set: as the loop is replaced by an assumption, no unwinding assertions can possible be generated. This behaviour may be unexpected by the user, and we should therefore let them know what is going on. Fixes: diffblue#6433
Unless CBMC is invoked with --no-self-loops-to-assumptions, self-loops are replaced by assumptions. This commit now introduces a status output that such replacement is happening, and also a warning when --unwinding-assertions is set: as the loop is replaced by an assumption, no unwinding assertions can possible be generated. This behaviour may be unexpected by the user, and we should therefore let them know what is going on. Fixes: diffblue#6433
There seem to be at least three, perhaps even more issues hidden in here:
A possible further issue is that |
Unless CBMC is invoked with --no-self-loops-to-assumptions, self-loops are replaced by assumptions. This commit now introduces a status output that such replacement is happening, and also a warning when --unwinding-assertions is set: as the loop is replaced by an assumption, no unwinding assertions can possible be generated. This behaviour may be unexpected by the user, and we should therefore let them know what is going on. Fixes: diffblue#6433
Uh oh!
There was an error while loading. Please reload this page.
CBMC version: 5.42.0 (cbmc-5.42.0-2-g038a53b50)
Operating system: Debian
Exact command line resulting in the issue:
goto-instrument --unwind 3 --unwinding-assertions test.gb test-unwinding.gb && cbmc test-unwinding.gb --function foo
What behaviour did you expect: No assertion failures
What happened instead: Two assertion failure
I have the following code in
test.c
:When I run
cbmc --unwind 3 --unwinding-assertions test.c --function foo
, I don't see any assertion failures:Now I try to do the same thing with
goto-instrument
:And I see two failures:
The behavior I want is actually what
cbmc
does, which is to essentially treat the loop asassume(false)
. Why doesgoto-instrument
behave differently, and is it intended to behave differently?The text was updated successfully, but these errors were encountered: