fuzz: fix filesystem bug, use std::__fs::filesystem#7507
Merged
htuch merged 5 commits intoenvoyproxy:masterfrom Jul 10, 2019
Merged
fuzz: fix filesystem bug, use std::__fs::filesystem#7507htuch merged 5 commits intoenvoyproxy:masterfrom
htuch merged 5 commits intoenvoyproxy:masterfrom
Conversation
…lesystem is not available Signed-off-by: Asra Ali <asraa@google.com>
Signed-off-by: Asra Ali <asraa@google.com>
htuch
reviewed
Jul 9, 2019
| #ifdef __cpp_lib_filesystem | ||
| std::filesystem::create_directories(dirname); | ||
| #if defined(_LIBCPP_VERSION) && TEST_STD_VER < 17 && !defined(__APPLE__) | ||
| std::__fs::filesystem::create_directories(dirname); |
Member
There was a problem hiding this comment.
What happens if someone is building under a C++17 compiler option? Do they just fallback to mkdir rather than the std::filesystem implementation? Should Envoy build cleanly under C++17 (even if we are only using C++14 features)?
Contributor
Author
There was a problem hiding this comment.
Hmm. Actually, that branch should be good for C++17, they shouldn't fall back to mkdir. Will update / recheck.
http://clang-developers.42468.n3.nabble.com/Filesystem-has-Landed-in-Libc-td4061350.html
Signed-off-by: Asra Ali <asraa@google.com>
htuch
reviewed
Jul 9, 2019
| load("//bazel:repositories.bzl", "GO_VERSION", "envoy_dependencies") | ||
| load("//bazel:cc_configure.bzl", "cc_configure") | ||
|
|
||
| envoy_dependencies() |
Member
There was a problem hiding this comment.
You probably didn't want this one. Also, format needs fixing.
Contributor
Author
There was a problem hiding this comment.
Thanks for catching that, should be good now.
Signed-off-by: Asra Ali <asraa@google.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since OSS-Fuzz minijail prohibits mkdir calls, we use std::__fs::filesystem namespace which implements filesystem.
The OSS-Fuzz image was taking the mkdir branch, since neither filesystem nor experimental/filesystem was found. However, we are able to use std::__fs::filesystem branch in the OSS-Fuzz image and the std::experimental::filesystem branch locally.
Risk Level: Low
Testing: Add RELEASE_ASSERT(1==0, "") under the #if defined(_LIBCPP_VERSION) && TEST_STD_VER < 17 branch to verify that branch is taken in oss-fuzz docker. run_fuzzer with oss-fuzz docker is successful.
Fixes OSS-Fuzz issue:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=15414
Signed-off-by: Asra Ali asraa@google.com