[PATCH] D36324: Integrate Kostya's clang-proto-fuzzer with LLVM.

Matt Morehouse via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 4 09:24:20 PDT 2017


morehouse created this revision.
Herald added a subscriber: mgorny.

The clang-proto-fuzzer models a subset of C++ as a protobuf and
uses libprotobuf-mutator to generate interesting mutations of C++
programs.  Clang-proto-fuzzer has already found several bugs in
Clang (e.g., https://bugs.llvm.org/show_bug.cgi?id=33747,
https://bugs.llvm.org/show_bug.cgi?id=33749).

As with clang-fuzzer, clang-proto-fuzzer requires the following
cmake flags:

- CMAKE_C_COMPILER=clang
- CMAKE_CXX_COMPILER=clang++
- LLVM_USE_SANITIZE_COVERAGE=YES  // needed for libFuzzer
- LLVM_USE_SANITIZER=Address  // needed for libFuzzer

In addition, clang-proto-fuzzer requires:

- LLVM_ENABLE_RTTI=ON   // needed for protobuf
- CLANG_ENABLE_PROTO_FUZZER=ON

clang-proto-fuzzer also requires the following dependencies:

- binutils  // needed for libprotobuf-mutator
- liblzma-dev  // needed for libprotobuf-mutator
- libz-dev  // needed for libprotobuf-mutator
- docbook2x  // needed for libprotobuf-mutator
- Recent version of protobuf [3.3.0 is known to work]

A working version of libprotobuf-mutator will automatically be
downloaded and built as an external project.

Implementation of clang-proto-fuzzer provided by Kostya
Serebryany.


https://reviews.llvm.org/D36324

Files:
  clang/CMakeLists.txt
  clang/cmake/modules/ProtobufMutator.cmake
  clang/tools/clang-fuzzer/CMakeLists.txt
  clang/tools/clang-fuzzer/ClangFuzzer.cpp
  clang/tools/clang-fuzzer/ExampleClangProtoFuzzer.cpp
  clang/tools/clang-fuzzer/cxx_proto.proto
  clang/tools/clang-fuzzer/handle-cxx/CMakeLists.txt
  clang/tools/clang-fuzzer/handle-cxx/handle_cxx.cpp
  clang/tools/clang-fuzzer/handle-cxx/handle_cxx.h
  clang/tools/clang-fuzzer/proto-to-cxx/CMakeLists.txt
  clang/tools/clang-fuzzer/proto-to-cxx/proto_to_cxx.cpp
  clang/tools/clang-fuzzer/proto-to-cxx/proto_to_cxx.h
  clang/tools/clang-fuzzer/proto-to-cxx/proto_to_cxx_main.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36324.109761.patch
Type: text/x-patch
Size: 20497 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170804/d5463be8/attachment-0001.bin>


More information about the cfe-commits mailing list