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

SMTChecker test failure: "SMTChecker/division": Multiple errors found #7297

Closed
livnev opened this issue Aug 23, 2019 · 7 comments · Fixed by #7298
Closed

SMTChecker test failure: "SMTChecker/division": Multiple errors found #7297

livnev opened this issue Aug 23, 2019 · 7 comments · Fixed by #7298
Assignees
Labels
Projects

Comments

@livnev
Copy link

livnev commented Aug 23, 2019

Description

When I build 0.5.11 from https://github.com/ethereum/solidity/releases/download/v0.5.11/solidity_0.5.11.tar.gz, upon running the tests I get:

--- SKIPPING ALL SEMANTICS TESTS ---

Running 2879 test cases...

0%   10   20   30   40   50   60   70   80   90   100%
|----|----|----|----|----|----|----|----|----|----|
*******/build/source/test/libsolidity/AnalysisFramework.cpp(65): fatal error: in "SMTChecker/division": Multiple errors found: :9:17: Warning: Overflow (resulting value larger than 2**256 - 1) might happen here.
                                uint256 c = a * b;
                                            ^---^

:10:13: Warning: Division by zero happens here
                                require(c / a == b);
                                        ^---^
  for:
   = 0
  <result> = 0
  a = 0
  b = 0
  c = 0

Callstack:


********************************************

*** 1 failure is detected in the test module "SolidityTests"

Environment

  • Compiler version: the 0.5.11 release
  • Target EVM version (as per compiler settings): -
  • Framework/IDE (e.g. Truffle or Remix): -
  • EVM execution environment / backend / blockchain client: -
  • Operating system: linux
$ z3 --version
Z3 version 4.8.4 - 64 bit

Steps to Reproduce

I am building solc with nix from this version of nixpkgs. 0.5.10 builds and tests without problems. Could my z3 version be responsible?

cc @leonardoalt

@leonardoalt
Copy link
Member

Yeah we've seen queries that Z3 4.8.5 can solve whereas 4.8.4 can't, this could be one of those. It's hard to set test expectations for hard queries (nonlinear arithmetics in this case), also because using CVC4 instead of Z3 might be more/less powerful depending on the theory. That's why we decided to set the test expectations according to the solvers latest releases.

@livnev
Copy link
Author

livnev commented Aug 23, 2019

Yeah we've seen queries that Z3 4.8.5 can solve whereas 4.8.4 can't, this could be one of those. It's hard to set test expectations for hard queries (nonlinear arithmetics in this case), also because using CVC4 instead of Z3 might be more/less powerful depending on the theory. That's why we decided to set the test expectations according to the solvers latest releases.

I see, though I think it didn't work for me with 4.8.5 either, but I can check again.

@livnev
Copy link
Author

livnev commented Aug 23, 2019

Can confirm that I am getting the same failure with:

$ z3 --version
Z3 version 4.8.5 - 64 bit

This was referenced Aug 23, 2019
@leonardoalt
Copy link
Member

Let me run that locally with Z3 only, maybe CVC4 is the responsible for solving it in the tests.

@leonardoalt
Copy link
Member

I can reproduce it with Z3 4.8.5 and no CVC4. This means we also need to adjust this test such that it can succeed or return unknown.

@livnev
Copy link
Author

livnev commented Aug 23, 2019

I can confirm that:

(a) building with CVC4 resolves the issue
(b) your patch in #7298 resolves the issue

I decided to add CVC4 support to the nix derivation.

SMT Checker automation moved this from To Do to Done Aug 24, 2019
@leonardoalt
Copy link
Member

Thanks @livnev !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
SMT Checker
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants