-
Notifications
You must be signed in to change notification settings - Fork 273
SV-COMP 2018: Rebase of Tautschnig's branch/PR sv-comp-2017
on cbmc/develop
#1532
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
SV-COMP 2018: Rebase of Tautschnig's branch/PR sv-comp-2017
on cbmc/develop
#1532
Conversation
@marek-trtik, unfortunately, the minisat download is hard-coded in .travis.yml: https://travis-ci.org/diffblue/cbmc/jobs/293594798#L729 |
Fixed. Thank you Petr! |
bvt invalid_bv, null_bv; | ||
encode(pointer_logic.get_invalid_object(), invalid_bv); | ||
invalid_bv.erase(invalid_bv.begin(), invalid_bv.begin()+offset_bits); | ||
encode(pointer_logic.get_null_object(), null_bv); |
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.
weird spacing
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.
Fixed.
@@ -439,6 +425,9 @@ bvt bv_pointerst::convert_pointer_type(const exprt &expr) | |||
{ | |||
return SUB::convert_byte_extract(to_byte_extract_expr(expr)); | |||
} | |||
else if(expr.id()==ID_byte_update_little_endian || | |||
expr.id()==ID_byte_update_big_endian) | |||
throw "byte-wise updates of pointers are unsupported"; |
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.
not sure we should use throw
if there is no corresponding catch
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.
Sure. However, there are already 656 such throw "...
statements in our code base, e.g.:
https://github.com/diffblue/cbmc/blob/develop/src/analyses/ai.cpp#L466
src/util/guard.cpp
Outdated
@@ -95,9 +95,9 @@ guardt &operator -= (guardt &g1, const guardt &g2) | |||
if(g1.id()!=ID_and || g2.id()!=ID_and) | |||
return g1; | |||
|
|||
sort_and_join(g1); | |||
// sort_and_join(g1); |
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.
remove or use #if 0
and explain
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.
Fixed.
src/util/guard.cpp
Outdated
@@ -108,10 +108,12 @@ guardt &operator -= (guardt &g1, const guardt &g2) | |||
it2!=op2.end(); | |||
++it2) | |||
{ | |||
while(it1!=op1.end() && *it1<*it2) | |||
++it1; | |||
/*while(it1!=op1.end() && *it1<*it2) |
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.
remove
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.
Fixed.
src/util/guard.cpp
Outdated
@@ -145,9 +147,9 @@ guardt &operator |= (guardt &g1, const guardt &g2) | |||
} | |||
|
|||
// find common prefix | |||
sort_and_join(g1); | |||
// sort_and_join(g1); |
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.
remove or use #if 0
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.
Fixed.
src/analyses/goto_check.cpp
Outdated
if(!base_type_eq(lhs.type(), address_of_expr.type(), ns)) | ||
address_of_expr.make_typecast(lhs.type()); | ||
exprt rhs= | ||
if_exprt( |
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.
if_exprt rhs
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.
Fixed.
src/ansi-c/expr2c.cpp
Outdated
@@ -699,6 +699,7 @@ std::string expr2ct::convert_struct_type( | |||
if(tag!="") | |||
dest+=" "+id2string(tag); | |||
|
|||
#if 0 |
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.
why is this commented out?
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.
Reverted back.
src/ansi-c/expr2c.cpp
Outdated
return convert_norep(src, precedence); | ||
|
||
unsigned p0; | ||
std::string op0=convert_with_precedence(src.op0(), p0); | ||
|
||
std::string dest="MALLOC"; | ||
unsigned p1; | ||
std::string op1=convert_with_precedence(src.op0(), p1); |
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.
const ?
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.
Fixed.
src/analyses/goto_check.cpp
Outdated
else if(i.is_end_function()) | ||
{ | ||
if(i.function==goto_functionst::entry_point() && | ||
enable_memory_leak_check) | ||
if(i.function==goto_functionst::entry_point() && enable_memory_leak_check) |
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.
this change is not in the right commit
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.
Reverted back.
.travis.yml
Outdated
- make -C src/ansi-c library_check | ||
- make -C src "CXX=${COMPILER}" "CXXFLAGS=-Wall -Werror -pedantic -O2 -g ${EXTRA_CXXFLAGS}" -j2 | ||
- make -C src "CXX=${COMPILER}" "CXXFLAGS=-Wall -Werror -pedantic -O2 -g ${EXTRA_CXXFLAGS}" -j2 clobber.dir memory-models.dir |
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 don't think that's a good idea to remove these flags
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.
Sure, it is gone.
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 don't think this is ready for review - though I agree with
@romainbrenguier's comments. Could you comment when it needs another review.
.travis.yml
Outdated
@@ -211,7 +211,7 @@ jobs: | |||
name: "diffblue/cbmc" | |||
description: "Travis build of ${TRAVIS_COMMIT}" | |||
notification_email: "[email protected]" | |||
build_command_prepend: "make -C src minisat2-download" | |||
build_command_prepend: "make -C src glucose-download" |
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.
This seems like a surprising change - what are the implications/justifications for this swap?
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.
Reverted back.
src/config.inc
Outdated
@@ -5,7 +5,7 @@ BUILD_ENV = AUTO | |||
ifeq ($(BUILD_ENV),MSVC) | |||
#CXXFLAGS += /Wall /WX | |||
else | |||
CXXFLAGS += -Wall -pedantic -Werror | |||
CXXFLAGS += -Wall -Wno-parentheses |
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.
This shouldn't change
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.
Reverted back.
1df8b94
to
47636ce
Compare
@thk123 : Yes, the PR is NOT ready for a review yet. I'll post here an explicit message, when the PR is ready. |
@tautschnig : According to your response to @lucasccordeiro 's email I believe that #982 and #731 are (some of) those PRs factored out from #363. I think that it is still true that #363 contains all patches for SV_COMP we currently have. Also, everybody I asked told me that I should work with #363. The goal with #363 was to prepare two branches, both rebased on the latest Both branches are already created and they are rebased on latest I did not consider #982 nor #731 in this process. I am not sure whether it make a sense to use them at this point. |
@tautschnig : I could merge current states of #982 and #731 into this PR. What solution would you propose? |
@tautschnig, Marek is fixing a long-on-Windows-is-32bits bug in these assumptions: https://github.com/tautschnig/cbmc/blob/799446487a95302106bbe8d1a9de9a88d46eceee/src/ansi-c/library/new.c#L14 |
If you could replace all commits with the same subject with their versions from #982 and #731 this would indeed be nice!
I've digged into my various pull requests, but it seems I've dropped this everywhere. One problem certainly is that the object:offset encoding is now configurable, hence any such check is somewhat questionable. Hopefully #1086 is something I'll find time for very soon... |
@tautschnig : Yes, I'll try to take versions of the corresponding commits from #982 and #731 (however, I'll keep fixes (CPPLINT/clang-formater) I made). So, it means, that I'll perform merge of the related commits instead of replacement. Regarding the long-on-Windows-is-32bits issue: If I understood correctly #1086 should solve (avoid) the issue (those assumptions won't be needed anymore). However, this PR cannot be merged without the issue is solved (one way of the other). The question is whether we want to wait with merge of this PR till #1086 is merged. |
634bed1
to
fe90cb8
Compare
Let's try to avoid dependencies wherever possible, so: don't wait. A hack-fix should do for the moment. |
fe90cb8
to
f3c6be2
Compare
Note that I have rebased #982 to make picking a bit easier. |
I fixed the issue long-on-Windows-is-32bits. |
@tautschnig : Thanks for the rebase. It will certainly help. However, I see there are still CPPLINT/clang-formater issues. I'll fixed them during the merge of corresponding commits. |
2c16e06
to
b8314de
Compare
This PR now comprises #982 and #731. Also the assumptions (those with the long-on-Windows-is-32bits issue) were moved into the SV-COMP specific branch:
I'll investigate that (but this is irrelevant to this PR). |
3debb60
to
72ae60c
Compare
!!! To all reviewers: This PR is ready for your reviews !!! |
72ae60c
to
ca541fd
Compare
__CPROVER_allocate takes two arguments, where the second requests zero-initialization of the newly allocated object. Thus `calloc` can be implemented efficiently.
Just ignoring them would yield unsound results.
Also includes an incomplete implementation to introduce a new L1 name for each declaration. This works for all regression tests, but fails on some larger examples.
They are constructed in a consistent order anyway.
Check whether the object part of a pointer is greater or equal the total number of objects, or equals a dynamic object that has not actually been allocated on a given trace.
ca541fd
to
eecaee0
Compare
@tautschnig , @peterschrammel @martin-cs : Please check the correctness of the rebase. Thank you.
!!! IMPORTANT: I ask other reviewers to postpone their reviews till the PR is fixed (NOTE: I had to create the PR in order to fix issues in Travis and mainly AppVeyor). Once the PR is ready for reviews I'll post an explicit message to this PR. Thank you for understanding. !!!
This is the rebased PR: #363