-
Notifications
You must be signed in to change notification settings - Fork 273
Add test verifying no invalid trace with dynamic array #4372
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm quite curious which change actually fixed this problem?
-- | ||
-- | ||
Verify that the trace produced when creating an array whose size is determined | ||
by a an array input, the trace is valid. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"a an"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm quite curious which change actually fixed the problem?
-- | ||
-- | ||
Verify that the trace produced when creating an array whose size is determined | ||
by a an array input, the trace is valid. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"a an"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix English, otherwise lgtm :)
VERIFICATION FAILED | ||
-- | ||
-- | ||
Verify that the trace produced when creating an array whose size is determined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Verify that when an array's size is determined by an array input, the resulting trace is valid"?
So moving this invariant now causes some other failures so I will do the following:
|
Note failure is |
@tautschnig I've not yet checked that fixes this, and so far not got a test that passes on your branch that fails on develop so I wouldn't rush. I'll let you know if the failures here are fixed by your branch. |
@tautschnig Still get this invariant fail on top of your branch, specifically on cbmc-cprover-smt2:
If you want to investigate them further. For now I will put the invariant back and see if I can make the test a little more precise. |
@@ -118,6 +118,10 @@ void convert_decl( | |||
const symbolt *symbol; | |||
irep_idt base_name, display_name; | |||
|
|||
DATA_INVARIANT( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compare with the corresponding code in goto_trace.cpp:
cbmc/src/goto-programs/goto_trace.cpp
Line 271 in 557be1d
if(value.is_nil()) |
It seems the SMT2 solver simply is broken when it comes to unbounded/infinity-sized arrays (@kroening might have some input): The solver returns as model
which is not usable as it is self-referential. |
The full_lhs_value should have a non-nil value regardless of whether the identifier exists in the namespace. This makes visible that the SMT solver returns for an unbounded array as value ((|__CPROVER_threads_exited#1| |__CPROVER_threads_exited#1|)) which is self-referential and thus not usable.
557be1d
to
08c7c9d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
Passed Diffblue compatibility checks (cbmc commit: 08c7c9d).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/106404959
This passes tests locally for me, I believe I only ever saw problems on JBMC |
In trying to produce a test for #4197 I've discovered the problem originally discussed in #4153 has been fixed. So I added the test and moved the invariant to a more defensive position.