Skip to content

Commit

Permalink
Added: Guide for fuzzing with address sanitizer.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sewer56 committed Dec 13, 2024
1 parent 52482a4 commit 55199ad
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion examples/fuzz.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,17 @@
*
* If you find a crash, consider also doing the following:
*
* clang fuzz.c ../src/libbz3.c -g3 -O3 -march=native -o fuzz_asan -I../include "-DVERSION=\"0.0.0\"" -fsanitize=undefined -fsanitize=address
* clang fuzz.c ../src/libbz3.c -g3 -O3 -march=native -o fuzz_asan -I../include "-DVERSION=\"0.0.0\"" -fsanitize=undefined -fsanitize=address
*
* And run fuzz_asan on the crashing test case (you can find it in one of the `afl_out/crashes/` folders).
* Attach the test case /and/ the output of fuzz_asan to the bug report.
*
* If no error occurs, it could be that there was a memory corruption `between` the runs.
* In which case, you want to run AFL with address sanitizer. Use `export AFL_USE_ASAN=1` to enable
* addres sanitizer; then run AFL.
*
* export AFL_USE_ASAN=1
* afl-clang-fast fuzz.c -I../include ../src/libbz3.c -o fuzz -g3 "-DVERSION=\"0.0.0\"" -O3 -march=native
*/


Expand Down

0 comments on commit 55199ad

Please sign in to comment.