fuzz: improve fuzz performance for accesslog and route#8397
fuzz: improve fuzz performance for accesslog and route#8397htuch merged 2 commits intoenvoyproxy:masterfrom
Conversation
Signed-off-by: Asra Ali <asraa@google.com>
|
/review @htuch |
| // Remove invalid characters in request/response formatters. | ||
| std::vector<AccessLog::FormatterProviderPtr> formatters = | ||
| AccessLog::AccessLogFormatParser::parse(input.format()); | ||
| AccessLog::AccessLogFormatParser::parse(replaceInvalidCharacters(input.format())); |
There was a problem hiding this comment.
Should we have PGV annotations for this rather than substitution?
There was a problem hiding this comment.
Hm, I have this PR out specifically for that purpose because I'd like to have a PGV constraints for string to not_contain a null character, I bumped it last week, but will do again.
bufbuild/protoc-gen-validate#253
Actually a lot of time is being spend replacing invalid characters across all fuzzers and it'd be nice to either have this PGV constraint, or specifically guide mutations to not contain nulls.
There was a problem hiding this comment.
Yeah, maybe remove this for now and then wait until bufbuild/protoc-gen-validate#253 lands; I agree that the PGV constraint is the right long term solution, not only for performance, but because Envoy will reject bad configs on the wire when we add these annotations to the API.
| // remove from each request and response that get routed through it. This replaces invalid | ||
| // header characters in these fields. | ||
| virtual_host = replaceInvalidHeaders<envoy::api::v2::route::VirtualHost>(virtual_host); | ||
| // Replace invalid characters from the list of domains matched to this virtual host. |
|
|
||
| // TODO(htuch): figure out how to generate via a genrule from config_impl_test the full corpus. | ||
| DEFINE_PROTO_FUZZER(const test::common::router::RouteTestCase& input) { | ||
| static NiceMock<Envoy::StreamInfo::MockStreamInfo> stream_info; |
Signed-off-by: Asra Ali <asraa@google.com>
a287c5e to
56c6a6d
Compare
|
This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
This PR includes some performance improvements to route_fuzz_test. gMock objects that are unmodified are now static (see recommendation by libFuzzer: https://llvm.org/docs/LibFuzzer.html#startup-initialization) Exec/sec on my local machine with libFuzzer: route_fuzz_test: 17 exec/sec -> 850 exec/sec Risk level: Low Signed-off-by: Asra Ali <asraa@google.com>
This PR includes some performance improvements to
route_fuzz_test.Exec/sec on my local machine with libFuzzer:
route_fuzz_test: 17 exec/sec -> 850 exec/secRisk level: Low
Signed-off-by: Asra Ali asraa@google.com