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

Manticore returns wrong result on trivial function #2587

Open
Simon1V opened this issue Sep 20, 2022 · 1 comment
Open

Manticore returns wrong result on trivial function #2587

Simon1V opened this issue Sep 20, 2022 · 1 comment
Labels

Comments

@Simon1V
Copy link

Simon1V commented Sep 20, 2022

Summary of the problem

Using Manticore's python API, a wrong result is returned on a slightly adapted "incremented" function.

Manticore version

Version: 0.3.8.dev220714

Python version

Python 3.8.10

OS / Environment

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.5 LTS
Release: 20.04
Codename: focal

Dependencies

Solc 0.8.17+commit.8df45f5f.Linux.g++
z3-solver==4.8.17.0

Step to reproduce the behavior

Python script

def testIncremented2(): 
        m = ManticoreEVM()
        userAcc = m.create_account(balance=10000000)
        contractAcc = m.solidity_create_contract(contractSrc, owner=userAcc, balance=0)
	value = m.make_symbolic_value() 
	contractAcc.incremented2(value)
	for state in m.ready_states: 
		print("Can value be negative? {}".format(state.can_be_true(value < 0)))

and the function testIncremented2 simply

function incremented2(uint256 x) public returns(uint256)
    {
        return x + 1; 
    }

Expected behavior

Can value be negative? False

Actual behavior

Can value be negative? True

Any relevant logs

@Simon1V Simon1V added the bug label Sep 20, 2022
@gitsan13
Copy link

Hi @Simon1V
I would like to give this issue a try.

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

No branches or pull requests

2 participants