Github user jdanekrh commented on a diff in the pull request:

    https://github.com/apache/qpid-proton/pull/95#discussion_r102984140
  
    --- Diff: proton-c/src/tests/fuzz/README.md ---
    @@ -0,0 +1,45 @@
    +# Fuzz testing for qpid-proton-c
    +
    +## Dockerfile
    +
    +Easiest way to build and run the fuzzing is using attached Dockerfile. Run 
the following command from the top project directory
    +
    +    docker build -t -f .
    +
    +## Building
    +
    +### with libFuzzer
    +
    +1. Download and compile libFuzzer. Use http://llvm.org/docs/LibFuzzer.html 
for detailed instructions.
    +2. Rename libFuzzer.a (from previous step) to `libFuzzingEngine.a`
    +3. Build qpid-proton with the following configuration
    +  * set `CC` and `CXX` variables to the same compiler you used to build 
libFuzzer (some recent clang)
    +  * set `CFLAGS` and `CXXFLAGS` with the coverage and sanitizer(s) you 
want to use, see libFuzzer documentation for details
    +  * set `LDFLAGS` to add the directory with `libFuzzingEngine.a` to your 
link path if necessary
    +  * set `FUZZ_TEST=ON`
    +
    +For example:
    +
    +    FLAGS="-fsanitize-coverage=trace-pc-guard -fsanitize=address 
-fno-omit-frame-pointer -fno-optimize-sibling-calls"
    +    
    +    CC=~/Work/third_party/llvm-build/Release+Asserts/bin/clang \
    +    CXX=~/Work/third_party/llvm-build/Release+Asserts/bin/clang++ \
    +    CFLAGS="$FLAGS" \
    +    CXXFLAGS="$FLAGS" \
    +    LDFLAGS="-L/path/to/LibFuzzingEngine/directory" \
    +    cmake -DCMAKE_BUILD_TYPE=Debug -DFUZZ_TEST=ON ..
    +
    +### with afl-fuzz
    --- End diff --
    
    and different compiler options, presumably. Anyways, I have to have a 
separate doc explaining where to get afl-fuzz and what compiler flags to use. 
This is intended for local debugging. (Although I suppose running remote gdb in 
a docker container is workable...)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to