diff options
author | Joshua Rogers <jrogers@opera.com> | 2021-04-02 22:23:11 +0000 |
---|---|---|
committer | Joshua Rogers <jrogers@opera.com> | 2021-04-02 22:23:11 +0000 |
commit | 920e9402a4d6101bbbed2ef7584d85a3c3de0eaa (patch) | |
tree | c8d8a258835b09099a30d9302ef0a9114a3ecae2 /docs/notes_for_asan.md | |
parent | e98cd008222aa3bfea9b696ad756163302437eb3 (diff) | |
download | afl++-920e9402a4d6101bbbed2ef7584d85a3c3de0eaa.tar.gz |
Add support for standalone leak-sanitizer, introducting the environment
variable AFL_USE_LSAN. AFL_USE_LSAN introduces the macro __AFL_CHECK_LEAK() which will check for a memory leak when the macro is run. This is especially helpful when using __AFL_LOOP(). If __AFL_LEAK_CHECK() is not used when AFL_USE_LSAN=1 is set, the leak checker will run when the program exits.
Diffstat (limited to 'docs/notes_for_asan.md')
-rw-r--r-- | docs/notes_for_asan.md | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/notes_for_asan.md b/docs/notes_for_asan.md index 2b3bc028..26f34fad 100644 --- a/docs/notes_for_asan.md +++ b/docs/notes_for_asan.md @@ -28,6 +28,13 @@ Note that ASAN is incompatible with -static, so be mindful of that. (You can also use AFL_USE_MSAN=1 to enable MSAN instead.) +When compiling with AFL_USE_LSAN, the leak sanitizer will normally run +when the program exits. In order to utilize this check at different times, +such as at the end of a loop, you may use the macro __AFL_CHECK_LEAK();. +This macro will report a crash in afl-fuzz if any memory is left leaking +at this stage. You can also use LSAN_OPTIONS and a supressions file +for more fine-tuned checking, however make sure you keep exitcode=23. + NOTE: if you run several secondary instances, only one should run the target compiled with ASAN (and UBSAN, CFISAN), the others should run the target with no sanitizers compiled in. |