This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add improved XCM fuzzer * Add command for running a single input * Add installation command * Fix @m-cat's nit * Add newline Co-authored-by: Kian Paimani <[email protected]> * Add info about current directory in fuzzing README * Update Cargo.lock --------- Co-authored-by: Keith Yeung <[email protected]> Co-authored-by: Kian Paimani <[email protected]>
- Loading branch information
1 parent
f07d956
commit 48f41dd
Showing
5 changed files
with
152 additions
and
40 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
hfuzz_target | ||
hfuzz_workspace | ||
cargo | ||
coverage | ||
ccov.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# XCM Simulator Fuzzer | ||
|
||
This project will fuzz-test the XCM simulator. It can catch reachable panics, timeouts as well as integer overflows and underflows. | ||
|
||
## Install dependencies | ||
|
||
``` | ||
cargo install honggfuzz | ||
``` | ||
|
||
## Run the fuzzer | ||
|
||
In this directory, run this command: | ||
|
||
``` | ||
cargo hfuzz run xcm-fuzzer | ||
``` | ||
|
||
## Run a single input | ||
|
||
In this directory, run this command: | ||
|
||
``` | ||
cargo hfuzz run-debug xcm-fuzzer hfuzz_workspace/xcm-fuzzer/fuzzer_input_file | ||
``` | ||
|
||
## Generate coverage | ||
|
||
In this directory, run these four commands: | ||
|
||
``` | ||
RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort" CARGO_INCREMENTAL=0 SKIP_WASM_BUILD=1 CARGO_HOME=./cargo cargo build | ||
../../../target/debug/xcm-fuzzer hfuzz_workspace/xcm-fuzzer/input/ | ||
zip -0 ccov.zip `find ../../../target/ \( -name "*.gc*" -o -name "test-*.gc*" \) -print` | ||
grcov ccov.zip -s ../../../ -t html --llvm --branch --ignore-not-existing -o ./coverage | ||
``` | ||
|
||
The code coverage will be in `./coverage/index.html`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters