-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Use FMT_THROW in fuzzing build mode #1650
Conversation
Signed-off-by: Asra Ali <asraa@google.com>
Thanks for the PR. Could you elaborate why this is needed? The {fmt}'s fuzz tests are always run with exceptions enabled in oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/list?colspec=ID%20Type%20Component%20Status%20Proj%20Reported%20Owner%20Summary&q=proj%3Dlibfmt&can=1 |
Thanks! We have projects (Envoy, and others) that depend on fmt which are built with no exception mode, and are also fuzzed. These project's fuzz targets cannot build with the same production fmt lib dependency with exceptions disabled. Ideally, those project's fuzzers should model their production environment, they do not expect throws in their dependency. |
I think a better fix would be to replace Line 309 in 9dde9f0
|
Thank you, that would work well for us! I will update the PR and fuzzing README to reflect that. |
Signed-off-by: Asra Ali <asraa@google.com>
Is |
Sorry about that -- I mixed up the macros. I tested the fuzz targets in this branch and in master branch and didn't hit any OOMs at least while running |
Both master and this branch start around 100k+ exec/sec, but my branch will go down to 40k sometimes. Any idea why that's happening? |
Looks good but please
Not sure. |
Signed-off-by: Asra Ali <asraa@google.com>
Done -- retested and the fuzzer now maintains 100k+ speed, I wonder if the warnings were slowing it down? Thank you! |
Thank you! |
Fixes fuzz crashes in fmt::format (https://github.com/fmtlib/fmt/blob/0463665ef136d685fe07a564d93c782456456d3d/include/fmt/format.h#L703) on certain invalid protobuf inputs. fmt is patches with PR (fmtlib/fmt#1650) that replaces the in-house fuzzing resource management to an fmt specific fuzzing macro. Additional Description: The regression test added shows that the proto in question is not unreasonably huge for Envoy. This is causing a high unexplained crash percentage for many fuzz tests on OSS-Fuzz. Also bump fmt. Testing: Added regression test in server fuzz test, failed bazel test test/server:server_fuzz_test --copt=-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION before Related: #9623 Risk level: Low Signed-off-by: Asra Ali <asraa@google.com>
Make code properly build in fuzz mode with clang/gcc when
-fno-exceptions
is specified by usingFMT_THROW
in format files when building with FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION.Signed-off-by: Asra Ali asraa@google.com
I agree that my contributions are licensed under the {fmt} license, and agree to future changes to the licensing.