Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commands in OSSFuzz README for building the fuzzer are incomplete #15068

Open
haoyang9804 opened this issue Apr 30, 2024 · 3 comments
Open

Commands in OSSFuzz README for building the fuzzer are incomplete #15068

haoyang9804 opened this issue Apr 30, 2024 · 3 comments

Comments

@haoyang9804
Copy link

Check the following command in OSSFuzz's readme:

## Docker shell
$ cd /src/solidity
$ rm -rf fuzzer-build && mkdir fuzzer-build && cd fuzzer-build
## Compile protobuf C++ bindings
$ protoc --proto_path=../test/tools/ossfuzz yulProto.proto --cpp_out=../test/tools/ossfuzz
$ protoc --proto_path=../test/tools/ossfuzz abiV2Proto.proto --cpp_out=../test/tools/ossfuzz
## Run cmake
$ export CC=clang CXX=clang++
$ cmake -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/libfuzzer.cmake -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Release} ..
$ make ossfuzz ossfuzz_proto ossfuzz_abiv2 -j

There should be another protoc command for generating solProto.pb.cc and solProto.pb.h, otherwise the subsequent cmake will fail.
This is the correct command set:

## Docker shell
$ cd /src/solidity
$ rm -rf fuzzer-build && mkdir fuzzer-build && cd fuzzer-build
## Compile protobuf C++ bindings
$ protoc --proto_path=../test/tools/ossfuzz yulProto.proto --cpp_out=../test/tools/ossfuzz
$ protoc --proto_path=../test/tools/ossfuzz abiV2Proto.proto --cpp_out=../test/tools/ossfuzz
$ protoc --proto_path=../test/tools/ossfuzz solProto.proto --cpp_out=../test/tools/ossfuzz
## Run cmake
$ export CC=clang CXX=clang++
$ cmake -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/libfuzzer.cmake -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Release} ..
$ make ossfuzz ossfuzz_proto ossfuzz_abiv2 -j
@haoyang9804 haoyang9804 changed the title Commands in OSSFuzz README for building the fuzzer is incomplete Commands in OSSFuzz README for building the fuzzer are incomplete Apr 30, 2024
@bshastry
Copy link
Contributor

bshastry commented May 13, 2024

Thanks for pointing out! You are right. Would you be interested in contributing the solution in the post above as a PR? I would be happy to review and help get it merged 🙏

@haoyang9804
Copy link
Author

Thanks for pointing out! You are right. Would you be interested in contributing the solution in the post above as a PR? I would be happy to review and help get it merged 🙏

No problem. I'll submit a pr in the next few days.

@haoyang9804
Copy link
Author

I have posted a PR here: #15119

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants