Skip to content

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

Closed

Conversation

marek-trtik
Copy link
Contributor

@marek-trtik marek-trtik commented Oct 27, 2017

@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

@peterschrammel
Copy link
Member

@marek-trtik, unfortunately, the minisat download is hard-coded in .travis.yml: https://travis-ci.org/diffblue/cbmc/jobs/293594798#L729
You'll have to hack https://github.com/diffblue/cbmc/blob/develop/.travis.yml#L239 to make this build on CI.

@marek-trtik marek-trtik requested a review from forejtv as a code owner October 27, 2017 15:08
@marek-trtik
Copy link
Contributor Author

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weird spacing

Copy link
Contributor Author

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";
Copy link
Contributor

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

Copy link
Contributor Author

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

@@ -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);
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@@ -145,9 +147,9 @@ guardt &operator |= (guardt &g1, const guardt &g2)
}

// find common prefix
sort_and_join(g1);
// sort_and_join(g1);
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

if(!base_type_eq(lhs.type(), address_of_expr.type(), ns))
address_of_expr.make_typecast(lhs.type());
exprt rhs=
if_exprt(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if_exprt rhs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@@ -699,6 +699,7 @@ std::string expr2ct::convert_struct_type(
if(tag!="")
dest+=" "+id2string(tag);

#if 0
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted back.

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

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)
Copy link
Contributor

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

Copy link
Contributor Author

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
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, it is gone.

Copy link
Contributor

@thk123 thk123 left a 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"
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted back.

@marek-trtik marek-trtik force-pushed the rebase_sv-comp-2017_on_develop branch 3 times, most recently from 1df8b94 to 47636ce Compare November 1, 2017 14:45
@tautschnig
Copy link
Collaborator

I'm wondering how to proceed with #982 and #731, which contain a collection of the patches in this PR. Pushing on them would mean we get duplicate work through this one.

@marek-trtik
Copy link
Contributor Author

@thk123 : Yes, the PR is NOT ready for a review yet. I'll post here an explicit message, when the PR is ready.

@marek-trtik
Copy link
Contributor Author

marek-trtik commented Nov 1, 2017

@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 develop. The first branch should contain changes which should go to develop right now, and the other consisting of only SV-COMP related features. The second branch is supposed to be rebased on top of the first one. The second branch will also go to develop, but not now (after SV-COMP deadline). We will introduce a macro SV_COMP and all that code will be compiled only when the macro is defined.

Both branches are already created and they are rebased on latest develop. The first branch is already PRed (this PR). There is only one remaining thing to be resolved - fixing regression tests on Windows (on Linux build all pass).

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.

@marek-trtik
Copy link
Contributor Author

@tautschnig : I could merge current states of #982 and #731 into this PR.

What solution would you propose?

@peterschrammel
Copy link
Member

@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
Is it worth fixing them or have they become obsolete in the meanwhile?

@tautschnig
Copy link
Collaborator

@marek-trtik

@tautschnig : I could merge current states of #982 and #731 into this PR.
What solution would you propose?

If you could replace all commits with the same subject with their versions from #982 and #731 this would indeed be nice!

@peterschrammel

@tautschnig, Marek is fixing a long-on-Windows-is-32bits bug in these assumptions:

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...

@marek-trtik
Copy link
Contributor Author

@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.

@marek-trtik marek-trtik force-pushed the rebase_sv-comp-2017_on_develop branch from 634bed1 to fe90cb8 Compare November 1, 2017 17:32
@tautschnig
Copy link
Collaborator

The question is whether we want to wait with merge of this PR till #1086 is merged.

Let's try to avoid dependencies wherever possible, so: don't wait. A hack-fix should do for the moment.

@marek-trtik marek-trtik force-pushed the rebase_sv-comp-2017_on_develop branch from fe90cb8 to f3c6be2 Compare November 1, 2017 17:55
@tautschnig
Copy link
Collaborator

Note that I have rebased #982 to make picking a bit easier.

@marek-trtik
Copy link
Contributor Author

I fixed the issue long-on-Windows-is-32bits.

@marek-trtik
Copy link
Contributor Author

marek-trtik commented Nov 1, 2017

@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.

@marek-trtik marek-trtik force-pushed the rebase_sv-comp-2017_on_develop branch 3 times, most recently from 2c16e06 to b8314de Compare November 2, 2017 16:41
@marek-trtik
Copy link
Contributor Author

marek-trtik commented Nov 2, 2017

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:
https://github.com/marek-trtik/cbmc/tree/sv-comp-2017-specific
which is rebased on top of the branch of this PR. However, 2 regression tests fails on the sv-comp-2017-specific branch:

regression/cbmc-java/generics_symtab1/test.desc
regression/cbmc-java/json_trace2/test.desc

I'll investigate that (but this is irrelevant to this PR).

@marek-trtik
Copy link
Contributor Author

!!! To all reviewers: This PR is ready for your reviews !!!

@marek-trtik marek-trtik force-pushed the rebase_sv-comp-2017_on_develop branch from 72ae60c to ca541fd Compare November 3, 2017 12:06
tautschnig and others added 10 commits November 9, 2017 11:17
__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.
@tautschnig
Copy link
Collaborator

tautschnig commented Apr 3, 2018

Breaking up into series of 19 pull requests starting from #1990 all the way up to #2008.

@tautschnig tautschnig closed this Apr 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants