oss-fuzz: Missing asan_blacklist.txt when building via Bazel

We have the following error in the fuzz build: https://oss-fuzz-build-logs.storage.googleapis.com/index.html#oak

Step #4: ERROR: /builder/home/.cache/bazel/_bazel_root/872aac72dffae06b4e2a5b0308508d03/external/com_google_absl/absl/base/BUILD.bazel:171:1: undeclared inclusion(s) in rule '@com_google_absl//absl/base:base':
Step #4: this rule is missing dependency declarations for the following files included by 'external/com_google_absl/absl/base/internal/unscaledcycleclock.cc':
Step #4:   '/usr/local/lib/clang/10.0.0/share/asan_blacklist.txt'

And each time we run fuzzing - the library that causes the problem randomly changes.

I have found a flag, that causes this behavior:

$ bazel build --cxxopt=-fsanitize=address //oak/server:wasm_node
INFO: Analyzed target //oak/server:wasm_node (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /root/.cache/bazel/_bazel_root/872aac72dffae06b4e2a5b0308508d03/external/com_google_absl/absl/numeric/BUILD.bazel:27:1: undeclared inclusion(s) in rule '@com_google_absl//absl/numeric:int128':
this rule is missing dependency declarations for the following files included by 'external/com_google_absl/absl/numeric/int128.cc':
  '/usr/local/lib/clang/10.0.0/share/asan_blacklist.txt'
Target //oak/server:wasm_node failed to build

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 in BUILD 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: https://github.com/project-oak/oak/issues/349

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 40 (40 by maintainers)

Commits related to this issue

Most upvoted comments

Cross-FYI bazel 3.0 is released and contains the fix. https://github.com/bazelbuild/bazel/releases/tag/3.0.0 I’m updating upstream project first so I don’t revert the clang version workaround and break our build.