Skip to content

Commit

Permalink
Merge branch 'master' into ekilmer-dev
Browse files Browse the repository at this point in the history
* master: (24 commits)
  Fix symbolic syscall arg concretization (#1697)
  Update README, Add Issue Templates (#1685)
  Fix inheritance magic and add plugin enable/disable (#1696)
  Add hashing to constraintSets (#1703)
  Reduce log messages (#1700)
  Updated Proc error message to be more informative (#1704)
  Move states that selfdestruct to the ready queue. (#1699)
  Reduce concrete hash log messages. (#1695)
  Remove Keystone from existing tests (#1684)
  Change URL for WASM spec (#1702)
  Overhaul Linux file emulation (#1673)
  Try getting more coverage from truffle-test (#1694)
  Eliminate deprecation warning in solidity_create_contract. (#1692)
  Fix a few documentation typos in ManticoreBase (#1687)
  Add set_verbosity to the documentation (#1688)
  Adjust z3 options. (#1691)
  Improve concretize log messages (#1686)
  Move truffle to its own CI type (#1693)
  Remove default gas limit (#1689)
  Better argument names in manticoreEVM api (#1652)
  ...
  • Loading branch information
ekilmer committed May 18, 2020
2 parents f5dc991 + 704007e commit a7633d9
Show file tree
Hide file tree
Showing 46 changed files with 3,291 additions and 631 deletions.
20 changes: 13 additions & 7 deletions .github/ISSUE_TEMPLATE.md → .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
### OS / Environment
<!--- lsb_release -a --->
---
name: Bug report
about: Create a report to help us improve Manticore
title: ''
labels: bug
assignees: ''

---

### Summary of the problem


### Manticore version
<!--- pip show manticore | grep Version --->

### Python version
<!--- python --version --->

### OS / Environment
<!--- lsb_release -a --->

### Dependencies
<!--- pip freeze --->


### Summary of the problem


### Step to reproduce the behavior


Expand All @@ -27,4 +34,3 @@
### Any relevant logs



14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
blank_issues_enabled: false
contact_links:
- name: Bug Report
url: https://github.com/trailofbits/manticore/issues/new?labels=bug&template=bug_report.md
about: Report a bug in Manticore
- name: Feature Request
url: https://github.com/trailofbits/manticore/issues/new?labels=idea&template=feature_request.md
about: Request a new feature in Manticore
- name: Ask a Question
url: https://github.com/trailofbits/manticore/discussions/new
about: Ask for help or clarification from the developers
- name: Join our Slack
url: https://empirehacking.slack.com/archives/C3PTWK7UM
about: Engage with other users of Manticore
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest a new feature for Manticore
title: ''
labels: idea
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
51 changes: 22 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
type: ["ethereum_bench", "examples", "ethereum", "ethereum_vm", "native", "wasm", "wasm_sym", "other"]
type: ["ethereum_truffle", "ethereum_bench", "examples", "ethereum", "ethereum_vm", "native", "wasm", "wasm_sym", "other"]
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.6
Expand All @@ -49,11 +49,7 @@ jobs:
# Install solc unconditionally because it only takes a second or two
sudo wget -O /usr/bin/solc https://github.com/ethereum/solidity/releases/download/v0.4.24/solc-static-linux
sudo chmod +x /usr/bin/solc
EXTRAS="dev-noks"
if [[ "$TEST_TYPE" == "native" ]]; then
EXTRAS="dev"
fi
pip install -e .[$EXTRAS]
pip install -e ".[dev-noks]"
- name: Run Tests
env:
TEST_TYPE: ${{ matrix.type }}
Expand All @@ -63,13 +59,13 @@ jobs:
# concolic assumes presence of ../linux/simpleassert
echo "Running concolic.py..."
HW=../linux/helloworld
python ./concolic.py
coverage run ./concolic.py
if [ $? -ne 0 ]; then
return 1
fi
echo "Running count_instructions.py..."
python ./count_instructions.py $HW |grep -q Executed
coverage run ./count_instructions.py $HW |grep -q Executed
if [ $? -ne 0 ]; then
return 1
fi
Expand All @@ -78,21 +74,21 @@ jobs:
gcc -static -g src/state_explore.c -o state_explore
ADDRESS=0x$(objdump -S state_explore | grep -A 1 '((value & 0xff) != 0)' |
tail -n 1 | sed 's|^\s*||g' | cut -f1 -d:)
python ./introduce_symbolic_bytes.py state_explore $ADDRESS
coverage run ./introduce_symbolic_bytes.py state_explore $ADDRESS
if [ $? -ne 0 ]; then
return 1
fi
echo "Running run_simple.py..."
gcc -x c -static -o hello test_run_simple.c
python ./run_simple.py hello
coverage run ./run_simple.py hello
if [ $? -ne 0 ]; then
return 1
fi
echo "Running run_hook.py..."
MAIN_ADDR=$(nm $HW|grep 'T main' | awk '{print "0x"$1}')
python ./run_hook.py $HW $MAIN_ADDR
coverage run ./run_hook.py $HW $MAIN_ADDR
if [ $? -ne 0 ]; then
return 1
fi
Expand All @@ -102,7 +98,7 @@ jobs:
gcc -static -g src/state_explore.c -o state_explore
SE_ADDR=0x$(objdump -S state_explore | grep -A 1 'value == 0x41' |
tail -n 1 | sed 's|^\s*||g' | cut -f1 -d:)
python ./state_control.py state_explore $SE_ADDR
coverage run ./state_control.py state_explore $SE_ADDR
if [ $? -ne 0 ]; then
return 1
fi
Expand Down Expand Up @@ -154,25 +150,23 @@ jobs:
mkdir truffle_tests
cd truffle_tests
truffle unbox metacoin
manticore . --contract MetaCoin --workspace output
### The original comment says we should get 41 states, but after implementing the shift
### insructions, we get 31. Was the original comment a typo?
# The correct answer should be 41
# but Manticore fails to explore the paths due to the lack of the 0x1f opcode support
# see https://github.com/trailofbits/manticore/issues/1166
# if [ "$(ls output/*tx -l | wc -l)" != "41" ]; then
coverage run -m manticore . --contract MetaCoin --workspace output
# Truffle smoke test. We test if manticore is able to generate states
# from a truffle project.
if [ "$(ls output/*tx -l | wc -l)" != "34" ]; then
echo "Truffle test failed" `ls output/*tx -l | wc -l` "!= 34"
return 1
fi
echo "Truffle test succeded"
coverage xml
cd ..
cp truffle_tests/coverage.xml .
return 0
}
run_tests_from_dir() {
DIR=$1
echo "Running only the tests from 'tests/$DIR' directory"
pytest --durations=100 --cov=manticore -n auto "tests/$DIR"
coverage xml
}
Expand All @@ -190,38 +184,34 @@ jobs:
launch_examples
RESULT=$?
echo Ran example scripts
coverage xml
popd
cp examples/script/coverage.xml .
return $RESULT
}
# Test type
case $TEST_TYPE in
ethereum_vm)
make_vmtests
echo "Running only the tests from 'tests/$TEST_TYPE' directory"
run_tests_from_dir $TEST_TYPE
RV=$?
;;
ethereum_truffle)
echo "Running truffle test"
install_truffle
run_truffle_tests
RV=$(($RV + $?))
;;
wasm)
make_wasm_tests
echo "Running only the tests from 'tests/$TEST_TYPE' directory"
run_tests_from_dir $TEST_TYPE
RV=$?
;;
wasm_sym)
make_wasm_sym_tests ;&
make_wasm_sym_tests ;& # Fallthrough
native) ;& # Fallthrough
ethereum) ;& # Fallthrough
ethereum_bench) ;& # Fallthrough
other)
echo "Running only the tests from 'tests/$TEST_TYPE' directory"
run_tests_from_dir $TEST_TYPE
RV=$?
;;
examples)
run_examples
Expand All @@ -237,3 +227,6 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
yml: ./codecov.yml
# Disabled this line because Codecov has been extra flaky lately, and having to re-run the entire
# test suite until every coverage upload step succeeds is more of a hassle than it's worth.
# fail_ci_if_error: true
6 changes: 5 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@ instead.

## Questions

Questions can be submitted to the issue tracker, but you may get a faster
Questions can be submitted to the [discussion page](https://github.com/trailofbits/manticore/discussions), but you may get a faster
response if you ask in our [chat room](https://empireslacking.herokuapp.com/)
(in the #manticore channel).

## Legal
For legal reasons, we require contributors to sign our [Contributor License Agreement](https://cla-assistant.io/trailofbits/manticore).
This will be automatically checked as part of our CI.

## Code

Manticore uses the pull request contribution model. Please make an account on
Expand Down
Loading

0 comments on commit a7633d9

Please sign in to comment.