Skip to content

UNICT-Quality-Development/fuzz-test-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fuzz test example

This repository contains the source code for a fuzz testing example.

It was created specifically for a presentation at the University of Catania, and is accompanied by slides used during the event.

Build the source

mkdir build
cd build
cmake .. -DCMAKE_CXX_COMPILER=clang++
cmake --build . -- -j$(nproc)

Run unit tests

cd build
./math_utils_test

Run fuzz test and read crash dump

timeout 30 ./fuzz_math_utils || echo "Fuzz test crashed or timed out"

There are multiple ways to read the crashdump, I strongly recommend hexdump.

# read full crash dump
hexdump crash-123456789

# read crash dump and convert hex values to decimal
hexdump -v -e '"%d, "' -e '8/1 "0x%02x, " "\n"' crash-123456789
# read crash dump via xxd
xxd crash-123456789
# read crash dump via gdb and print the a,b values (partially)
gdb ./fuzz_math_utils
run < ./crash-123456789
print a
print b

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published