2.3 从源码安装

克隆 afl.rs 并安装 cargo-afl

译文 · 基于 Rust Fuzz Book

从源码安装

原文链接: https://rust-fuzz.github.io/book/afl/installing-from-source.html

首先克隆 afl.rs:

1
2
git clone https://github.com/rust-fuzz/afl.rs
cd afl.rs

接着检出 afl.rs 的子模块(AFL++)。注意不需要 --recursive。

1
git submodule update --init

最后安装 cargo-afl:

1
cargo install --path cargo-afl

故障排除

若 cargo-afl 发生 panic,可尝试使用 --debug 安装,并以 RUST_BACKTRACE=1 运行 cargo-afl,例如:

1
2
3
cargo install --path cargo-afl --debug
...
RUST_BACKTRACE=1 cargo afl ...

向 cargo install 添加 --debug 可使 cargo-afl 产生更详细的回溯信息。

最后修改 August 23, 2026: 更新 (499855b16)