Skip to content
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

fix for operator< on reverse_keyt in miniBDD, fixing segfault in ebmc #1062

Merged
merged 3 commits into from
Aug 4, 2017

Conversation

kroening
Copy link
Member

This fixes a segfault in ebmc -- this may even be worth a position in a whitepaper on test generation!

@@ -339,15 +339,14 @@ mini_bddt mini_bdd_mgrt::mk(
}
}

bool mini_bdd_mgrt::reverse_keyt::operator<(
const mini_bdd_mgrt::reverse_keyt &other) const
bool operator < (const mini_bdd_mgrt::reverse_keyt &x,
Copy link
Member

Choose a reason for hiding this comment

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

bool operator<(
  const mini_bdd_mgrt::reverse_keyt &x,
  const mini_bdd_mgrt::reverse_keyt &y)

return false;

return high<other.high;
if(x.var<y.var) return true;
Copy link
Member

Choose a reason for hiding this comment

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

if(x.var<y.var)
  return true;

etc

@peterschrammel
Copy link
Member

Do we have a test case that exhibits the problem?

@mgudemann
Copy link
Contributor

mgudemann commented Jun 27, 2017 via email

@tautschnig
Copy link
Collaborator

BDD2, BDD3 and BDD5 in regression/ebmc fail without this

Are these now routinely run in some Travis set up?

What about enabling/reviving unit/miniBDD.cpp? I don't think any bug fix without an accompanying regression test should get merged as no-one will understand what has gone wrong.

Copy link
Collaborator

@tautschnig tautschnig left a comment

Choose a reason for hiding this comment

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

Apart from various minor comments: there needs to be some convincing regression test story. If the regression test is run in some non-public repository then that's better than nothing, but really the regression test should live with the repository holding the source here.

};

friend bool operator<(const reverse_keyt &, const reverse_keyt &);

Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this changed to a friend rather than being a member?

@mgudemann
Copy link
Contributor

mgudemann commented Jun 28, 2017 via email

@mgudemann
Copy link
Contributor

mgudemann commented Jun 28, 2017 via email

@tautschnig
Copy link
Collaborator

This is just the literal revert of the change that caused the problem. It is very well possible to do the fix with a member function.

I wasn't quite aware that I had broken this in 61f747d. Note to self: do not mix unrelated changes, because they will escape code review...

@kroening
Copy link
Member Author

Now uses a friend.

@tautschnig
Copy link
Collaborator

The linter warnings are to be addressed; but adding some sort of test appears to be most important.

@kroening kroening force-pushed the fix_for_miniBDD branch 2 times, most recently from 7b73499 to 882dab6 Compare July 23, 2017 15:07
@kroening
Copy link
Member Author

An attempt has been made to add a test; the sad result is that this one gets stuck on the fixed variant as well, suggesting that there's still some bug, either in miniBDD, or in the test.

@tautschnig
Copy link
Collaborator

Thank you for adding this test! How about reviving the previous unit test to see whether some very basic operations at least succeed?

@kroening kroening force-pushed the fix_for_miniBDD branch 2 times, most recently from dd0e58d to 319fcca Compare August 3, 2017 21:54
@kroening
Copy link
Member Author

kroening commented Aug 3, 2017

Success! The test now passes on the fixed version, and fails on the previous one.

@tautschnig
Copy link
Collaborator

Thank you for adding this test! Could the linter please be made happy or, where appropriate, be silenced?

@kroening
Copy link
Member Author

kroening commented Aug 3, 2017

Done. Note that this has required a change to util/invariant.h.

Copy link
Collaborator

@tautschnig tautschnig left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@kroening kroening merged commit 0cad6f4 into master Aug 4, 2017
@kroening kroening deleted the fix_for_miniBDD branch August 4, 2017 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants