CKB-VM fuzzing test script and corpus repository.
Running run.sh clones nervosnetwork/ckb-vm under deps/ and invokes cargo +nightly fuzz run. You need a full native build environment on the machine, not only the packages shown in CI snippets.
-
C linker (
cc): required to buildcargo-fuzzand other native code. On Debian/Ubuntu:sudo apt install build-essential
The CKB-VM fuzz workspace depends on the spike-sys crate, which runs a build.sh that clones and builds riscv-isa-sim (Spike) using Clang, then produces libspike-interfaces.a. If this step fails, you may see link errors such as could not find native static library spike-interfaces.
On Debian/Ubuntu, install at least:
sudo apt update
sudo apt install -y \
clang \
device-tree-compiler \
autoconf automake libtool \
zlib1g-dev \
libboost-regex-dev libboost-system-devYou may need additional packages depending on your distribution and Spike version; check the first failure from ./configure or make inside the Spike build.
The develop workflow installs device-tree-compiler, nightly Rust, and cargo-fuzz on ubuntu-latest. Local or self-hosted runners (e.g. minimal images, ARM servers) should satisfy the Spike/Clang toolchain above in addition to CI packages.
- First build can be slow: Spike is cloned and compiled from source.
- Rust may warn about
cfg(has_asm)when building older CKB-VM revisions; upstream ckb-vm documentscheck-cfgfor that case on current branches.
Fuzzing test on develop branch:
bash run.sh developFuzzing test on release branch:
bash run.sh release-0.24For a shorter run, pass fast as the second argument (see run.sh):
bash run.sh develop fastThe first argument is the ckb-vm Git branch or tag passed to git clone --branch, not a branch of this repository.
After running any fuzzing tests, all corpus should be compacted via:
bash cmin.shThen commit the corpus changes for future use.