Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ckb-vm-fuzzing-test

CKB-VM fuzzing test script and corpus repository.

Prerequisites (host toolchain)

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/C++ toolchain

  • C linker (cc): required to build cargo-fuzz and other native code. On Debian/Ubuntu:

    sudo apt install build-essential

Spike / spike-sys (fuzz build)

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-dev

You may need additional packages depending on your distribution and Spike version; check the first failure from ./configure or make inside the Spike build.

CI reference

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.

Notes

  • 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 documents check-cfg for that case on current branches.

How to Run

Fuzzing test on develop branch:

bash run.sh develop

Fuzzing test on release branch:

bash run.sh release-0.24

For a shorter run, pass fast as the second argument (see run.sh):

bash run.sh develop fast

The first argument is the ckb-vm Git branch or tag passed to git clone --branch, not a branch of this repository.

Corpus

After running any fuzzing tests, all corpus should be compacted via:

bash cmin.sh

Then commit the corpus changes for future use.

About

CKB-VM fuzzing test script, corpus.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages