-
Notifications
You must be signed in to change notification settings - Fork 273
Fix a crash during SMT translation of structs #5904
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
19b2cae
to
42a448a
Compare
Codecov Report
@@ Coverage Diff @@
## develop #5904 +/- ##
===========================================
+ Coverage 75.12% 75.14% +0.02%
===========================================
Files 1435 1435
Lines 156301 156303 +2
===========================================
+ Hits 117416 117455 +39
+ Misses 38885 38848 -37
Continue to review full report at Codecov.
|
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.
Please can you reformat this a little to fix with current conventions.
Should there be a similar change for union_tags? |
Unions are currently not encoded using data types in SMT, so this particular issue doesn't appear with unions. But I haven't checked if we would have a similar issue with non-DT encoding of unions and structs. We do something similar for bit vector encodings -- instead of looking up the |
7442aa6
to
5c0a2ca
Compare
I think the test is failing in CI because it cannot find Is there a way we can just test the SMT constraint generation with data types enabled, without actually solving them using z3? Alternatively, we can install z3 on our CI :) |
It seems reasonable to install an SMT solver in CI in order to test the SMT output properly. Just so long as we don't end up giving it anything to solve which inflates the overall run time too much. @diffblue/diffblue-opensource What do the rest of you think? Please note that I haven't reviewed the rest of this PR, I am just trying to help with this particular issue. |
Thanks @thomasspriggs. @martin-cs I think I have addressed your comment regarding conventions. There is one remaining issue with |
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.
The fix appears reasonable to me. But we need get the test to run and pass in CI, before I will be happy to approve. This so that the additional CI related changes can be reviewed and approved before merging.
f6001d7
to
dec30a2
Compare
Blocked on #5949. |
I only raised that PR to run CI, it is in Draft status and the work in known to be incomplete. We are currently giving higher priority to other pieces of work. It could be a week or so, before we come back to those CI changes. Is that going to be a problem for you? |
Hi @thomasspriggs, No problem. I was going through all of my PRs and rebased some of them with Thanks. |
dec30a2
to
c982bb3
Compare
c982bb3
to
bd3715f
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.
Looks good; thanks.
bd3715f
to
2dfea99
Compare
This commit fixes a `key not found` exception in `convert_type` during SMT2 encoding of structs using data types. Although structs were being mapped to SMT2 datatypes (in `datatype_map`) struct_tags were not.
2dfea99
to
c2ec649
Compare
This PR fixes a bug with SMT translation of structs using data types (not bit vectors). CBMC
--smt2 --z3
was crashing on the attached regression test with akey not found
exception from amap::at
call.Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/My commit message includes data points confirming performance improvements (if claimed).