Heuristic:0sec labs 0 AFL Version Skew
| Knowledge Sources | |
|---|---|
| Domains | Fuzzing, Debugging, Binary_Analysis |
| Last Updated | 2026-10-30 00:00 GMT |
Overview
afl-fuzz and afl-qemu-trace MUST be the same AFLplusplus version — version skew causes a fork-server deadlock, not an error message.
Description
When `afl-fuzz` and `afl-qemu-trace` are from different AFLplusplus versions, the failure is a silent deadlock rather than a visible error. For example, AFL++ 4.09c terminates the fork server with SIGTERM, while an older `afl-compiler-rt` has an `at_exit` of `kill(child_pid,9); ret` with no `_exit`, so the server survives and `afl-fuzz` blocks forever in `waitpid`. This is extremely hard to diagnose because there is no error message — the process simply hangs.
Usage
Apply this heuristic whenever setting up or debugging AFL++ QEMU-mode fuzzing. Also apply it when AFL++ appears to hang with no output — check version alignment before investigating other causes.
The Insight (Rule of Thumb)
- Action: Verify `afl-fuzz --version` and `afl-qemu-trace --version` match before any fuzzing run.
- Value: Exact version match — even minor version differences can cause the deadlock.
- Trade-off: Building `afl-qemu-trace` from source (instead of using OS packages) takes longer but guarantees version alignment.
- Ubuntu package trap: The Ubuntu `afl++` package does NOT ship `afl-qemu-trace` — it must be built from `qemu_mode/build_qemu_support.sh`.
- Clone depth: Clone qemuafl full, not shallow. `build_qemu_support.sh` runs `git checkout $(cat QEMUAFL_VERSION)` which on a shallow clone degrades to a warning plus master HEAD — reintroducing the skew silently.
Reasoning
The deadlock arises from ABI/protocol mismatches between the fork server implementation in different AFL++ versions. The fork server is a small protocol where the fuzzer and the forked child exchange status bytes over a pipe. When the versions disagree on the protocol (e.g., one version sends SIGTERM while the other expects a clean `_exit`), the child process survives termination and the parent blocks in `waitpid` forever. This cost a full day of debugging twice in the 0verse project.