Skip to content

Commit

Permalink
[brpc] ideal integration (#11531)
Browse files Browse the repository at this point in the history
Base PR apache/brpc#2420 ;

NOTE:
I can't enable memory sanitizer due to

```log
BAD BUILD: /tmp/not-out/tmpmptlk01q/fuzz_esp seems to have either startup crash or exit:
/tmp/not-out/tmpmptlk01q/fuzz_esp -rss_limit_mb=2560 -timeout=25 -seed=1337 -runs=4 < /dev/null
Uninitialized bytes in MemcmpInterceptorCommon at offset 15 inside [0x7030000000f0, 19)
==428==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x682b90 in __interceptor_memcmp /src/llvm-project/compiler-rt/lib/msan/../sanitizer_common/sanitizer_common_interceptors.inc:892:10
    #1 0x7fa8ef4cf62a in google::protobuf::SimpleDescriptorDatabase::DescriptorIndex<std::pair<void const*, int> >::FindLastLessOrEqual(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (/tmp/not-out/tmpmptlk01q/lib/libprotobuf.so.17+0x15062a) (BuildId: 64affeb0f489ae4bcea211ed99e1eca15ff97d68)
    #2 0x7fa8ef4d259f in google::protobuf::SimpleDescriptorDatabase::DescriptorIndex<std::pair<void const*, int> >::AddSymbol(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::pair<void const*, int>) (/tmp/not-out/tmpmptlk01q/lib/libprotobuf.so.17+0x15359f) (BuildId: 64affeb0f489ae4bcea211ed99e1eca15ff97d68)
    #3 0x7fa8ef4d2a15 in google::protobuf::SimpleDescriptorDatabase::DescriptorIndex<std::pair<void const*, int> >::AddFile(google::protobuf::FileDescriptorProto const&, std::pair<void const*, int>) (/tmp/not-out/tmpmptlk01q/lib/libprotobuf.so.17+0x153a15) (BuildId: 64affeb0f489ae4bcea211ed99e1eca15ff97d68)
    #4 0x7fa8ef4cebef in google::protobuf::EncodedDescriptorDatabase::Add(void const*, int) (/tmp/not-out/tmpmptlk01q/lib/libprotobuf.so.17+0x14fbef) (BuildId: 64affeb0f489ae4bcea211ed99e1eca15ff97d68)
    #5 0x7fa8ef499f43 in google::protobuf::DescriptorPool::InternalAddGeneratedFile(void const*, int) (/tmp/not-out/tmpmptlk01q/lib/libprotobuf.so.17+0x11af43) (BuildId: 64affeb0f489ae4bcea211ed99e1eca15ff97d68)
    #6 0x7fa8ef49281d in protobuf_google_2fprotobuf_2fapi_2eproto::AddDescriptorsImpl() (/tmp/not-out/tmpmptlk01q/lib/libprotobuf.so.17+0x11381d) (BuildId: 64affeb0f489ae4bcea211ed99e1eca15ff97d68)
```

Signed-off-by: Arjun Singh <[email protected]>
  • Loading branch information
0x34d authored Jan 24, 2024
1 parent 63c3fd3 commit 8a52684
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 154 deletions.
30 changes: 0 additions & 30 deletions projects/brpc/CMakeLists.txt.patch

This file was deleted.

8 changes: 2 additions & 6 deletions projects/brpc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
################################################################################
FROM gcr.io/oss-fuzz-base/base-builder
RUN apt-get update && apt-get install -y cmake libgflags-dev libprotobuf-dev libprotoc-dev protobuf-compiler libleveldb-dev libgtest-dev libgoogle-perftools-dev libsnappy-dev
RUN git clone --depth 1 https://github.com/apache/incubator-brpc brpc
RUN git clone https://github.com/0x34d/oss-fuzz-bloat
COPY build.sh $SRC/
COPY Fuzz_http.cpp $SRC/brpc/test/Fuzz_http.cpp
COPY Fuzz_json.cpp $SRC/brpc/test/Fuzz_json.cpp
COPY CMakeLists.txt.patch $SRC/brpc/test/CMakeLists.txt.patch
RUN git clone --depth 1 https://github.com/apache/brpc.git
RUN cp $SRC/brpc/test/fuzzing/oss-fuzz.sh $SRC/build.sh
WORKDIR $SRC/brpc/
33 changes: 0 additions & 33 deletions projects/brpc/Fuzz_http.cpp

This file was deleted.

35 changes: 0 additions & 35 deletions projects/brpc/Fuzz_json.cpp

This file was deleted.

49 changes: 0 additions & 49 deletions projects/brpc/build.sh

This file was deleted.

3 changes: 2 additions & 1 deletion projects/brpc/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ fuzzing_engines:
- honggfuzz
sanitizers:
- address
main_repo: 'https://github.com/apache/incubator-brpc'
- undefined
main_repo: "https://github.com/apache/incubator-brpc"

0 comments on commit 8a52684

Please sign in to comment.