Skip to content
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

Ignore JetBrains classes during instrumentation #763

Merged
merged 2 commits into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,10 @@ class RuntimeInstrumentor(
.acceptClasses(className)
.scan()
.use {
it.getClassInfo(className).resource.load()
it.getClassInfo(className)?.resource?.load() ?: run {
bertschneider marked this conversation as resolved.
Show resolved Hide resolved
Log.warn("Failed to load bytecode of class $className")
return null
}
}
val (instrumentedBytecode, duration) = measureTimedValue {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private static void applyCommonConfiguration() {
// Do not hook common IDE and JUnit classes and their dependencies.
System.setProperty("jazzer.custom_hook_excludes",
String.join(File.pathSeparator, "com.google.testing.junit.**", "com.intellij.**",
"io.github.classgraph.**", "junit.framework.**", "net.bytebuddy.**",
"org.jetbrains.**", "io.github.classgraph.**", "junit.framework.**", "net.bytebuddy.**",
"org.apiguardian.**", "org.assertj.core.**", "org.hamcrest.**", "org.junit.**",
"org.opentest4j.**", "org.mockito.**", "org.apache.maven.**", "org.gradle.**"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ private val BASE_EXCLUDED_CLASS_NAME_GLOBS = listOf(
"org.junit.**", // dependency of @FuzzTest
"org.mockito.**", // can cause instrumentation cycles
"net.bytebuddy.**", // ignore Byte Buddy, though it's probably shaded
"org.jetbrains.**", // ignore JetBrains products (coverage agent)
) + if (IS_BAZEL_COVERAGE_RUN) ADDITIONAL_EXCLUDED_NAME_GLOBS_FOR_BAZEL_COVERAGE else listOf()

class ClassNameGlobber(includes: List<String>, excludes: List<String>) {
Expand Down