Skip to content

fix: gate generate_minibsod behind LIBAFL_MINIBSOD env var#3826

Open
kx7m2qd wants to merge 3 commits into
AFLplusplus:mainfrom
kx7m2qd:fix/gate-minibsod-libfuzzer
Open

fix: gate generate_minibsod behind LIBAFL_MINIBSOD env var#3826
kx7m2qd wants to merge 3 commits into
AFLplusplus:mainfrom
kx7m2qd:fix/gate-minibsod-libfuzzer

Conversation

@kx7m2qd
Copy link
Copy Markdown

@kx7m2qd kx7m2qd commented May 12, 2026

Description

generate_minibsod() was being called unconditionally in inproc_crash_handler, producing megabytes of output (Rust backtrace, register dump, /proc/self/maps) on every target crash. This output doesn't appear in standard libFuzzer and is particularly noisy in libafl_libfuzzer_runtime compatibility mode, where ASan already provides the relevant stack trace. The Rust backtrace is especially problematic since Backtrace::force_capture() ignores RUST_BACKTRACE=0, giving users no way to suppress it.

This PR gates the generate_minibsod() calls in unix.rs and inprocess.rs behind the LIBAFL_MINIBSOD environment variable, making the full diagnostic output opt-in:

  • Default (no env var): clean output matching standard libFuzzer behaviour
  • LIBAFL_MINIBSOD=1: full minibsod output (registers, backtrace, memory maps) for debugging fuzzer internals

The crash handler in libafl_qemu/src/executor.rs was intentionally left ungated — that path fires when the fuzzer itself crashes (not the target), where the diagnostic info is genuinely useful.

Fixes #3792

Checklist

  • I have run ./scripts/precommit.sh and addressed all comments

kx7m2qd and others added 3 commits May 12, 2026 15:51
Calling generate_minibsod() unconditionally in inproc_crash_handler
produces megabytes of output (backtrace, registers, memory maps) that
doesn't appear in standard libFuzzer. This is especially noisy in
libafl_libfuzzer_runtime compatibility mode where ASan already provides
the relevant stack trace.

Gate the minibsod output behind the LIBAFL_MINIBSOD environment variable
so it is opt-in. Users who want the full diagnostic output can set
LIBAFL_MINIBSOD=1.

Fixes AFLplusplus#3792
@domenukk
Copy link
Copy Markdown
Member

So I think the env shouldn't be part of LibAFL, that's against the "Lib" part, right? IMHO it should be a simple variable that we set when creating the executor (builder/..) and then the libfuzzer shim just sets this to false, other fuzzers can chose what they want (or read an env).
Does that make sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

libafl_libfuzzer crash output is extremely verbose compared to libFuzzer

2 participants