From e4da5a4bcaf2fb5f634ef6b0fc345b0a4159fbca Mon Sep 17 00:00:00 2001 From: Abhishek Arya Date: Thu, 5 Jan 2017 23:34:57 -0800 Subject: [PATCH] Update reproducing.md --- docs/reproducing.md | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/docs/reproducing.md b/docs/reproducing.md index cb565f0fc..c665b0880 100644 --- a/docs/reproducing.md +++ b/docs/reproducing.md @@ -13,9 +13,9 @@ This file contains the bytes that were fed to the [Fuzz Target](http://libfuzzer If you have already [integrated](ideal_integration.md) the fuzz target with your build and test system, all you do is run: -
-./fuzz_target_binary <testcase_path>
-
+```bash +$ ./fuzz_target_binary +``` If this is a timeout bug, add the -timeout=25 argument.
If this is an OOM bug, add the -rss_limit_mb=2048 argument.
@@ -30,25 +30,26 @@ to replicate the exact build steps used by OSS-Fuzz and then feed the reproducer - *Reproduce using latest OSS-Fuzz build:* -
-   python infra/helper.py reproduce $PROJECT_NAME <fuzzer_name> <testcase_path>
-   
+```bash +$ python infra/helper.py reproduce $PROJECT_NAME +``` It builds the fuzzer from the most recent successful OSS-Fuzz build (usually last night's sources) and feeds the testcase file to the target function. E.g. for [libxml2](../projects/libxml2) project with fuzzer named `libxml2_xml_read_memory_fuzzer`, it will be: - -
-python infra/helper.py reproduce libxml2 libxml2_xml_read_memory_fuzzer ~/Downloads/testcase
-   
+ +```bash +$ python infra/helper.py reproduce libxml2 libxml2_xml_read_memory_fuzzer ~/Downloads/testcase +``` + - *Reproduce using local source checkout:* -
-python infra/helper.py build_fuzzers $PROJECT_NAME <source_path>
-python infra/helper.py reproduce $PROJECT_NAME <fuzzer_name> <testcase_path>
-    
- +```bash +$ python infra/helper.py build_fuzzers $PROJECT_NAME +$ python infra/helper.py reproduce $PROJECT_NAME +``` + This is essentially the previous command that additionally mounts local sources into the running container. - *Fix issue*. Write a patch to fix the issue in your local checkout and then use the previous command to verify the fix (i.e. no crash occurred). [Use gdb](debugging.md#debugging-fuzzers-with-gdb) if needed.