Comments (5)
I agree we should do something like this, but not sure how.
Your 3 variants all look sane, the first one is better, if we can implement it.
Before coming up with a 'final' interface I'd like to have 2-3 examples in this repo using the existing (verbose) interface.
One question: what headers are we going to require?
Obviously, we will need #include "myproto.pb.h"
, but what else?
I don't want to require any headers from libFuzzer.
And if possible not even from libprotobuf-mutator
use data+size as input
did you meanuse proto as input
?
from libprotobuf-mutator.
I don't know if not including mutator header is feasible. We discussed this at length and we didn't find a way to discover function with unknown signature.
But this brings a related question to my mind: maybe we want mutator library to be header-only?
PS fixed code samples comments
from libprotobuf-mutator.
maybe we want mutator library to be header-only?
That's possible and might be a part of solution.
But then again, what if we want to use some other proto mutation tool?
I don't know if not including mutator header is feasible.
Well, at the very least we can use the -i compiler flag to include something under the hood for cases were we control the build system.
Anyway, let's not rush here. With more proto fuzz targets a better understanding may come.
from libprotobuf-mutator.
We should not use header only, as it will force us to compile and instrument mutator together with fuzz target.
If we want to avoid headers at all, we can go with:
extern "C" google::protobuf::Message* LLVMFuzzerGetDefaultProto() {
return MyProto::default_instance();
}
extern "C" int LLVMFuzzerTestProto(google::protobuf::Message& message) {
const MyProto& my_message = static_cast<const MyProto&>(message);
....
return 0;
}
So user will have to cast.
If we allow some small header, I'd go with
void SomeTestCode(const MyProto& message) {
}
protobuf_mutator::libfuzzer::TextFuzzer<MyProto> fuzzer(&SomeTestCode); // or just lambda
Which can be reduced to macro, like in the first comment:
LLVM_FUZZER_PROTO(const MyProto& proto) {
}
from libprotobuf-mutator.
Fixed with #63
from libprotobuf-mutator.
Related Issues (20)
- Mutator breaks content of Any
- Ninja check failing HOT 2
- clang++ filed HOT 8
- OSS-Fuzz issue 61338 HOT 1
- OSS-Fuzz issue 61395 HOT 1
- How can I start with macos???? HOT 6
- What is a correct way to disable code coverage instrumentation?
- Ninja check failed HOT 1
- Propagate `seed` to `DEFINE_PROTO_FUZZER`
- OSS-Fuzz issue 63081 HOT 1
- Error during ninja check: no type named `string_view` in namespace `absl` HOT 1
- ninja check fails on stddef.h HOT 1
- feasibility of using libprofobuf-mutator for highly complex nested protobuf in heavy compuation program
- OSS-Fuzz issue 65416 HOT 1
- OSS-Fuzz issue 65495 HOT 1
- OSS-Fuzz issue 65497 HOT 1
- OSS-Fuzz issue 65516 HOT 1
- error: use of undeclared identifier 'absl' HOT 4
- error: use of undeclared identifier 'absl' HOT 2
- Consuming Abseil via Protobuf as transitive dependency is fragile HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libprotobuf-mutator.