-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Missing asan_blacklist.txt when building via Bazel #3093
Comments
Also Envoy is failing with the same error too:
https://oss-fuzz-build-logs.storage.googleapis.com/index.html#envoy |
Thanks for opening the issue! I also tried downgrading my bazel version and retrying the docker build with no success. I also tried checkout oss-fuzz before clang was pulled from git recently, and that didn't help. Did you try those as well? |
I tried rebuilding the docker too.
with a local
|
I've just read through https://github.com/llvm/llvm-project/blob/master/clang/lib/Driver/SanitizerArgs.cpp and I don't see a way not to use the default sanitizer blacklist (which makes sense, sanitizers might become useless without those). So, looks like we need to find a solution in Bazel. Do you know any other project that uses the same version of Bazel and builds targets with ASan? |
I did some searching through the github for projects using bazel and their OSS-Fuzz build logs failing with similar errors, and caught Envoy (us), Oak (Ivan), gRPC. Tensorflow also uses bazel but I think has a different failure. Weirdly enough, I modified our build script to use bazel 1.1.0 (instead of 1.2.0, and this is what we use upstream too) as well and still hit the failure. I'll try again. |
Sanity check: did you re-build the project image after downgrading the bazel version? |
Yep, I ran with bazel-1.1.0 build |
Is everyone having trouble only with external bazel libraries? I have gotten the missing asan_blacklist from |
I don't think downgrading Bazel would be sufficient; Bazel ends up invoking clang installed on the base image (via che CC and CXX env variables), so we would have to downgrade clang or the image to revert to the old behaviour. |
Oooh, so this started to occur exactly after we've landed #3060. I am sorry for the breakage then, we must be building something differently now. //cc @jonathanmetzman |
@ipetr0v could you rename this issue to something that can be discovered and referenced more easily, e.g. "missing asan_blacklist.txt when building via bazel"? |
My guess is that #3060 also caused a different version of clang to be built. In particular, I don't see how the particular version of clang gets pinned. It seems to me that whenever the docker image is rebuilt, the latest version will be pulled, which is usually not a good practice, as it will cause breakages when dependencies change. |
We don't build the latest clang. We (with rare exceptions) build the version of clang used by Chromium. There is a team in Chromium dedicated towards ensuring that new versions of clang they uptake are stable. This approach balances stability with getting the latest features and bug fixes. |
I am not aware of any changes in LLVM upstream. |
Is the Bazel version not pinned? |
To answer my own question: we actually don't pin the Bazel version, at least in the oss-fuzz/projects/oak/Dockerfile Lines 22 to 25 in 131f4c5
so it's possible in principle that something in Bazel has changed. @ipetr0v could you see what it takes to pin our Docker image to a specific Bazel version? We could do something similar to edit: actually for now we can probably just specify the version in this way: https://docs.bazel.build/versions/master/install-ubuntu.html#step-2-install-and-update-bazel . It is not as strong as the self-downloaded and hashed deb file, but it's sufficient for us. |
FWIW the grpc project[1] uses a bazel version via a wrapper in grpc repo, which [2] pins the bazel version to 1.0.0. This pinning happened before we started to see this issue. [1] oss-fuzz/projects/grpc/build.sh Line 70 in 131f4c5
[2] https://github.com/grpc/grpc/blob/c9378dff8551ba863e607feaa49e03005ce2618b/tools/bazel#L35 |
Do we agree that #3060 is what caused the issue though? It seems that before #3060 the script was downloading clang via SVN at revision 359254, and after #3060 it downloads it from git at commit e84b7a5fe230e42b8e6fe451369874a773bf1867, though there is some logic around it to control the actual version that gets downloaded, which I don't fully understand. FWIW it still seems to me that the pinned version changed, either in that script, or from the version that Chrome pins. oss-fuzz/infra/base-images/base-clang/checkout_build_install_llvm.sh Lines 50 to 68 in 131f4c5
|
FWIW, Envoy does pin Bazel version via Bazelisk, see https://github.com/envoyproxy/envoy/blob/master/.bazelversion |
I don't think we do in our OSS-Fuzz though. We download the latest bazel right from apt in the Dockerfile, and then build with that. I tried to revert before #3060 and it still didn't work, but I'll try again with a clean build and double check what version of clang i'm using. I'm not discounting it's something with rules_foreign_cc or something similar. |
I don't think this will "just work". I think you would need to revert, and then build base-clang ( |
Yep, it didn't work again. I see. I've been running |
OK so I was able to confirm rolling back to the old clang allows envoy to build. |
When I revert the patches in https://github.com/llvm/llvm-project/commits/master/clang/lib/Driver/SanitizerArgs.cpp and rebuild clang I get this error when trying to build envoy instead:
Frankly I don't understand enough about bazel to know what's going on here. |
Okay I was able to get it building if I install clang rather than just using it from somewhere on disk. |
@dslomov we're having an issue with finding asan_blacklist.txt dependency when building with bazel. Seems like some patches in clang SanitizerArgs.cpp might have caused them. If there's any help from the bazel side, here's our tracking issue. |
llvm/llvm-project@03b84e4#diff-e2fe4c5daa679eec2fe3bad655f14dc0 looks the most suspicious @jonathanmetzman is it hard for you to revert that single patch and try again? |
Comment from Pete Collingbourne, when i suggested reverting the patch
So I think this needs to be bazel folks that fix this. Let's file an issue in their repo if we don't see any movement on this bug. |
Thank you so much for fixing the build for now! I'll pass along the info to Dmitry and anyone else I know at bazel, and see if they can help out. |
This issue is now affecting some Chrome OS fuzzer as well: https://bugs.chromium.org/p/chromium/issues/detail?id=1042874 Does anyone want to take a stab at removing that default blacklist in LLVM upstream? |
Rather than LLVM upstream, maybe the fix is in bazel? From this PR it looks like |
If fix in bazel is possible, that it's 100% the best :) |
Just to circle back on this, the fix is in bazel, and we tested it against the oss-fuzz envoy build and it succeeds now :) |
And a question -- would it be possible to generate a coverage report (locally, even) while we have this issue? Coverage reports fail because the clang versions differ, and I'm wondering if it's possible to change the sha's of the base-clang and base-runners to run coverage. Thank you! |
Sorry I don't really understand the question. |
Cross-FYI bazel 3.0 is released and contains the fix. https://github.com/bazelbuild/bazel/releases/tag/3.0.0 |
No need for workaround since ESPv2 was updated to Bazel 3.0.0 Ref: google#3093 Signed-off-by: Teju Nareddy <nareddyt@google.com>
No need for workaround since ESPv2 was updated to Bazel 3.0.0 Ref: #3093 Signed-off-by: Teju Nareddy <nareddyt@google.com>
Building with RBE will require upgrading to Bazel 3.0+ because of google/oss-fuzz#3093. TF is already on 3.1.0, so we should probably upgrade anyway. Tested: `bazel test --config=rs --config=asan //iree/...` Two vulkan failures: https://source.cloud.google.com/results/invocations/fa1c4e13-305e-4467-aac5-97773a0ecf57 Reverted the type registration added to fix a leak in dde06c0 and confirmed an asan failure `bazel test --config=rs --config=asan //iree/vm:list_test` https://source.cloud.google.com/results/invocations/7dfc3bcc-b837-4139-9649-f4156dd782bf
As discussed here (google/oss-fuzz#3093), clang was updated to include the sanitizer ignorelist within the `.D`. This causes bazel to look for those files within the dependency list, so this directory has to be added to the default include path for bazel to not complain while running sanitizers with clang. PiperOrigin-RevId: 493939307
As discussed here (google/oss-fuzz#3093), clang was updated to include the sanitizer ignorelist within the `.D`. This causes bazel to look for those files within the dependency list, so this directory has to be added to the default include path for bazel to not complain while running sanitizers with clang. PiperOrigin-RevId: 493939307
As discussed here (google/oss-fuzz#3093), clang was updated to include the sanitizer ignorelist within the `.D`. This causes bazel to look for those files within the dependency list, so this directory has to be added to the default include path for bazel to not complain while running sanitizers with clang. PiperOrigin-RevId: 493939307
We have the following error in the fuzz build:
https://oss-fuzz-build-logs.storage.googleapis.com/index.html#oak
And each time we run fuzzing - the library that causes the problem randomly changes.
I have found a flag, that causes this behavior:
I get this error even after
bazel clean --expunge
.It seems that the address sanitizer implicitly adds a dependency on
/usr/local/lib/clang/10.0.0/share/asan_blacklist.txt
in every compiled file (even external ones). And Bazel could not compile targets because all dependencies should be explicitly included inBUILD
files.Another project that has the same issue is gRPC:
https://oss-fuzz-build-logs.storage.googleapis.com/index.html#grpc
cc @tiziano88 @yang-g @Dor1s
More information on the issue: project-oak/oak#349
The text was updated successfully, but these errors were encountered: