aboutsummaryrefslogtreecommitdiff
path: root/bazel/fuzz_target.bzl
diff options
context:
space:
mode:
authorFabian Meumertzheim <meumertzheim@code-intelligence.com>2021-03-19 14:26:02 +0100
committerFabian Meumertzheim <fabian@meumertzhe.im>2021-03-22 15:05:37 +0100
commitc95ecbf9db8263eea620384666ee724fa75b1b1b (patch)
treedfa557a023d1413799c24dbd1373d8c42c2ee8bb /bazel/fuzz_target.bzl
parent70487525453c60e755bd7b18bc591c9c084d4fdf (diff)
downloadjazzer-api-c95ecbf9db8263eea620384666ee724fa75b1b1b.tar.gz
Do not intercept JVM-internal C stdlib calls
The JVM frequently calls strcmp/memcmp/..., which fills up the table of recent compares with entries that are either duplicates of values already reported by the bytecode instrumentation or JDK-internal strings that are not relevant for fuzzing. This commit adds an ignorelist to the C stdlib interceptors that filters out calls from known JVM libraries. If the fuzz target has not yet loaded a native library, all such callbacks are ignored, which greatly improves fuzzer performance for string-heavy targets. E.g., JsonSanitizerDenylistFuzzer takes < 1 million runs now when it used to take over 3 million.
Diffstat (limited to 'bazel/fuzz_target.bzl')
-rw-r--r--bazel/fuzz_target.bzl1
1 files changed, 1 insertions, 0 deletions
diff --git a/bazel/fuzz_target.bzl b/bazel/fuzz_target.bzl
index 9a18bdfd..9f2fe2d5 100644
--- a/bazel/fuzz_target.bzl
+++ b/bazel/fuzz_target.bzl
@@ -32,6 +32,7 @@ def java_fuzz_target_test(
]
if hook_classes:
deploy_manifest_lines.append("Jazzer-Hook-Classes: %s" % ":".join(hook_classes))
+
# Deps can only be specified on java_binary targets with sources, which
# excludes e.g. Kotlin libraries wrapped into java_binary via runtime_deps.
target_deps = deps + ["//agent/src/main/java/com/code_intelligence/jazzer/api"] if srcs else []