From 8cb9e873a9e70b96996ca924fdd25b086e531193 Mon Sep 17 00:00:00 2001 From: whaffman Date: Sun, 19 Jan 2025 16:05:20 +0100 Subject: [PATCH] README --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..c8a433d --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# FunFail + +Funfail is a shared library that is used to simulate failures in memory allocation (malloc, calloc) and I/O operations (write, read) after a set number of uses. This can be useful for testing the robustness and error-handling capabilities of your programs. + +## Usage + +After making the shared object: + +``` +make +``` + +Copy the funfail.so to the path of the program you want to test. Preloading the funfail.so can be done using the `LD_PRELOAD` environment variable in Linux. Run your program while preloading the funfail.so and use one of the following env variables: +- MAX_MALLOC_CALLS +- MAX_CALLOC_CALLS +- MAX_WRITE_CALLS +- MAX_READ_CALLS + +Example: +``` +LD_PRELOAD=./funfail.so MAX_MALLOC_CALLS=5 ./myapp +```