Giter Site home page Giter Site logo

codeintelligencetesting / jazzer Goto Github PK

View Code? Open in Web Editor NEW
928.0 25.0 123.0 4.85 MB

Coverage-guided, in-process fuzzing for the JVM

Home Page: https://code-intelligence.com

License: Apache License 2.0

Starlark 8.77% Kotlin 9.74% Java 73.00% Shell 1.17% C++ 6.03% Dockerfile 0.14% C 1.14%
fuzzing java fuzzer jvm security kotlin clojure jni

jazzer's Introduction

Jazzer by Code Intelligence

Jazzer

Fuzz Testing for the JVM

Releases Maven Central CI status License PRs welcome

Website | Blog | Twitter

Important

Hello Jazzer/Jazzer.js users!

We stopped maintaining Jazzer/Jazzer.js as open source. But we'd be happy to try and understand what you're trying to achieve with it, and help you if we can!

We already added significant new value to our CI Fuzz solution, which includes Jazzer and Jazzer.js. You can see more here at code-intelligence.com, or get in contact with us via [email protected]

Thanks,

The Code Intelligence team

Jazzer is a coverage-guided, in-process fuzzer for the JVM platform developed by Code Intelligence. It is based on libFuzzer and brings many of its instrumentation-powered mutation features to the JVM.

Jazzer currently supports the following platforms:

  • Linux x86_64
  • macOS 12+ x86_64 & arm64
  • Windows x86_64

Quick start

You can use Docker to try out Jazzer's Autofuzz mode, in which it automatically generates arguments to a given Java function and reports unexpected exceptions and detected security issues:

docker run -it cifuzz/jazzer-autofuzz \
   com.mikesamuel:json-sanitizer:1.2.0 \
   com.google.json.JsonSanitizer::sanitize \
   --autofuzz_ignore=java.lang.ArrayIndexOutOfBoundsException

Here, the first two arguments are the Maven coordinates of the Java library and the fully qualified name of the Java function to be fuzzed in "method reference" form. The optional --autofuzz_ignore flag takes a list of uncaught exception classes to ignore.

After a few seconds, Jazzer should trigger an AssertionError, reproducing a bug it found in this library that has since been fixed.

Using Jazzer via...

JUnit 5

The following steps assume that JUnit 5.9.0 or higher is set up for your project, for example based on the official junit5-samples.

  1. Add a dependency on com.code-intelligence:jazzer-junit:<latest version>. All Jazzer Maven artifacts are signed with this key.
  2. Add a new fuzz test to a new or existing test class: a method annotated with @FuzzTest and at least one parameter. Using a single parameter of type FuzzedDataProvider, which provides utility functions to produce commonly used Java values, or byte[] is recommended for optimal performance and reproducibility of findings.
  3. Assuming your test class is called com.example.MyFuzzTests, create the inputs directory src/test/resources/com/example/MyFuzzTestsInputs.
  4. Run a fuzz test with the environment variable JAZZER_FUZZ set to 1 to let the fuzzer rapidly try new sets of arguments. If the fuzzer finds arguments that make your fuzz test fail or even trigger a security issue, it will store them in the inputs directory. In this mode, only a single fuzz test is executed per test run (see #599 for details).
  5. Run the fuzz test without JAZZER_FUZZ set to execute it only on the inputs in the inputs directory. This mode, which behaves just like a traditional unit test, ensures that issues previously found by the fuzzer remain fixed and can also be used to debug the fuzz test on individual inputs.

A simple property-based fuzz test could look like this (excluding imports):

class ParserTests {
   @Test
   void unitTest() {
      assertEquals("foobar", SomeScheme.decode(SomeScheme.encode("foobar")));
   }

   @FuzzTest
   void fuzzTest(FuzzedDataProvider data) {
      String input = data.consumeRemainingAsString();
      assertEquals(input, SomeScheme.decode(SomeScheme.encode(input)));
   }
}

A complete Maven example project can be found in examples/junit.

GitHub releases

You can also use GitHub release archives to run a standalone Jazzer binary that starts its own JVM configured for fuzzing:

  1. Download and extract the latest release from the GitHub releases page.
  2. Add a new class to your project with a public static void fuzzerTestOneInput(FuzzedDataProvider data) method.
  3. Compile your fuzz test with jazzer_standalone.jar on the classpath.
  4. Run the jazzer binary (jazzer.exe on Windows), specifying the classpath and fuzz test class:
./jazzer --cp=<classpath> --target_class=<fuzz test class>

If you see an error saying that libjvm.so has not been found, make sure that JAVA_HOME points to a JDK.

The examples directory includes both toy and real-world examples of fuzz tests.

Docker

The "distroless" Docker image cifuzz/jazzer includes a recent Jazzer release together with OpenJDK 17. Mount a directory containing your compiled fuzz target into the container under /fuzzing and use it like a GitHub release binary by running:

docker run -v path/containing/the/application:/fuzzing cifuzz/jazzer --cp=<classpath> --target_class=<fuzz test class>

If Jazzer produces a finding, the input that triggered it will be available in the same directory.

Bazel

Support for Jazzer is available in rules_fuzzing, the official Bazel rules for fuzzing. See the README for instructions on how to use Jazzer in a Java Bazel project.

OSS-Fuzz

Code Intelligence and Google have teamed up to bring support for Java, Kotlin, and other JVM-based languages to OSS-Fuzz, Google's project for large-scale fuzzing of open-souce software. Read the OSS-Fuzz guide to learn how to set up a Java project.

Building from source

Information on building and testing Jazzer for development can be found in CONTRIBUTING.md

Further documentation

Findings

A list of security issues and bugs found by Jazzer is maintained here. If you found something interesting and the information is public, please send a PR to add it to the list.

Credit

The following developers have contributed to Jazzer before its public release:

Sergej Dechand, Christian Hartlage, Fabian Meumertzheim, Sebastian Pöplau, Mohammed Qasem, Simon Resch, Henrik Schnor, Khaled Yakdan

The LLVM-style edge coverage instrumentation for JVM bytecode used by Jazzer relies on JaCoCo. Previously, Jazzer used AFL-style coverage instrumentation as pioneered by kelinci.

Code Intelligence logo

jazzer's People

Contributors

0roman avatar 0xricksanchez avatar bertschneider avatar br-lewis avatar centic9 avatar cushon avatar davidkorczynski avatar eustas avatar findo avatar floriangla avatar fmeum avatar gdemarcsek avatar hadi88 avatar henryrneh avatar intrigus-lgtm avatar jochil avatar katherine-hough avatar kmnls avatar kyakdan avatar ligurio avatar marktefftech avatar oetr avatar raminfp avatar simonresch avatar svenkeidel avatar syrasx avatar thecorybarker avatar willroque avatar yawkat avatar zgtm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jazzer's Issues

Reenable BuildBuddy

We are currently not using BuildBuddy in the CI since the required secret isn't available in PR pipelines initiated from forks and BuildBuddy chokes on an empty authorization header. See #293 for more context.

A possible fix could be to set the remote header conditionally only when the secret is not empty.

Introduce JDK 17 in OSS Fuzz

I tried to upgrade JDK to 17 in OSS Fuzz

Unfortunately, Jazzer expects JDK 15 and it fails

With this error:

ERROR: /src/jazzer/agent/src/main/java/com/code_intelligence/jazzer/agent/BUILD.bazel:3:15: While resolving toolchains for target //agent/src/main/java/com/code_intelligence/jazzer/agent:agent_lib: no matching toolchains found for types @bazel_tools//tools/jdk:runtime_toolchain_type
ERROR: Analysis of target '//agent:jazzer_agent_deploy.jar' failed; build aborted: 

Can you please help to find out what can I do to change Jazzer to work with JDK 17 in OSS Fuzz ?

Jazzer aborts / does not write reproducer when using ASAN

This is a fantastic project!

When running this project with ASAN, upon finding an issue, jazzer aborts without writing a reproducer or DEDUP_TOKEN This also means that --keep-going does not work. It can be reproduced even with the default example:

Example:

> bazel run //examples:ExampleFuzzerWithASan

INFO: Analyzed target //examples:ExampleFuzzerWithASan (0 packages loaded, 0 targets configured
INFO: Found 1 target...
Target //examples:ExampleFuzzerWithASan up-to-date:
  bazel-bin/examples/ExampleFuzzerWithASan
INFO: Elapsed time: 0.104s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action

...

Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==158060==ABORTING
MS: 1 CMP- DE: "secret_in_native_library"-; base unit: 16fa22809a4e348998de632dc7f5e03577240500
0x61,0x62,0xe4,0xfd,0x1,0x63,0x1,0x6a,0x61,0x7a,0x7a,0x65,0x72,0x73,0x65,0x63,0x72,0x65,0x74,0x5
f,0x69,0x6e,0x5f,0x6e,0x61,0x74,0x69,0x76,0x65,0x5f,0x6c,0x69,0x62,0x72,0x61,0x72,0x79,0xe4,0xfd
,0xe,0x1,
ab\xe4\xfd\x01c\x01jazzersecret_in_native_library\xe4\xfd\x0e\x01
artifact_prefix='/home/askobayashi/.cache/bazel/_bazel_askobayashi/c359549acfcfeb7d27b63645e432b
e8d/execroot/jazzer/bazel-out/k8-opt/testlogs/examples/ExampleFuzzerWithASan/test.outputs/'; Tes
t unit written to /home/askobayashi/.cache/bazel/_bazel_askobayashi/c359549acfcfeb7d27b63645e432
be8d/execroot/jazzer/bazel-out/k8-opt/testlogs/examples/ExampleFuzzerWithASan/test.outputs/crash
-4cfe80e1c06525a244d3b5ed9dd59c0d70e6951d
Base64: YWLk/QFjAWphenplcnNlY3JldF9pbl9uYXRpdmVfbGlicmFyeeT9DgE=

The Base64 is the last line and it returns to console. As you can see, the Test unit is written, but neither a reproducer or DEDUP_TOKEN is created.

When using a non-asan target, you will typically see a line like:
Java reproducer written to ...

This is on ubuntu 20.04. I'd love to figure out what's going on here so I can run it with keep_going and DEDUP findings.

Thanks!

Jazzer documentation

I have a question, where can I find the documentation about the arguments that the jazzer program can take?

Classes in named Java 9 modules can't be instrumented

Instrumenting internal classes outside the default module (e.g., java.desktop) is tricky as of Java 9: As the agent runs in a context that is not module-aware, it can't export CoverageMap to other modules. This leads to NoClassDefFound exceptions when classes from other modules are instrumented.

In order to work around this, we may have to split the runtime package off and turn it into a proper Java 9 module.

Originally posted by @fmeum in #98 (comment)

Write Fuzztargets in Kotlin

I am under the impression, that it is currently not possible to have Kotlin fuzztargets AND use the byte interface instead of the FuzzedDataProvider. However officially ByteArray should be equivalent to byte[]

MavenFuzzer must define exactly one of the following two functions:
public static void fuzzerTestOneInput(byte[] ...)
public static void fuzzerTestOneInput(FuzzedDataProvider ...)
Note: Fuzz targets returning boolean are no longer supported; exceptions should be thrown instead of returning true.

FuzzTarget:

import org.apache.maven.model.io.DefaultModelReader
import java.io.ByteArrayInputStream
import java.io.IOException

@Suppress("unused")
class MavenFuzzer {
    @Throws(Exception::class)
    fun fuzzerTestOneInput(input: ByteArray) {
        val stream = ByteArrayInputStream(input)
        val reader = DefaultModelReader()
        try {
            @Suppress("UNUSED_VARIABLE")
            val model = reader.read(stream, null)
        } catch (ignore: IOException) {
        }
    }
}

@local_jdk is not found when running in Ubuntu on Windows 10

Hello, I am trying to run the example, however, after setting local jdk to JAVA_HOME I am still getting the warning and bazel could not find my local jdk. I couldn't find any solutions online. Please help.

`nxie@LAPTOP-8Q6L74UG:/mnt/c/users/ningx/dev/github/jazzer$ bazel run //:jazzer
WARNING: Ignoring JAVA_HOME, because it must point to a JDK, not a JRE.
Starting local Bazel server and connecting to it...
ERROR: /home/nxie/.cache/bazel/_bazel_nxie/7d80d092e073fb44fce0d67ba176764e/external/local_jdk/BUILD.bazel:3:10: in fail_rule rule @local_jdk//:jdk:
Traceback (most recent call last):
File "/home/nxie/.cache/bazel/_bazel_nxie/7d80d092e073fb44fce0d67ba176764e/external/bazel_tools/tools/jdk/fail_rule.bzl", line 19, column 13, in _fail_rule_impl
fail("%s %s" % (ctx.attr.header, ctx.attr.message))
Error in fail: Auto-Configuration Error: Cannot find Java binary bin/java in /home/nxie/.cache/bazel/_bazel_nxie/install/1a4a2fac02d50c77031d44c0d91b8920/embedded_tools/tools/jdk/nosystemjdk; either correct your JAVA_HOME, PATH or specify embedded Java (e.g. --javabase=@bazel_tools//tools/jdk:remote_jdk11)
INFO: Repository remotejdk11_linux instantiated at:
/DEFAULT.WORKSPACE.SUFFIX:52:6: in
/home/nxie/.cache/bazel/_bazel_nxie/7d80d092e073fb44fce0d67ba176764e/external/bazel_tools/tools/build_defs/repo/utils.bzl:201:18: in maybe
Repository rule http_archive defined at:
/home/nxie/.cache/bazel/_bazel_nxie/7d80d092e073fb44fce0d67ba176764e/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in
INFO: Repository com_google_absl instantiated at:
/mnt/c/users/ningx/dev/github/jazzer/WORKSPACE.bazel:6:20: in
/mnt/c/users/ningx/dev/github/jazzer/repositories.bzl:81:10: in jazzer_dependencies
/home/nxie/.cache/bazel/_bazel_nxie/7d80d092e073fb44fce0d67ba176764e/external/bazel_tools/tools/build_defs/repo/utils.bzl:201:18: in maybe
Repository rule http_archive defined at:
/home/nxie/.cache/bazel/_bazel_nxie/7d80d092e073fb44fce0d67ba176764e/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in
INFO: Repository 'com_google_absl' used the following cache hits instead of downloading the corresponding file.

  • Hash '6ead5ca816dee2052e80ef746ab88e319f7cf40392e9dcc67d56d2d1e0043660' for https://github.com/abseil/abseil-cpp/archive/3a2d6572d06709da32a17f053ca1e3c8e2af90df.zip
    If the definition of 'com_google_absl' was updated, verify that the hashes were also updated.
    ERROR: Analysis of target '//:jazzer' failed; build aborted: Analysis of target '@local_jdk//:jdk' failed
    INFO: Elapsed time: 3.526s
    INFO: 0 processes.
    FAILED: Build did NOT complete successfully (31 packages loaded, 255 targets configured)
    FAILED: Build did NOT complete successfully (31 packages loaded, 255 targets configured)
    Fetching @jazzer_com_github_gflags_gflags; fetching
    Fetching @com_google_glog; fetching
    Fetching ...e_absl; Extracting /home/nxie/.cache/bazel/_bazel_nxie/7d80d092e073fb44fce0d67ba176764e/external/com_g
    oogle_absl/temp1555407049090310124/3a2d6572d06709da32a17f053ca1e3c8e2af90df.zip
    Fetching ...e_glog; Extracting /home/nxie/.cache/bazel/_bazel_nxie/7d80d092e073fb44fce0d67ba176764e/external/com_g
    oogle_glog/temp4216640165572278970/8d40d7564d4a06d77d707d7c4a50c8b5dc45dd80.tar.gz
    Fetching ...gflags; Extracting /home/nxie/.cache/bazel/_bazel_nxie/7d80d092e073fb44fce0d67ba176764e/external/jazze
    r_com_github_gflags_gflags/temp17373977854442152533/827c769e5fc98e0f2a34c47cef953cc6328abced.tar.gz
    nxie@LAPTOP-8Q6L74UG:/mnt/c/users/ningx/dev/github/jazzer$ echo $JAVA_HOME
    /mnt/c/Users/ningx/Java/jdk-15.0.2
    nxie@LAPTOP-8Q6L74UG:/mnt/c/users/ningx/dev/github/jazzer$`

Interaction of --keep_going and -ignore_crashes=1

While using Libfuzzers fork mode Jazzers --keep_going is naturally not enough and crashes the fuzzing after a while. Using -ignore_crashes=1 seems to work fine. But both together lead to Jazzer dealing with the crash without Libfuzzer noticing it. Currently I only see the minor issue of the number of crashes not getting counted and staying at zero in the command line output, but not sure if there are no other consequences.

Jazzer does not use libc++

I tried adding jazzer test rules as a http_archive to my WORKSPACE file:

http_archive(
    name = "rules_jazzer",
    sha256 = "c2b26f80618f51fd7d75e2e8067084f3776f321b596ca2fb19c585f836739bf9",
    strip_prefix = "jazzer-0.9.1",
    urls = ["https://github.com/CodeIntelligenceTesting/jazzer/archive/refs/tags/v0.9.1.tar.gz"],
)

and then using java_fuzz_target_test as a test in one of my BUILD files

load("@rules_jazzer//bazel:fuzz_target.bzl", "java_fuzz_target_test")

java_fuzz_target_test(
    name = "gateway_controller_fuzz",
  ....
)

However, it seems that java_fuzz_target_test adds dependencies on internal targets (e.g. //agent/src/main/java/com/code_intelligence/jazzer/api), which means that it can't be used in this way.

FWIW, I also suggested that jazzer rules could be added to bazelbuild/rules_fuzzing, so that might be a better place to fix this problem.

Ctrl + c not working with -fork and -ignore_crashes=1

Using the Libfuzzer flags -fork and -ignore_crashes sending ctrl + c is regarded as a crash and the threads restart. I fixed it in my own fork with a small patch from google/oss-fuzz#4547. Since the diskussion there implies no real maintenance of Libfuzzer anymore, maybe there is interest in fixing it in the fork used by jazzer ?

ClassVisitor throws IllegalArgumentException: Unsupported api

I try to apply Jazzer for a Spring Boot project which has many dependencies. I created a fat Jar file with the ShadowJar plugin so that every dependency can be accessed by Jazzer when executing ./jazzer. Besides, dependencies and my fuzz tests are written in Kotlin (1.4.31), for building I'm using Gradle (6.8.3).

Unfortunatley exceptions are thrown for every instrumented class, like:

#8 1.035 java.lang.IllegalArgumentException: Unsupported api 589824
#8 1.035 WARN: Failed to instrument com.fasterxml.jackson.databind.introspect.ConcreteBeanPropertyBase, skipping
#8 1.035 	at org.objectweb.asm.ClassVisitor.<init>(ClassVisitor.java:70)
#8 1.035 	at com.code_intelligence.jazzer.instrumentor.HookInstrumentor$instrument$interceptor$1.<init>(HookInstrumentor.kt:30)
#8 1.035 	at com.code_intelligence.jazzer.instrumentor.HookInstrumentor.instrument(HookInstrumentor.kt:30)
#8 1.035 	at com.code_intelligence.jazzer.instrumentor.ClassInstrumentor.hooks(ClassInstrumentor.kt:40)
#8 1.035 	at com.code_intelligence.jazzer.agent.RuntimeInstrumentor.instrument(RuntimeInstrumentor.kt:139)
#8 1.035 	at com.code_intelligence.jazzer.agent.RuntimeInstrumentor.transform(RuntimeInstrumentor.kt:110)
#8 1.035 	at java.instrument/java.lang.instrument.ClassFileTransformer.transform(ClassFileTransformer.java:246)
#8 1.035 	at java.instrument/sun.instrument.TransformerManager.transform(TransformerManager.java:188)
#8 1.035 	at java.instrument/sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:563)
#8 1.035 	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
#8 1.035 	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
#8 1.035 	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
#8 1.035 	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800)
#8 1.035 	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
#8 1.035 	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
#8 1.035 	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
#8 1.035 	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
#8 1.035 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
#8 1.035 	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
#8 1.035 	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
#8 1.035 	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
#8 1.035 	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800)
#8 1.035 	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
#8 1.035 	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
#8 1.035 	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
#8 1.035 	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
#8 1.035 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
#8 1.035 	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
#8 1.035 	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
#8 1.035 	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
#8 1.035 	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800)
#8 1.035 	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
#8 1.035 	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
#8 1.035 	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
#8 1.035 	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
#8 1.035 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
#8 1.035 	at com.fasterxml.jackson.databind.ObjectMapper.<clinit>(ObjectMapper.java:351)
#8 1.035 	at net.grandcentrix.cellulariot.cellularhub.devicemanagement.device.domain.vodafone.VodafoneMessageParser.<init>(VodafoneMessageParser.kt:11)
#8 1.035 	at net.grandcentrix.cellulariot.cellularhub.devicemanagement.device.domain.vodafone.VodafoneEventMessageParser.<init>(VodafoneEventMessageParser.

I assume that the ClassVisitor expects a different class file format version. Is that an issue which might be related to my compiling process or may it be a Jazzer problem?

libFuzzer Dictionary Support

When applying the -dict flag of libFuzzer the fuzzing just stops:

Executed dictionaries/json.dict in 2097 ms
***
*** NOTE: fuzzing was not performed, you have only
***       executed the target code on a fixed set of inputs.
***

Is it because dicts are not supported at the moment?

Specify external jar file as a dependency for fuzzer

Hi, instead of importing a library from maven for fuzzing, I wanted to import a locally-downloaded jar file containing the library to be fuzzed on the classpath. Is that possible to do so by tweaking the rules in jazzer/examples/BUILD.bazel?

As an example, let's say I had this as the original build rule for the fuzz target.

java_fuzz_target_test(
    name = "GifImageParserFuzzer",
    srcs = [
        "src/main/java/com/example/GifImageParserFuzzer.java",
    ],
    target_class = "com.example.GifImageParserFuzzer",
    deps = [
        "@maven//:org_apache_commons_commons_imaging",
    ],
)

How can I update the deps to not retrieve the imaging library from maven but instead use my own local copy of the library as a jar file instead?

Alternatively is there someway for me to alter the below command to include my custom library on the classpath? I tried adding -- --cp=/path/to/custom/jar/file --target_class=com.example.GifImageParserFuzzer at the end of the below command but it did not work as expected.

./bazelisk-linux-amd64 run //examples:GifImageParserFuzzer -- --cp=/path/to/custom/jar/file --target_class=com.example.GifImageParserFuzzer

[UPDATE] I was able to finally fuzz my own custom library by using the jazzer binary and including the custom library on the classpath like so (as referred to here ) .

./jazzer --cp=fuzz_target.jar:custom_library.jar --target_class=com.example.MyFuzzTarget

FuzzedDataProvider.consumeChar(char min, char max) returns values outside of range

Calls to FuzzedDataProvider.consumeChar(char min, char max) can return values outside of the range [min, max]. For example, fuzzing the following method with Jazzer produces an unexpected assertion error:

import com.code_intelligence.jazzer.api.FuzzedDataProvider;

public class FuzzTarget {
    public static void fuzzerTestOneInput(FuzzedDataProvider provider) {
    	char min = 'a';
    	char max = 'b';
    	char c = provider.consumeChar(min, max);
    	assert(c >= min && c <= max);
    }
}

I believe that the issue is that line 667 of fuzzed_data_provider.cpp uses a function pointer to ConsumeIntegral instead of ConsumeIntegralInRange.

JUnit source JAR on Maven Central is invalid

The new JUnit integration is awesome, but it looks like the source JAR uploaded to Maven Central (jazzer-junit-0.12.0-sources.jar) is invalid. My IDE (Eclipse) is unable to use it to browse the sources, and 7Zip is unable to open it (which is usually possible).

Increasing Fuzz Input Size

What is the right way to increase the input size?

Similar to the example in the README, I see the log message:

INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 4096 bytes

In addition, when calling FuzzedDataProvider::consumeBytes(int), I get fewer bytes than requested. Per the documentation, this is because the input size is not sufficiently long. The command I'm executing looks like this:

/tmp/not-out/tmpzysle9uu/jazzer_driver --agent_path=/tmp/not-out/tmpzysle9uu/jazzer_agent_deploy.jar --cp=/tmp/not-out/tmpzysle9uu/myapp.jar:/tmp/not-out/tmpzysle9uu/myfuzzer.jar --target_class=MyFuzzer --jvm_args=-Xmx2048m:-Djava.awt.headless=true -max_len=8192 --alsologtostderr=true -rss_limit_mb=2560 -timeout=25 -seed=1337 -runs=4

In case it's relevant, jazzer_driver is being called through oss-fuzz.

JUnit integration usage

Hello

I've been trying to use jazzer-junit with my unit test suite and gradle and it didn't work for me.
Couldn't find any documentation on how to make it work with gradle (not bazel).
Am I missing some junit configuration? I imported jazzer-junit and synced gradle so it sees all dependencies.
But when i try to run i'm getting > No tests found for given includes message.
Please, give some brief explanation on how to integrate @FuzzTest annotations to existing junit/gradle setup.

Docker build failed - invalid registered toolchain '@llvm_toolchain//:cc-toolchain-x86_64-darwin'

docker build fails:

ERROR: Analysis of target '//driver:jazzer_driver' failed; build aborted: invalid registered toolchain '@llvm_toolchain//:cc-toolchain-x86_64-darwin': no such target '@llvm_toolchain//:cc-toolchain-x86_64-darwin': target 'cc-toolchain-x86_64-darwin' not declared in package '' defined by /root/.cache/bazel/_bazel_root/7ba36ab39d5645298fbbcf2937026a1e/external/llvm_toolchain/BUILD.bazel

I found a workaround with a small hack:

diff --git a/docker/jazzer/Dockerfile b/docker/jazzer/Dockerfile
index b82b9d8..89a6ce3 100644
--- a/docker/jazzer/Dockerfile
+++ b/docker/jazzer/Dockerfile
@@ -23,6 +23,7 @@ RUN git clone --depth=1 https://github.com/CodeIntelligenceTesting/jazzer.git &&
     # The LLVM toolchain requires ld and ld.gold to exist, but does not use them.
     touch /usr/bin/ld && \
     touch /usr/bin/ld.gold && \
+    sed -i 's!,@llvm_toolchain//:cc-toolchain-x86_64-darwin!!' .bazelrc && \
     BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 \
     ./bazelisk-linux-amd64 build --config=toolchain //agent:jazzer_agent_deploy.jar //driver:jazzer_driver
The reason I'm building using docker is that I'm getting another issue with building on my Fedora 35 machine...
$ ./bazelisk-linux-amd64 run //:jazzer 
Starting local Bazel server and connecting to it...
INFO: Analyzed target //:jazzer (82 packages loaded, 1584 targets configured).
INFO: Found 1 target...
ERROR: /home/chlunde/.cache/bazel/_bazel_chlunde/bde37c42920ce4fea0e810d0ff140733/external/com_google_absl/absl/base/BUILD.bazel:200:11: Compiling absl/base/internal/cycleclock.cc failed: (Exit 1): clang failed: error executing command /usr/lib64/ccache/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 ... (remaining 59 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
ccache: error: Failed to create temporary file for /run/user/1000/ccache-tmp/tmp.cpp_stdout.oz18d3: Read-only file system
Target //driver:jazzer_driver failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 7.066s, Critical Path: 0.14s
INFO: 5 processes: 5 internal.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully

SQL injection sanitizer fails during startup

The following stack trace has been reported by users:

WARN: Failed to instrument TestServer, skipping
java.lang.IllegalStateException: For a given method, You can either have a single REPLACE hook or BEFORE/AFTER hooks. Found:
 [REPLACE java.sql.PreparedStatement.executeUpdate: com.code_intelligence.jazzer.sanitizers.SqlInjection.checkSqlExecute [], REPLACE java.sql.PreparedStatement.executeUpdate: com.code_intelligence.jazzer.sanitizers.SqlInjection.checkSqlExecute []]
        at com.code_intelligence.jazzer.instrumentor.HookMethodVisitor.findMatchingHooks(HookMethodVisitor.kt:281)
        at com.code_intelligence.jazzer.instrumentor.HookMethodVisitor.handleMethodInsn(HookMethodVisitor.kt:87)
        at com.code_intelligence.jazzer.instrumentor.HookMethodVisitor.visitMethodInsn(HookMethodVisitor.kt:77)
        at com.code_intelligence.jazzer.third_party.org.objectweb.asm.MethodVisitor.visitMethodInsn(MethodVisitor.java:438)
        at com.code_intelligence.jazzer.third_party.org.objectweb.asm.ClassReader.readCode(ClassReader.java:2448)
        at com.code_intelligence.jazzer.third_party.org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1514)
        at com.code_intelligence.jazzer.third_party.org.objectweb.asm.ClassReader.accept(ClassReader.java:744)
        at com.code_intelligence.jazzer.third_party.org.objectweb.asm.ClassReader.accept(ClassReader.java:424)
        at com.code_intelligence.jazzer.instrumentor.HookInstrumentor.instrument(HookInstrumentor.kt:45)
        at com.code_intelligence.jazzer.instrumentor.ClassInstrumentor.hooks(ClassInstrumentor.kt:46)
        at com.code_intelligence.jazzer.agent.RuntimeInstrumentor.instrument(RuntimeInstrumentor.kt:164)
        at com.code_intelligence.jazzer.agent.RuntimeInstrumentor.transformInternal(RuntimeInstrumentor.kt:135)
        at com.code_intelligence.jazzer.agent.RuntimeInstrumentor.transform(RuntimeInstrumentor.kt:62)
        at com.code_intelligence.jazzer.agent.RuntimeInstrumentor.transform(RuntimeInstrumentor.kt:114)
        at java.instrument/sun.instrument.TransformerManager.transform(TransformerManager.java:188)
        at java.instrument/sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:563)
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
        at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
        at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:825)
        at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:723)
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:646)
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:604)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
        at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
        at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:825)
        at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:723)
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:646)
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:604)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)

I think that the root cause is that

lists methods on super and child classes separately, which leads to the hook being applied twice to e.g. PreparedStatement as we automatically propagate hooks to child classes. Fixing this may just mean removing mentions of child classes of Statement from the annotations.

How to fuzz java program when the jdk argument '--enable-preview' enabled

Hi: I am using Jazzer to fuzzing with JDK17 new preview feature. And I got a Error goes like this:

== Java Exception: java.lang.UnsupportedClassVersionError: Preview features are not enabled for Error (class file version 61.65535). Try running with '--enable-preview'
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
at Main.fuzzerTestOneInput(Main.java:11)

I guess this is not the problem with the code being tested. But the jdk argument '--enable-preview' is not contained when running the code. I have checked with the document and the help of jazzer but I did not find any related information. Would you help me with it?

Thanks

v0.9.1 does not build on OSX

Bazel output:

ERROR: /clients/jazzer/third_party/jni/BUILD.bazel:44:10: no such target '@local_jdk//:lib/server/libjvm.so': target 'lib/server/libjvm.so' not declared in package '' defined by /private/var/tmp/_bazel_eustas/576d75f9d51a861dc30c748efc340c9f/external/local_jdk/BUILD.bazel and referenced by '//third_party/jni:libjvm'
ERROR: Analysis of target '//third_party/jni:libjvm' failed; build aborted: Analysis failed

Adjust the JVM heap size with the `rss_limit_mb`

Do we want to adjust the JVM heap size with the rss_limit_mb value set by the user?

I thought about this as well, but are users more likely to change rss_limit_mb or -Xmx via jvm_args? I would have guessed the latter, but am not sure. We would probably have to parse both and warn if they conflict, but that requires quite a bit of logic. What do you think?

Originally posted by @fmeum in #93 (comment)

VerifyError thrown while instanciating org.postgresql.jdbc.PgConnection

Hello

I'm currenlty onboarding pgjdbc into oss-fuzz. One of the fuzz targets creates a java.sql.Connection to a postgresql server, which works, and then uses this connection to instanciate a java.sql.Statement. While doing so, a VerifyError is thrown uppon which the JVM dies.

== Java Exception: java.lang.VerifyError: Inconsistent stackmap frames at branch target 173
Exception Details:
  Location:
    org/postgresql/jdbc/PgStatement.executeWithFlags(Lorg/postgresql/core/CachedQuery;I)Z @141: goto
  Reason:
    Current frame's stack size doesn't match stackmap.
  Current Frame:
    bci: @141
    flags: { }
    locals: { 'org/postgresql/jdbc/PgStatement', 'org/postgresql/core/CachedQuery', integer, '[Ljava/lang/Object;', 'org/postgresql/jdbc/PgStatement', top, 'org/postgresql/jdbc/PgStatement' }
    stack: { 'java/lang/Object' }
  Stackmap Frame:
    bci: @173
    flags: { }
    locals: { 'org/postgresql/jdbc/PgStatement', 'org/postgresql/core/CachedQuery', integer, top, top, top, 'java/lang/Object' }
    stack: { }
  Bytecode:
    0000000: 2ab6 0102 111f 07b8 03ed 2ab4 0079 b901
    0000010: 3901 00b2 017f b601 8359 035f 1301 84b8
    0000020: 00e6 9b00 0c11 1f08 b803 eda7 000f 1c11
    0000030: 0400 803d 111f 09b8 03ed 2a2b 011c 1100
    0000040: 03bd 0004 4eb8 02ea 2d5f 1100 025f 532d
    0000050: 5f11 0001 5f53 2d5f 1100 005f 533a 0413
    0000060: 03c4 1904 2d13 03c5 b803 cb2a 593a 06c2
    0000070: 111f 0ab8 03ed 2ab6 0102 111f 0bb8 03ed
    0000080: 2ab4 006d c700 0c11 1f0c b803 eda7 0020
    0000090: 2ab4 006d b601 16c7 000c 111f 0db8 03ed
    00000a0: a700 0d04 111f 0eb8 03ed a700 0a03 111f
    00000b0: 0fb8 03ed 1906 c311 1f10 b803 edac 3a07
    00000c0: 1906 c319 0711 1f11 b803 edbf
  Exception Handler Table:
    bci [112, 183] => handler: 190
    bci [190, 195] => handler: 190
  Stackmap Table:
    same_frame(@46)
    same_frame(@58)
    full_frame(@144,{Object[#2],Object[#342],Integer,Object[#1007],Object[#2],Top,Object[#2]},{Object[#4]})
    same_locals_1_stack_item_frame(@163,Object[#4])
    full_frame(@173,{Object[#2],Object[#342],Integer,Top,Top,Top,Object[#4]},{})
    same_locals_1_stack_item_frame(@180,Integer)
    same_locals_1_stack_item_frame(@190,Object[#287])

        at org.postgresql.jdbc.PgConnection.createStatement(PgConnection.java:1318)
        at org.postgresql.jdbc.PgConnection.createStatement(PgConnection.java:1772)
        at org.postgresql.jdbc.PgConnection.createStatement(PgConnection.java:449)
        at SqlStatementFuzzer.createTestTable(SqlStatementFuzzer.java:22)
        at SqlStatementFuzzer.fuzzerTestOneInput(SqlStatementFuzzer.java:33)
DEDUP_TOKEN: 0cc0919333d7575a
== libFuzzer crashing input ==
MS: 0 ; base unit: 0000000000000000000000000000000000000000

The SqlStatementFuzzer "fuzz target" in the pgjdbc branch of the oss-fuzz repository reproduces the issue.

Undocumented build issues on macOS

same to issue-21

MacOS version

10.15.7

java -version

java version "1.8.0_241"
Java(TM) SE Runtime Environment (build 1.8.0_241-b07)
Java HotSpot(TM) 64-Bit Server VM (build 25.241-b07, mixed mode)

bazel --version

2.1.1-homebrew

clang --version

Apple clang version 11.0.3 (clang-1103.0.32.29)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

run :

git clone https://github.com/CodeIntelligenceTesting/jazzer
cd jazzer
bazel run //:jazzer -- --cp=target.jar

error:

INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=149
INFO: Reading rc options for 'run' from /Users/xxx/jazzer/.bazelrc:
  Inherited 'build' options: --incompatible_strict_action_env -c opt --cxxopt=-std=c++17 --action_env=CC=clang --java_language_version=8 --tool_java_language_version=9
ERROR: Unrecognized option: --java_language_version=8

the recording FuzzedDataProvider skips methods implemented as interface defaults

The pickX methods that are implemented as FuzzedDataProvider interface defaults have internal calls to the data provider that never get recorded. This causes playback via the CannedFuzzedDataProvider to fail with class cast exceptions since the stream does not contain the needed input. A workaround is to copy/paste the default methods into a helper class that delegates appropriately to the data provider native methods.

Kotlin Version Support

I have updated a project to a new Kotlin version (1.5.10) and now the fuzzer stops working (tests haven't been changed):

INFO: Loaded 8562 no-throw method signatures
INFO: libFuzzer ignores flags that start with '--'
INFO: Seed: 4294574280
INFO: Loaded 1 modules   (512 inline 8-bit counters): 512 [0x7f4e83eff010, 0x7f4e83eff210),
INFO: Loaded 1 PC tables (512 PCs): 512 [0x7f4e82afd010,0x7f4e82aff010),
INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 4096 bytes
INFO: New number of inline 8-bit counters: 1024
INFO: New number of inline 8-bit counters: 2048
INFO: New number of inline 8-bit counters: 4096
INFO: New number of inline 8-bit counters: 8192
INFO: New number of inline 8-bit counters: 16384
INFO: New number of inline 8-bit counters: 32768
INFO: New number of inline 8-bit counters: 65536
INFO: A corpus is not provided, starting from an empty corpus
#2	INITED exec/s: 2 rss: 207Mb
ERROR: no interesting inputs were found. Is the code instrumented for coverage? Exiting.

Before (Kotlin 1.4.31):

INFO: Loaded 8562 no-throw method signatures
INFO: Instrumented net.grandcentrix.cellulariot.cellularhub.fuzztests.targets.MessageMustacheSerializerFuzzer (took 153 ms, size +43%)
INFO: libFuzzer ignores flags that start with '--'
INFO: Seed: 1145321598
INFO: Loaded 1 modules   (512 inline 8-bit counters): 512 [0x7fe4fedce010, 0x7fe4fedce210),
INFO: Loaded 1 PC tables (512 PCs): 512 [0x7fe4fd9cc010,0x7fe4fd9ce010),
INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 4096 bytes
INFO: Instrumented net.grandcentrix.cellulariot.cellularhub.utils.serialisation.models.SerialisationContext (took 14 ms, size +25%)
INFO: Instrumented net.grandcentrix.cellulariot.cellularhub.utils.serialisation.models.SerialisationProductDto (took 5 ms, size +37%)
...

Might this be related to Jazzer?

Add support for --coverage_report equivalent in JUnit integration

I'd love to be able to run fuzz tests more easily via the JUnit integration, but still receive a coverage report like the one that the binary is able to generate.

In the future I could also see myself needing equivalents for --coverage_dump, -merge, and -runs so I'm not sure if a one-to-one mapping to annotation parameters is ideal, or if something more generic (e.g. a "libFuzzerArgs" parameter and/or a "args" parameter) would be better.

Failed to test Spring boot project

I tried to test a Spring boot project with Jazzer, but it can not get spring context.

Does Jazzer support testing Spring boot projects? Is there a demo?

Improve documentation for Mac OS users

I'd like to try jazzer with my Java library under Mac OS and have already created a target class: https://github.com/marco-schmidt/ufxcoder/blob/master/src/main/java/ufxcoder/formats/JazzerTarget.java

I've also followed your README.md and installed bazel.

I don't understand what do next. It seems like there are no released binaries for Mac OS and bazel is required to compile them. However, the documented bazel calls are for Linux as far as I can see.

Could you include a small guide on what to do as a Mac user? Or point me to a section in the README I may have overlooked?

If someone has time to run jazzer on my library, I've added the build and jazzer call which I think should work to the target class: https://github.com/marco-schmidt/ufxcoder/blob/bf14f126e963620275f59106e068448d3bafd5a9/src/main/java/ufxcoder/formats/JazzerTarget.java#L30

Thanks for any feedback and for providing jazzer,
Marco

Error when running the tool

Hi, all!

I am experimenting with jazzer, but so far I could not run it.

I try something simple as:

bazel run //:jazzer -- --cp=test-1.0-SNAPSHOT.jar --target_class=ch14.RandomStringUtilsFuzzer

But I get this output from the tool:

INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=160
INFO: Reading rc options for 'run' from /Users/mauricioaniche/tools/jazzer/.bazelrc:
  Inherited 'build' options: --incompatible_strict_action_env -c opt --cxxopt=-std=c++17 --action_env=CC=clang --java_language_version=8 --tool_java_language_version=9
ERROR: Unrecognized option: --java_language_version=8

I tried with java 8 and 11, but I get the same error. I'm on a Mac OS 10.15.7.

I am not really knowledagble in Bazel, so I might be making a novice mistake here.

Any ideas?

Constant string generated for crash file is too long

Hi there.

I am generating 2D matrix with random dimensions like the code below.

            int vectorLen = data.consumeInt(1, 500);
            int matrixLen = data.consumeInt(1, 500);

            double[][] matrix = new double[matrixLen][vectorLen];

            for (int i = 0; i < matrixLen; ++i) {
                double[] tmp_vector = new double[vectorLen];
                for (int j = 0; j < vectorLen; ++j) {
                    tmp_vector[j] = data.consumeDouble();
                }
                matrix[i] = tmp_vector;
            }

Jazzer runs the code, but the file created has a huge string feeding CannedFuzzedDataProvider.

I do not know if this is a bug or if this issue is intended to be like it is, but Jazzer is generating a file that does not compile.

I let here a controlc.com for the crash file if you want to check it. Crash file

Exiting with "No such directory" error while trying to minimize input

I'm using the docker container to run jazzer on macOS 11.6.5
While trying to minimize the crashing input I run the following command
docker run -v $(pwd):/fuzzing cifuzz/jazzer --cp=<lib1.jar:lib2.jar...> --target_class=<target_class_path> -minimize_crash=1 fuzz_out/crash-f6ca037bf1e38e19bca6263cc9fe950ea6c1bced

The fuzzer exits with the following error -
No such directory: /fuzzing/minimized-from-f6ca037bf1e38e19bca6263cc9fe950ea6c1bced; exiting

From the jazzer output I can see it runs jazzer with this argument -exact_artifact_path=/fuzzing/minimized-from-f6ca037bf1e38e19bca6263cc9fe950ea6c1bced since this directory doesn't exist it errors out and exits.

I could find this PR and tried running docker run -v $(pwd):/fuzzing cifuzz/jazzer --cp=<lib1.jar:lib2.jar...> --target_class=<target class path> -minimize_crash=1 -create_missing_dirs=1 fuzz_out/crash-f6ca037bf1e38e19bca6263cc9fe950ea6c1bced but that didn't work either.

Rare coverage ID sync failures

As reported by ClusterFuzz, coverage IDs can become desynchronized between child processes in fork mode. I attached a log obtained from the ValidJsonFuzzer fuzzer of the json-sanitizer project.

@sebastianpoeplau Could you review https://github.com/CodeIntelligenceTesting/jazzer/blob/main/agent/src/main/java/com/code_intelligence/jazzer/agent/CoverageIdStrategy.kt again for potential synchronization issues? Any idea on how to improve logging of these cases further would also be helpful.

[Environment] ASAN_OPTIONS=alloc_dealloc_mismatch=0:allocator_may_return_null=1:allocator_release_to_os_interval_ms=500:allow_user_segv_handler=0:check_malloc_usable_size=0:detect_leaks=1:detect_odr_violation=0:detect_stack_use_after_return=1:fast_unwind_on_fatal=0:handle_abort=2:handle_segv=2:handle_sigbus=2:handle_sigfpe=2:handle_sigill=2:max_uar_stack_size_log=16:print_scariness=1:print_summary=1:print_suppressions=0:quarantine_size_mb=64:redzone=128:strict_memcmp=1:strip_path_prefix=/workspace/:symbolize=0:use_sigaltstack=1
+----------------------------------------Release Build Stacktrace----------------------------------------+
INFO: Synchronizing coverage IDs in /tmp/jazzer-rjzvredadvdehcizmmuolhlnhchnqfxs
INFO: Loaded 8649 no-throw method signatures
INFO: Instrumented ValidJsonFuzzer (took 156 ms, size +37%)
INFO: Instrumented com.google.gson.Gson (took 85 ms, size +32%)
INFO: Instrumented com.google.gson.stream.MalformedJsonException (took 3 ms, size +37%)
INFO: Instrumented com.google.gson.JsonIOException (took 3 ms, size +46%)
INFO: Instrumented com.google.gson.JsonParseException (took 3 ms, size +36%)
INFO: Instrumented com.google.gson.JsonSyntaxException (took 3 ms, size +45%)
INFO: New number of inline 8-bit counters: 1024
INFO: Instrumented com.google.gson.stream.JsonReader (took 75 ms, size +85%)
INFO: New number of inline 8-bit counters: 2048
INFO: Instrumented com.google.gson.internal.bind.JsonTreeReader (took 23 ms, size +63%)
INFO: Instrumented com.google.gson.TypeAdapter (took 5 ms, size +25%)
INFO: Instrumented com.google.gson.Gson$3 (took 8 ms, size +29%)
INFO: Instrumented com.google.gson.Gson$1 (took 4 ms, size +29%)
INFO: Instrumented com.google.gson.Gson$2 (took 4 ms, size +29%)
INFO: Instrumented com.google.gson.TypeAdapterFactory (took 2 ms, size +0%)
INFO: Instrumented com.google.gson.JsonElement (took 7 ms, size +32%)
INFO: Instrumented com.google.gson.JsonNull (took 5 ms, size +66%)
INFO: Instrumented com.google.gson.stream.JsonWriter (took 35 ms, size +67%)
INFO: Instrumented com.google.gson.internal.bind.JsonTreeWriter (took 10 ms, size +53%)
INFO: Instrumented com.google.gson.FieldNamingStrategy (took 2 ms, size +0%)
INFO: Instrumented com.google.gson.Gson$FutureTypeAdapter (took 4 ms, size +26%)
INFO: Instrumented com.google.gson.reflect.TypeToken (took 11 ms, size +40%)
INFO: Instrumented com.google.gson.internal.$Gson$Preconditions (took 3 ms, size +50%)
INFO: Instrumented com.google.gson.internal.$Gson$Types (took 30 ms, size +59%)
INFO: Instrumented com.google.gson.internal.Excluder (took 18 ms, size +61%)
INFO: Instrumented com.google.gson.internal.Excluder$1 (took 11 ms, size +31%)
INFO: Instrumented com.google.gson.FieldNamingPolicy (took 8 ms, size +40%)
INFO: Instrumented com.google.gson.FieldNamingPolicy$1 (took 5 ms, size +37%)
INFO: Instrumented com.google.gson.FieldNamingPolicy$2 (took 5 ms, size +34%)
INFO: Instrumented com.google.gson.FieldNamingPolicy$3 (took 7 ms, size +33%)
INFO: Instrumented com.google.gson.FieldNamingPolicy$4 (took 9 ms, size +28%)
INFO: Instrumented com.google.gson.FieldNamingPolicy$5 (took 2 ms, size +28%)
INFO: Instrumented com.google.gson.FieldNamingPolicy$6 (took 4 ms, size +28%)
INFO: Instrumented com.google.gson.LongSerializationPolicy (took 22 ms, size +30%)
INFO: Instrumented com.google.gson.LongSerializationPolicy$1 (took 5 ms, size +39%)
INFO: Instrumented com.google.gson.LongSerializationPolicy$2 (took 2 ms, size +33%)
INFO: New number of inline 8-bit counters: 4096
INFO: Instrumented com.google.gson.JsonPrimitive (took 10 ms, size +81%)
INFO: Instrumented com.google.gson.internal.ConstructorConstructor (took 6 ms, size +33%)
INFO: Instrumented com.google.gson.internal.ObjectConstructor (took 3 ms, size +0%)
INFO: Instrumented com.google.gson.internal.reflect.ReflectionAccessor (took 5 ms, size +57%)
INFO: Instrumented com.google.gson.internal.reflect.PreJava9ReflectionAccessor (took 2 ms, size +44%)
INFO: Instrumented com.google.gson.internal.reflect.UnsafeReflectionAccessor (took 11 ms, size +45%)
INFO: Instrumented com.google.gson.internal.JavaVersion (took 7 ms, size +61%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters (took 11 ms, size +19%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$3 (took 9 ms, size +29%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$4 (took 3 ms, size +31%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$5 (took 2 ms, size +30%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$6 (took 2 ms, size +30%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$7 (took 2 ms, size +30%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$11 (took 2 ms, size +30%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$12 (took 2 ms, size +29%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$13 (took 2 ms, size +29%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$14 (took 3 ms, size +26%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$15 (took 3 ms, size +34%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$16 (took 2 ms, size +30%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$17 (took 2 ms, size +31%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$18 (took 2 ms, size +31%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$19 (took 3 ms, size +31%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$20 (took 3 ms, size +31%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$21 (took 3 ms, size +57%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$22 (took 3 ms, size +56%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$23 (took 3 ms, size +32%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$24 (took 2 ms, size +33%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$27 (took 5 ms, size +75%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$28 (took 4 ms, size +49%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$29 (took 5 ms, size +50%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$1 (took 3 ms, size +23%)
INFO: Instrumented com.google.gson.TypeAdapter$1 (took 3 ms, size +29%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$32 (took 2 ms, size +19%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$2 (took 4 ms, size +44%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$33 (took 3 ms, size +20%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$8 (took 3 ms, size +27%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$9 (took 2 ms, size +27%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$10 (took 4 ms, size +37%)
INFO: Instrumented com.google.gson.internal.LazilyParsedNumber (took 4 ms, size +69%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$35 (took 6 ms, size +24%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$35$1 (took 4 ms, size +27%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$25 (took 3 ms, size +29%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$26 (took 4 ms, size +22%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$26$1 (took 3 ms, size +27%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$34 (took 4 ms, size +20%)
INFO: Instrumented com.google.gson.JsonArray (took 6 ms, size +59%)
INFO: Instrumented com.google.gson.JsonObject (took 4 ms, size +44%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$30 (took 2 ms, size +39%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$EnumTypeAdapter (took 4 ms, size +30%)
INFO: Instrumented com.google.gson.internal.bind.ObjectTypeAdapter (took 4 ms, size +41%)
INFO: Instrumented com.google.gson.internal.bind.ObjectTypeAdapter$1 (took 4 ms, size +27%)
INFO: Instrumented com.google.gson.Gson$4 (took 14 ms, size +25%)
INFO: Instrumented com.google.gson.Gson$5 (took 4 ms, size +36%)
INFO: Instrumented com.google.gson.internal.bind.DateTypeAdapter (took 9 ms, size +35%)
INFO: Instrumented com.google.gson.internal.bind.DateTypeAdapter$1 (took 3 ms, size +29%)
INFO: Instrumented com.google.gson.internal.bind.TimeTypeAdapter (took 5 ms, size +31%)
INFO: Instrumented com.google.gson.internal.bind.TimeTypeAdapter$1 (took 3 ms, size +29%)
INFO: Instrumented com.google.gson.internal.bind.SqlDateTypeAdapter (took 3 ms, size +31%)
INFO: Instrumented com.google.gson.internal.bind.SqlDateTypeAdapter$1 (took 3 ms, size +28%)
INFO: Instrumented com.google.gson.internal.bind.ArrayTypeAdapter (took 7 ms, size +34%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper (took 4 ms, size +31%)
INFO: Instrumented com.google.gson.internal.bind.ArrayTypeAdapter$1 (took 5 ms, size +33%)
INFO: Instrumented com.google.gson.internal.bind.CollectionTypeAdapterFactory (took 3 ms, size +21%)
INFO: Instrumented com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter (took 4 ms, size +28%)
INFO: Instrumented com.google.gson.internal.bind.MapTypeAdapterFactory (took 3 ms, size +23%)
INFO: Instrumented com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter (took 6 ms, size +39%)
INFO: Instrumented com.google.gson.internal.bind.JsonAdapterAnnotationTypeAdapterFactory (took 4 ms, size +27%)
INFO: Instrumented com.google.gson.internal.bind.TreeTypeAdapter (took 9 ms, size +22%)
INFO: Instrumented com.google.gson.internal.bind.ReflectiveTypeAdapterFactory (took 9 ms, size +28%)
INFO: Instrumented com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$BoundField (took 3 ms, size +21%)
INFO: Instrumented com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1 (took 4 ms, size +29%)
INFO: Instrumented com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter (took 4 ms, size +32%)
INFO: libFuzzer ignores flags that start with '--'
Dictionary: 44 entries
INFO: Running with entropic power schedule (0xFF, 100).
INFO: Seed: 3065147706
INFO: Loaded 4 modules   (4096 inline 8-bit counters): 512 [0x7fbb90ef7010, 0x7fbb90ef7210), 512 [0x7fbb90ef7210, 0x7fbb90ef7410), 1024 [0x7fbb90ef7410, 0x7fbb90ef7810), 2048 [0x7fbb90ef7810, 0x7fbb90ef8010),
INFO: Loaded 4 PC tables (4096 PCs): 512 [0x7fbb62fff010,0x7fbb63001010), 512 [0x7fbb63001010,0x7fbb63003010), 1024 [0x7fbb63003010,0x7fbb63007010), 2048 [0x7fbb63007010,0x7fbb6300f010),
INFO: -fork=2: fuzzing in separate process(s)
INFO: -fork=2: 10 seed inputs, starting to fuzz in /tmp/libFuzzerTemp.FuzzWithFork15947.dir
#545: cov: 2054 ft: 2054 corp: 10 exec/s 272 oom/timeout/crash: 0/0/0 time: 6s job: 1 dft_time: 0
#1464: cov: 2730 ft: 3585 corp: 162 exec/s 306 oom/timeout/crash: 0/0/0 time: 10s job: 2 dft_time: 0
#1850: cov: 2845 ft: 4170 corp: 277 exec/s 386 oom/timeout/crash: 0/0/0 time: 19s job: 3 dft_time: 0
INFO: log from the inner process:
INFO: Synchronizing coverage IDs in /tmp/jazzer-rjzvredadvdehcizmmuolhlnhchnqfxs
INFO: Loaded 8649 no-throw method signatures
INFO: Instrumented ValidJsonFuzzer (took 325 ms, size +37%)
INFO: Instrumented com.google.gson.Gson (took 128 ms, size +32%)
INFO: Instrumented com.google.gson.stream.MalformedJsonException (took 13 ms, size +37%)
INFO: Instrumented com.google.gson.JsonIOException (took 28 ms, size +46%)
INFO: Instrumented com.google.gson.JsonParseException (took 8 ms, size +36%)
INFO: Instrumented com.google.gson.JsonSyntaxException (took 41 ms, size +45%)
INFO: New number of inline 8-bit counters: 1024
INFO: Instrumented com.google.gson.stream.JsonReader (took 194 ms, size +85%)
INFO: New number of inline 8-bit counters: 2048
INFO: Instrumented com.google.gson.internal.bind.JsonTreeReader (took 71 ms, size +63%)
INFO: Instrumented com.google.gson.TypeAdapter (took 32 ms, size +25%)
INFO: Instrumented com.google.gson.Gson$3 (took 18 ms, size +29%)
INFO: Instrumented com.google.gson.Gson$1 (took 13 ms, size +29%)
INFO: Instrumented com.google.gson.Gson$2 (took 18 ms, size +29%)
INFO: Instrumented com.google.gson.TypeAdapterFactory (took 11 ms, size +0%)
INFO: Instrumented com.google.gson.JsonElement (took 26 ms, size +32%)
INFO: Instrumented com.google.gson.JsonNull (took 12 ms, size +66%)
INFO: Instrumented com.google.gson.stream.JsonWriter (took 67 ms, size +67%)
INFO: Instrumented com.google.gson.internal.bind.JsonTreeWriter (took 34 ms, size +53%)
INFO: Instrumented com.google.gson.FieldNamingStrategy (took 5 ms, size +0%)
INFO: Instrumented com.google.gson.Gson$FutureTypeAdapter (took 8 ms, size +26%)
INFO: Instrumented com.google.gson.reflect.TypeToken (took 29 ms, size +40%)
INFO: Instrumented com.google.gson.internal.$Gson$Preconditions (took 3 ms, size +50%)
INFO: Instrumented com.google.gson.internal.$Gson$Types (took 44 ms, size +59%)
INFO: Instrumented com.google.gson.internal.Excluder (took 18 ms, size +61%)
INFO: Instrumented com.google.gson.internal.Excluder$1 (took 10 ms, size +31%)
INFO: Instrumented com.google.gson.FieldNamingPolicy (took 4 ms, size +40%)
INFO: Instrumented com.google.gson.FieldNamingPolicy$1 (took 7 ms, size +37%)
INFO: Instrumented com.google.gson.FieldNamingPolicy$2 (took 5 ms, size +34%)
INFO: Instrumented com.google.gson.FieldNamingPolicy$3 (took 2 ms, size +33%)
INFO: Instrumented com.google.gson.FieldNamingPolicy$4 (took 2 ms, size +28%)
INFO: Instrumented com.google.gson.FieldNamingPolicy$5 (took 9 ms, size +28%)
INFO: Instrumented com.google.gson.FieldNamingPolicy$6 (took 5 ms, size +28%)
INFO: Instrumented com.google.gson.LongSerializationPolicy (took 7 ms, size +30%)
INFO: Instrumented com.google.gson.LongSerializationPolicy$1 (took 2 ms, size +39%)
INFO: Instrumented com.google.gson.LongSerializationPolicy$2 (took 4 ms, size +33%)
INFO: New number of inline 8-bit counters: 4096
INFO: Instrumented com.google.gson.JsonPrimitive (took 16 ms, size +81%)
INFO: Instrumented com.google.gson.internal.ConstructorConstructor (took 16 ms, size +33%)
INFO: Instrumented com.google.gson.internal.ObjectConstructor (took 2 ms, size +0%)
INFO: Instrumented com.google.gson.internal.reflect.ReflectionAccessor (took 3 ms, size +57%)
INFO: Instrumented com.google.gson.internal.reflect.PreJava9ReflectionAccessor (took 13 ms, size +44%)
INFO: Instrumented com.google.gson.internal.reflect.UnsafeReflectionAccessor (took 15 ms, size +45%)
INFO: Instrumented com.google.gson.internal.JavaVersion (took 9 ms, size +61%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters (took 12 ms, size +19%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$3 (took 3 ms, size +29%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$4 (took 2 ms, size +31%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$5 (took 10 ms, size +30%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$6 (took 6 ms, size +30%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$7 (took 2 ms, size +30%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$11 (took 6 ms, size +30%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$12 (took 2 ms, size +29%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$13 (took 2 ms, size +29%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$14 (took 2 ms, size +26%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$15 (took 6 ms, size +34%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$16 (took 9 ms, size +30%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$17 (took 2 ms, size +31%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$18 (took 4 ms, size +31%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$19 (took 6 ms, size +31%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$20 (took 6 ms, size +31%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$21 (took 7 ms, size +57%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$22 (took 4 ms, size +56%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$23 (took 5 ms, size +32%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$24 (took 6 ms, size +33%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$27 (took 11 ms, size +75%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$28 (took 3 ms, size +49%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$29 (took 10 ms, size +50%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$1 (took 7 ms, size +23%)
INFO: Instrumented com.google.gson.TypeAdapter$1 (took 14 ms, size +29%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$32 (took 2 ms, size +19%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$2 (took 10 ms, size +44%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$33 (took 3 ms, size +20%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$8 (took 6 ms, size +27%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$9 (took 2 ms, size +27%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$10 (took 3 ms, size +37%)
INFO: Instrumented com.google.gson.internal.LazilyParsedNumber (took 10 ms, size +69%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$35 (took 10 ms, size +24%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$35$1 (took 3 ms, size +27%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$25 (took 4 ms, size +29%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$26 (took 2 ms, size +22%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$26$1 (took 2 ms, size +27%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$34 (took 3 ms, size +20%)
INFO: Instrumented com.google.gson.JsonArray (took 16 ms, size +59%)
INFO: Instrumented com.google.gson.JsonObject (took 12 ms, size +44%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$30 (took 2 ms, size +39%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$EnumTypeAdapter (took 19 ms, size +30%)
INFO: Instrumented com.google.gson.internal.bind.ObjectTypeAdapter (took 5 ms, size +41%)
INFO: Instrumented com.google.gson.internal.bind.ObjectTypeAdapter$1 (took 9 ms, size +27%)
INFO: Instrumented com.google.gson.Gson$4 (took 13 ms, size +25%)
INFO: Instrumented com.google.gson.Gson$5 (took 11 ms, size +36%)
INFO: Instrumented com.google.gson.internal.bind.DateTypeAdapter (took 16 ms, size +35%)
INFO: Instrumented com.google.gson.internal.bind.DateTypeAdapter$1 (took 5 ms, size +29%)
INFO: Instrumented com.google.gson.internal.bind.TimeTypeAdapter (took 10 ms, size +31%)
INFO: Instrumented com.google.gson.internal.bind.TimeTypeAdapter$1 (took 2 ms, size +29%)
INFO: Instrumented com.google.gson.internal.bind.SqlDateTypeAdapter (took 15 ms, size +31%)
INFO: Instrumented com.google.gson.internal.bind.SqlDateTypeAdapter$1 (took 13 ms, size +28%)
INFO: Instrumented com.google.gson.internal.bind.ArrayTypeAdapter (took 10 ms, size +34%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper (took 9 ms, size +31%)
INFO: Instrumented com.google.gson.internal.bind.ArrayTypeAdapter$1 (took 7 ms, size +33%)
INFO: Instrumented com.google.gson.internal.bind.CollectionTypeAdapterFactory (took 5 ms, size +21%)
INFO: Instrumented com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter (took 9 ms, size +28%)
INFO: Instrumented com.google.gson.internal.bind.MapTypeAdapterFactory (took 3 ms, size +23%)
INFO: Instrumented com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter (took 13 ms, size +39%)
INFO: Instrumented com.google.gson.internal.bind.JsonAdapterAnnotationTypeAdapterFactory (took 9 ms, size +27%)
INFO: Instrumented com.google.gson.internal.bind.TreeTypeAdapter (took 5 ms, size +22%)
INFO: Instrumented com.google.gson.internal.bind.ReflectiveTypeAdapterFactory (took 7 ms, size +28%)
INFO: Instrumented com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$BoundField (took 15 ms, size +21%)
INFO: Instrumented com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1 (took 4 ms, size +29%)
INFO: Instrumented com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter (took 17 ms, size +32%)
INFO: libFuzzer ignores flags that start with '--'
Dictionary: 44 entries
INFO: Running with entropic power schedule (0xFF, 100).
INFO: Seed: 3078689727
INFO: Loaded 4 modules   (4096 inline 8-bit counters): 512 [0x7ff492ecc010, 0x7ff492ecc210), 512 [0x7ff492ecc210, 0x7ff492ecc410), 1024 [0x7ff492ecc410, 0x7ff492ecc810), 2048 [0x7ff492ecc810, 0x7ff492ecd010),
INFO: Loaded 4 PC tables (4096 PCs): 512 [0x7ff491aca010,0x7ff491acc010), 512 [0x7ff491acc010,0x7ff491ace010), 1024 [0x7ff491ace010,0x7ff491ad2010), 2048 [0x7ff491ad2010,0x7ff491ada010),
INFO:        0 files found in /tmp/libFuzzerTemp.FuzzWithFork15947.dir/C3
INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 4096 bytes
INFO: New number of inline 8-bit counters: 8192
INFO: Instrumented com.google.json.JsonSanitizer (took 102 ms, size +119%)
INFO: Instrumented com.google.json.JsonSanitizer$UnbracketedComma (took 10 ms, size +39%)
INFO: Instrumented com.google.json.JsonSanitizer$State (took 3 ms, size +39%)
INFO: Instrumented com.google.json.JsonSanitizer$1 (took 2 ms, size +74%)
INFO: Instrumented com.google.gson.internal.JsonReaderInternalAccess (took 2 ms, size +44%)
INFO: Instrumented com.google.gson.stream.JsonReader$1 (took 2 ms, size +53%)
INFO: Instrumented com.google.gson.stream.JsonToken (took 3 ms, size +40%)
INFO: Instrumented com.google.gson.internal.bind.TypeAdapters$36 (took 9 ms, size +81%)
INFO: Instrumented com.google.gson.internal.Primitives (took 20 ms, size +80%)
INFO: seed corpus: files: 12 min: 17b max: 2048b total: 6632b rss: 155Mb
#13 INITED cov: 512 ft: 1781 corp: 12/6632b exec/s: 0 rss: 156Mb
#15 REDUCE cov: 512 ft: 1781 corp: 12/6625b lim: 2048 exec/s: 0 rss: 156Mb L: 53/2048 MS: 2 ChangeBinInt-EraseBytes-
#16 NEW    cov: 512 ft: 1795 corp: 13/6695b lim: 2048 exec/s: 0 rss: 156Mb L: 70/2048 MS: 1 InsertByte-
#17 NEW    cov: 512 ft: 1801 corp: 14/8743b lim: 2048 exec/s: 0 rss: 156Mb L: 2048/2048 MS: 1 ChangeBinInt-
#27 NEW    cov: 512 ft: 1812 corp: 15/8869b lim: 2048 exec/s: 0 rss: 156Mb L: 126/2048 MS: 5 ChangeByte-ChangeASCIIInt-ChangeBit-ChangeBinInt-InsertRepeatedBytes-
#31 NEW    cov: 512 ft: 1830 corp: 16/9119b lim: 2048 exec/s: 0 rss: 156Mb L: 250/2048 MS: 4 ShuffleBytes-ChangeBinInt-CrossOver-CrossOver-
#32 NEW    cov: 512 ft: 1833 corp: 17/11167b lim: 2048 exec/s: 0 rss: 156Mb L: 2048/2048 MS: 1 ChangeBit-
#34 NEW    cov: 512 ft: 1839 corp: 18/11357b lim: 2048 exec/s: 0 rss: 156Mb L: 190/2048 MS: 2 ChangeBit-CMP- DE: "\x00\x1c"-
#35 NEW    cov: 512 ft: 1880 corp: 19/13405b lim: 2048 exec/s: 0 rss: 156Mb L: 2048/2048 MS: 1 CMP- DE: "\x17\x01\x00\x00"-
#36 NEW    cov: 522 ft: 1938 corp: 20/13625b lim: 2048 exec/s: 0 rss: 156Mb L: 220/2048 MS: 1 CrossOver-
#37 NEW    cov: 522 ft: 1939 corp: 21/13642b lim: 2048 exec/s: 0 rss: 156Mb L: 17/2048 MS: 1 ChangeASCIIInt-
#44 NEW    cov: 522 ft: 1964 corp: 22/13663b lim: 2048 exec/s: 0 rss: 156Mb L: 21/2048 MS: 2 PersAutoDict-ChangeBinInt- DE: "\x17\x01\x00\x00"-
#47 NEW    cov: 522 ft: 1969 corp: 23/15711b lim: 2048 exec/s: 0 rss: 156Mb L: 2048/2048 MS: 3 ChangeASCIIInt-ChangeBit-ChangeByte-
#48 NEW    cov: 522 ft: 1986 corp: 24/15899b lim: 2048 exec/s: 0 rss: 156Mb L: 188/2048 MS: 1 InsertRepeatedBytes-
#49 NEW    cov: 522 ft: 2007 corp: 25/15959b lim: 2048 exec/s: 0 rss: 156Mb L: 60/2048 MS: 1 CrossOver-
#50 NEW    cov: 522 ft: 2008 corp: 26/15976b lim: 2048 exec/s: 0 rss: 156Mb L: 17/2048 MS: 1 ChangeBit-
#52 REDUCE cov: 522 ft: 2008 corp: 26/15954b lim: 2048 exec/s: 0 rss: 156Mb L: 31/2048 MS: 2 CMP-EraseBytes- DE: "\x00\x00\x00\x00\x00\x00\x00\x00"-
#53 NEW    cov: 522 ft: 2015 corp: 27/16146b lim: 2048 exec/s: 0 rss: 156Mb L: 192/2048 MS: 1 PersAutoDict- DE: "\x00\x1c"-
#59 NEW    cov: 523 ft: 2034 corp: 28/16176b lim: 2048 exec/s: 0 rss: 156Mb L: 30/2048 MS: 1 CrossOver-
#62 NEW    cov: 523 ft: 2046 corp: 29/17Kb lim: 2048 exec/s: 0 rss: 156Mb L: 2048/2048 MS: 3 ChangeBinInt-ChangeByte-ChangeByte-
#71 NEW    cov: 523 ft: 2053 corp: 30/17Kb lim: 2048 exec/s: 0 rss: 156Mb L: 99/2048 MS: 4 CopyPart-InsertByte-InsertByte-InsertRepeatedBytes-
#75 NEW    cov: 523 ft: 2059 corp: 31/18Kb lim: 2048 exec/s: 0 rss: 156Mb L: 229/2048 MS: 4 ChangeBinInt-ManualDict-PersAutoDict-InsertRepeatedBytes- DE: ":{}"-"\x00\x1c"-
#76 REDUCE cov: 523 ft: 2059 corp: 31/18Kb lim: 2048 exec/s: 0 rss: 156Mb L: 114/2048 MS: 1 EraseBytes-
#78 NEW    cov: 523 ft: 2081 corp: 32/18Kb lim: 2048 exec/s: 0 rss: 156Mb L: 169/2048 MS: 2 InsertRepeatedBytes-CrossOver-
#81 NEW    cov: 523 ft: 2088 corp: 33/18Kb lim: 2048 exec/s: 0 rss: 156Mb L: 61/2048 MS: 3 ChangeBit-ChangeByte-CopyPart-
#82 NEW    cov: 523 ft: 2103 corp: 34/18Kb lim: 2048 exec/s: 0 rss: 156Mb L: 33/2048 MS: 1 CMP- DE: "\x01C"-
#88 NEW    cov: 523 ft: 2111 corp: 35/18Kb lim: 2048 exec/s: 0 rss: 156Mb L: 21/2048 MS: 1 ChangeBinInt-
#89 NEW    cov: 523 ft: 2112 corp: 36/18Kb lim: 2048 exec/s: 0 rss: 156Mb L: 17/2048 MS: 1 EraseBytes-
#91 NEW    cov: 523 ft: 2121 corp: 37/18Kb lim: 2048 exec/s: 0 rss: 156Mb L: 30/2048 MS: 2 ChangeByte-ShuffleBytes-
#93 NEW    cov: 523 ft: 2123 corp: 38/19Kb lim: 2048 exec/s: 0 rss: 156Mb L: 1053/2048 MS: 2 CopyPart-CrossOver-
#98 NEW    cov: 523 ft: 2126 corp: 39/20Kb lim: 2048 exec/s: 0 rss: 160Mb L: 1377/2048 MS: 5 ChangeByte-ChangeByte-CopyPart-ChangeByte-EraseBytes-
#101 NEW    cov: 523 ft: 2132 corp: 40/22Kb lim: 2048 exec/s: 0 rss: 161Mb L: 2048/2048 MS: 3 ShuffleBytes-ChangeBit-ChangeByte-
#108 NEW    cov: 523 ft: 2137 corp: 41/22Kb lim: 2048 exec/s: 0 rss: 162Mb L: 33/2048 MS: 2 PersAutoDict-InsertByte- DE: "\x01C"-
#109 NEW    cov: 524 ft: 2150 corp: 42/22Kb lim: 2048 exec/s: 0 rss: 162Mb L: 95/2048 MS: 1 EraseBytes-
#115 NEW    cov: 524 ft: 2152 corp: 43/22Kb lim: 2048 exec/s: 0 rss: 162Mb L: 34/2048 MS: 1 CMP- DE: "\x01\x00\x00\x00\x00\x00\x00\x00"-
#116 NEW    cov: 524 ft: 2156 corp: 44/24Kb lim: 2048 exec/s: 0 rss: 162Mb L: 1378/2048 MS: 1 InsertByte-
#117 NEW    cov: 524 ft: 2160 corp: 45/24Kb lim: 2048 exec/s: 0 rss: 162Mb L: 62/2048 MS: 1 InsertByte-
#119 NEW    cov: 526 ft: 2169 corp: 46/24Kb lim: 2048 exec/s: 0 rss: 162Mb L: 114/2048 MS: 2 InsertRepeatedBytes-ManualDict- DE: "{\"foo\":t"-
#120 NEW    cov: 526 ft: 2174 corp: 47/26Kb lim: 2048 exec/s: 0 rss: 162Mb L: 2048/2048 MS: 1 ChangeBit-
#124 NEW    cov: 526 ft: 2179 corp: 48/26Kb lim: 2048 exec/s: 0 rss: 162Mb L: 193/2048 MS: 4 ChangeBit-InsertByte-InsertRepeatedBytes-InsertRepeatedBytes-
#125 NEW    cov: 526 ft: 2187 corp: 49/28Kb lim: 2048 exec/s: 0 rss: 162Mb L: 2048/2048 MS: 1 CopyPart-
#126 NEW    cov: 530 ft: 2196 corp: 50/28Kb lim: 2048 exec/s: 0 rss: 162Mb L: 17/2048 MS: 1 ChangeBit-
#132 NEW    cov: 530 ft: 2197 corp: 51/28Kb lim: 2048 exec/s: 0 rss: 162Mb L: 56/2048 MS: 1 InsertRepeatedBytes-
#133 REDUCE cov: 530 ft: 2197 corp: 51/27Kb lim: 2048 exec/s: 0 rss: 162Mb L: 761/2048 MS: 1 CrossOver-
#136 NEW    cov: 530 ft: 2199 corp: 52/27Kb lim: 2048 exec/s: 0 rss: 162Mb L: 12/2048 MS: 3 ChangeBinInt-EraseBytes-ManualDict- DE: "[0]"-
#137 NEW    cov: 530 ft: 2205 corp: 53/29Kb lim: 2048 exec/s: 0 rss: 162Mb L: 1893/2048 MS: 1 ShuffleBytes-
#138 NEW    cov: 531 ft: 2211 corp: 54/29Kb lim: 2048 exec/s: 0 rss: 162Mb L: 142/2048 MS: 1 InsertRepeatedBytes-
#139 NEW    cov: 531 ft: 2214 corp: 55/31Kb lim: 2048 exec/s: 0 rss: 162Mb L: 2048/2048 MS: 1 ChangeBit-
#140 NEW    cov: 531 ft: 2217 corp: 56/33Kb lim: 2048 exec/s: 0 rss: 162Mb L: 2048/2048 MS: 1 ChangeBinInt-
#143 NEW    cov: 531 ft: 2239 corp: 57/33Kb lim: 2048 exec/s: 0 rss: 162Mb L: 179/2048 MS: 3 CrossOver-ChangeASCIIInt-CrossOver-
#148 NEW    cov: 531 ft: 2243 corp: 58/33Kb lim: 2048 exec/s: 0 rss: 162Mb L: 17/2048 MS: 5 ChangeBinInt-ChangeBinInt-PersAutoDict-PersAutoDict-ChangeByte- DE: "\x01\x00\x00\x00\x00\x00\x00\x00"-"\x00\x00\x00\x00\x00\x00\x00\x00"-
#152 NEW    cov: 531 ft: 2274 corp: 59/35Kb lim: 2048 exec/s: 0 rss: 162Mb L: 2048/2048 MS: 4 ChangeBit-ChangeASCIIInt-ChangeASCIIInt-PersAutoDict- DE: ":{}"-
#153 NEW    cov: 531 ft: 2276 corp: 60/35Kb lim: 2048 exec/s: 0 rss: 162Mb L: 85/2048 MS: 1 CopyPart-
#156 NEW    cov: 531 ft: 2278 corp: 61/35Kb lim: 2048 exec/s: 0 rss: 162Mb L: 33/2048 MS: 3 ChangeBit-ShuffleBytes-ShuffleBytes-
#158 NEW    cov: 531 ft: 2288 corp: 62/37Kb lim: 2048 exec/s: 0 rss: 162Mb L: 2048/2048 MS: 2 ChangeBit-CrossOver-
#159 NEW    cov: 531 ft: 2293 corp: 63/39Kb lim: 2048 exec/s: 0 rss: 162Mb L: 2048/2048 MS: 1 ChangeBit-
#160 NEW    cov: 533 ft: 2309 corp: 64/39Kb lim: 2048 exec/s: 0 rss: 162Mb L: 30/2048 MS: 1 PersAutoDict- DE: "\x01\x00\x00\x00\x00\x00\x00\x00"-
#161 NEW    cov: 533 ft: 2310 corp: 65/39Kb lim: 2048 exec/s: 0 rss: 162Mb L: 126/2048 MS: 1 CrossOver-
#162 NEW    cov: 533 ft: 2311 corp: 66/39Kb lim: 2048 exec/s: 0 rss: 162Mb L: 99/2048 MS: 1 ChangeByte-
#166 NEW    cov: 533 ft: 2313 corp: 67/39Kb lim: 2048 exec/s: 0 rss: 162Mb L: 24/2048 MS: 4 CopyPart-ShuffleBytes-ShuffleBytes-ChangeBinInt-
#177 NEW    cov: 533 ft: 2327 corp: 68/40Kb lim: 2048 exec/s: 0 rss: 162Mb L: 86/2048 MS: 1 InsertRepeatedBytes-
#186 NEW    cov: 533 ft: 2328 corp: 69/42Kb lim: 2048 exec/s: 0 rss: 163Mb L: 2048/2048 MS: 4 ChangeByte-ChangeBit-ShuffleBytes-ChangeBinInt-
#187 NEW    cov: 533 ft: 2329 corp: 70/42Kb lim: 2048 exec/s: 0 rss: 163Mb L: 62/2048 MS: 1 ChangeBinInt-
#189 NEW    cov: 533 ft: 2331 corp: 71/42Kb lim: 2048 exec/s: 0 rss: 163Mb L: 192/2048 MS: 2 ManualDict-ChangeBit- DE: "//"-
#195 NEW    cov: 533 ft: 2332 corp: 72/43Kb lim: 2048 exec/s: 0 rss: 164Mb L: 1173/2048 MS: 1 EraseBytes-
#196 NEW    cov: 533 ft: 2335 corp: 73/43Kb lim: 2048 exec/s: 0 rss: 164Mb L: 61/2048 MS: 1 CopyPart-
#199 NEW    cov: 533 ft: 2338 corp: 74/43Kb lim: 2048 exec/s: 0 rss: 164Mb L: 200/2048 MS: 3 ChangeASCIIInt-InsertRepeatedBytes-ManualDict- DE: "\\uDBFF\\uDFFF"-
#200 NEW    cov: 552 ft: 2409 corp: 75/43Kb lim: 2048 exec/s: 0 rss: 164Mb L: 18/2048 MS: 1 InsertByte-
#202 NEW    cov: 552 ft: 2411 corp: 76/44Kb lim: 2048 exec/s: 0 rss: 164Mb L: 283/2048 MS: 2 ChangeByte-InsertRepeatedBytes-
#203 NEW    cov: 552 ft: 2412 corp: 77/44Kb lim: 2048 exec/s: 0 rss: 164Mb L: 229/2048 MS: 1 ChangeBit-
#219 NEW    cov: 552 ft: 2413 corp: 78/44Kb lim: 2048 exec/s: 0 rss: 164Mb L: 38/2048 MS: 1 PersAutoDict- DE: "\x17\x01\x00\x00"-
#223 NEW    cov: 552 ft: 2414 corp: 79/46Kb lim: 2048 exec/s: 0 rss: 164Mb L: 2048/2048 MS: 4 ChangeByte-ChangeASCIIInt-ChangeASCIIInt-ChangeByte-
#227 NEW    cov: 552 ft: 2415 corp: 80/48Kb lim: 2048 exec/s: 0 rss: 164Mb L: 2048/2048 MS: 4 ShuffleBytes-ChangeBinInt-ChangeASCIIInt-ShuffleBytes-
#228 NEW    cov: 552 ft: 2416 corp: 81/48Kb lim: 2048 exec/s: 0 rss: 164Mb L: 129/2048 MS: 1 ManualDict- DE: "\"\":"-
#229 NEW    cov: 552 ft: 2419 corp: 82/48Kb lim: 2048 exec/s: 0 rss: 164Mb L: 21/2048 MS: 1 ManualDict- DE: "7"-
#230 NEW    cov: 552 ft: 2421 corp: 83/48Kb lim: 2048 exec/s: 0 rss: 164Mb L: 38/2048 MS: 1 PersAutoDict- DE: "\x00\x00\x00\x00\x00\x00\x00\x00"-
#236 NEW    cov: 552 ft: 2424 corp: 84/50Kb lim: 2048 exec/s: 0 rss: 164Mb L: 1893/2048 MS: 1 ChangeBinInt-
#237 REDUCE cov: 552 ft: 2424 corp: 84/50Kb lim: 2048 exec/s: 0 rss: 164Mb L: 152/2048 MS: 1 EraseBytes-
#243 REDUCE cov: 552 ft: 2424 corp: 84/50Kb lim: 2048 exec/s: 0 rss: 164Mb L: 80/2048 MS: 1 EraseBytes-
#245 NEW    cov: 552 ft: 2430 corp: 85/52Kb lim: 2048 exec/s: 0 rss: 164Mb L: 1763/2048 MS: 2 PersAutoDict-EraseBytes- DE: "\x01C"-
#246 NEW    cov: 552 ft: 2438 corp: 86/52Kb lim: 2048 exec/s: 0 rss: 164Mb L: 12/2048 MS: 1 PersAutoDict- DE: "//"-
#247 NEW    cov: 552 ft: 2439 corp: 87/52Kb lim: 2048 exec/s: 0 rss: 164Mb L: 33/2048 MS: 1 ChangeByte-
#249 NEW    cov: 563 ft: 2475 corp: 88/52Kb lim: 2048 exec/s: 0 rss: 164Mb L: 31/2048 MS: 2 CopyPart-InsertByte-
#252 NEW    cov: 563 ft: 2476 corp: 89/52Kb lim: 2048 exec/s: 0 rss: 164Mb L: 38/2048 MS: 3 ChangeBit-CMP-ChangeBinInt- DE: "\x01\x00\x00\x00\x00\x00\x00\x00"-
#253 NEW    cov: 563 ft: 2477 corp: 90/52Kb lim: 2048 exec/s: 0 rss: 164Mb L: 190/2048 MS: 1 ChangeBinInt-
#254 REDUCE cov: 563 ft: 2477 corp: 90/52Kb lim: 2048 exec/s: 0 rss: 164Mb L: 34/2048 MS: 1 EraseBytes-
#257 NEW    cov: 563 ft: 2485 corp: 91/52Kb lim: 2048 exec/s: 0 rss: 164Mb L: 134/2048 MS: 3 ChangeBinInt-CopyPart-PersAutoDict- DE: "\x00\x00\x00\x00\x00\x00\x00\x00"-
#258 NEW    cov: 563 ft: 2486 corp: 92/52Kb lim: 2048 exec/s: 0 rss: 164Mb L: 60/2048 MS: 1 CrossOver-
#262 NEW    cov: 563 ft: 2488 corp: 93/52Kb lim: 2048 exec/s: 0 rss: 164Mb L: 129/2048 MS: 4 InsertRepeatedBytes-EraseBytes-ChangeASCIIInt-InsertRepeatedBytes-
#268 NEW    cov: 563 ft: 2495 corp: 94/52Kb lim: 2048 exec/s: 0 rss: 164Mb L: 223/2048 MS: 1 InsertRepeatedBytes-
#273 NEW    cov: 563 ft: 2500 corp: 95/52Kb lim: 2048 exec/s: 0 rss: 164Mb L: 30/2048 MS: 5 CopyPart-ShuffleBytes-CMP-CopyPart-InsertByte- DE: "\x01\x00\x00\x00\x00\x00\x00\x00"-
#275 NEW    cov: 563 ft: 2509 corp: 96/52Kb lim: 2048 exec/s: 0 rss: 164Mb L: 33/2048 MS: 2 ChangeBinInt-ChangeByte-
#276 NEW    cov: 563 ft: 2513 corp: 97/53Kb lim: 2048 exec/s: 0 rss: 164Mb L: 142/2048 MS: 1 ManualDict- DE: "\\"-
#277 REDUCE cov: 563 ft: 2515 corp: 98/53Kb lim: 2048 exec/s: 0 rss: 164Mb L: 60/2048 MS: 1 EraseBytes-
#286 NEW    cov: 563 ft: 2517 corp: 99/53Kb lim: 2048 exec/s: 0 rss: 164Mb L: 155/2048 MS: 4 InsertRepeatedBytes-CMP-ChangeASCIIInt-CrossOver- DE: "FFE7"-
#292 REDUCE cov: 563 ft: 2517 corp: 99/53Kb lim: 2048 exec/s: 0 rss: 164Mb L: 9/2048 MS: 1 EraseBytes-
#293 NEW    cov: 563 ft: 2522 corp: 100/53Kb lim: 2048 exec/s: 0 rss: 164Mb L: 33/2048 MS: 1 CopyPart-
#294 NEW    cov: 563 ft: 2524 corp: 101/53Kb lim: 2048 exec/s: 0 rss: 164Mb L: 145/2048 MS: 1 ManualDict- DE: "@id"-
#301 NEW    cov: 563 ft: 2526 corp: 102/53Kb lim: 2048 exec/s: 0 rss: 164Mb L: 63/2048 MS: 2 ManualDict-ManualDict- DE: "\\n"-":"-
#304 REDUCE cov: 563 ft: 2526 corp: 102/53Kb lim: 2048 exec/s: 0 rss: 164Mb L: 24/2048 MS: 3 ChangeBinInt-CopyPart-EraseBytes-
#308 NEW    cov: 564 ft: 2528 corp: 103/53Kb lim: 2048 exec/s: 0 rss: 164Mb L: 35/2048 MS: 4 InsertByte-ManualDict-InsertByte-ManualDict- DE: "[]"-"\\"-
#311 NEW    cov: 564 ft: 2548 corp: 104/55Kb lim: 2048 exec/s: 0 rss: 164Mb L: 2048/2048 MS: 3 ChangeByte-ChangeBinInt-ChangeByte-
#312 NEW    cov: 564 ft: 2576 corp: 105/57Kb lim: 2048 exec/s: 0 rss: 164Mb L: 1601/2048 MS: 1 EraseBytes-
#315 REDUCE cov: 564 ft: 2576 corp: 105/57Kb lim: 2048 exec/s: 0 rss: 164Mb L: 2034/2048 MS: 3 ChangeBinInt-ChangeBit-EraseBytes-
#316 NEW    cov: 564 ft: 2581 corp: 106/58Kb lim: 2048 exec/s: 0 rss: 164Mb L: 1773/2048 MS: 1 CrossOver-
#324 NEW    cov: 564 ft: 2590 corp: 107/58Kb lim: 2048 exec/s: 0 rss: 164Mb L: 18/2048 MS: 3 ChangeASCIIInt-ChangeByte-ChangeByte-
#328 NEW    cov: 564 ft: 2592 corp: 108/59Kb lim: 2048 exec/s: 0 rss: 164Mb L: 306/2048 MS: 4 ShuffleBytes-InsertByte-InsertRepeatedBytes-CopyPart-
#329 NEW    cov: 564 ft: 2593 corp: 109/59Kb lim: 2048 exec/s: 0 rss: 164Mb L: 191/2048 MS: 1 InsertByte-
#330 NEW    cov: 564 ft: 2594 corp: 110/60Kb lim: 2048 exec/s: 0 rss: 164Mb L: 1173/2048 MS: 1 ShuffleBytes-
#333 NEW    cov: 564 ft: 2595 corp: 111/60Kb lim: 2048 exec/s: 0 rss: 164Mb L: 63/2048 MS: 3 ChangeByte-InsertByte-ChangeByte-
#336 NEW    cov: 564 ft: 2604 corp: 112/61Kb lim: 2048 exec/s: 0 rss: 164Mb L: 1398/2048 MS: 3 ChangeBinInt-ChangeBinInt-EraseBytes-
#340 NEW    cov: 566 ft: 2607 corp: 113/61Kb lim: 2048 exec/s: 0 rss: 164Mb L: 36/2048 MS: 4 InsertByte-ChangeByte-ChangeASCIIInt-ChangeByte-
#342 NEW    cov: 566 ft: 2610 corp: 114/61Kb lim: 2048 exec/s: 0 rss: 164Mb L: 56/2048 MS: 2 ChangeByte-ChangeByte-
#350 NEW    cov: 566 ft: 2616 corp: 115/62Kb lim: 2048 exec/s: 0 rss: 164Mb L: 223/2048 MS: 3 ShuffleBytes-ChangeByte-PersAutoDict- DE: "\\n"-
#352 REDUCE cov: 566 ft: 2619 corp: 116/64Kb lim: 2048 exec/s: 0 rss: 164Mb L: 2034/2048 MS: 2 ShuffleBytes-PersAutoDict- DE: "FFE7"-
#353 REDUCE cov: 566 ft: 2622 corp: 117/64Kb lim: 2048 exec/s: 0 rss: 164Mb L: 180/2048 MS: 1 InsertRepeatedBytes-
#356 NEW    cov: 566 ft: 2623 corp: 118/65Kb lim: 2048 exec/s: 0 rss: 164Mb L: 1173/2048 MS: 3 ChangeByte-ChangeByte-ChangeBinInt-
#360 REDUCE cov: 569 ft: 2631 corp: 119/65Kb lim: 2048 exec/s: 0 rss: 164Mb L: 156/2048 MS: 4 ChangeByte-ChangeByte-ChangeBinInt-ManualDict- DE: "\\x00"-
#361 NEW    cov: 569 ft: 2633 corp: 120/67Kb lim: 2048 exec/s: 0 rss: 164Mb L: 2048/2048 MS: 1 CopyPart-
#362 NEW    cov: 582 ft: 2663 corp: 121/68Kb lim: 2048 exec/s: 0 rss: 164Mb L: 1173/2048 MS: 1 ChangeByte-
#363 NEW    cov: 582 ft: 2665 corp: 122/68Kb lim: 2048 exec/s: 0 rss: 164Mb L: 61/2048 MS: 1 ChangeBinInt-
#364 NEW    cov: 582 ft: 2666 corp: 123/68Kb lim: 2048 exec/s: 0 rss: 164Mb L: 38/2048 MS: 1 CopyPart-
#366 NEW    cov: 582 ft: 2667 corp: 124/70Kb lim: 2048 exec/s: 366 rss: 164Mb L: 2048/2048 MS: 2 CopyPart-ChangeBit-
#367 NEW    cov: 582 ft: 2668 corp: 125/72Kb lim: 2048 exec/s: 367 rss: 164Mb L: 2048/2048 MS: 1 ChangeBit-
#369 NEW    cov: 586 ft: 2676 corp: 126/73Kb lim: 2048 exec/s: 369 rss: 164Mb L: 296/2048 MS: 2 PersAutoDict-CrossOver- DE: ":"-
#370 NEW    cov: 586 ft: 2678 corp: 127/74Kb lim: 2048 exec/s: 370 rss: 164Mb L: 1775/2048 MS: 1 ManualDict- DE: "[]"-
#373 NEW    cov: 586 ft: 2679 corp: 128/74Kb lim: 2048 exec/s: 373 rss: 164Mb L: 54/2048 MS: 3 CopyPart-InsertByte-InsertRepeatedBytes-
#377 NEW    cov: 586 ft: 2685 corp: 129/75Kb lim: 2048 exec/s: 377 rss: 164Mb L: 216/2048 MS: 4 ShuffleBytes-InsertRepeatedBytes-CMP-CopyPart- DE: "\xf33333334"-
#383 NEW    cov: 586 ft: 2690 corp: 130/75Kb lim: 2048 exec/s: 383 rss: 165Mb L: 229/2048 MS: 1 ChangeByte-
#384 NEW    cov: 586 ft: 2692 corp: 131/77Kb lim: 2048 exec/s: 384 rss: 165Mb L: 2048/2048 MS: 1 ChangeBit-
#385 NEW    cov: 586 ft: 2725 corp: 132/77Kb lim: 2048 exec/s: 385 rss: 165Mb L: 145/2048 MS: 1 CrossOver-
INFO: Instrumented com.google.gson.internal.LinkedTreeMap (took 39 ms, size +50%)
ValidJsonFuzzer:0:11
com/google/gson/Gson:11:277
com/google/gson/stream/MalformedJsonException:288:5
com/google/gson/JsonIOException:293:6
com/google/gson/JsonParseException:299:3
com/google/gson/JsonSyntaxException:302:6
com/google/gson/stream/JsonReader:308:568
com/google/gson/internal/bind/JsonTreeReader:876:166
com/google/gson/TypeAdapter:1042:26
com/google/gson/Gson$3:1068:15
com/google/gson/Gson$1:1083:16
com/google/gson/Gson$2:1099:16
com/google/gson/TypeAdapterFactory:1115:0
com/google/gson/JsonElement:1115:34
com/google/gson/JsonNull:1149:13
com/google/gson/stream/JsonWriter:1162:177
com/google/gson/internal/bind/JsonTreeWriter:1339:94
com/google/gson/FieldNamingStrategy:1433:0
com/google/gson/Gson$FutureTypeAdapter:1433:10
com/google/gson/reflect/TypeToken:1443:111
com/google/gson/internal/$Gson$Preconditions:1554:5
com/google/gson/internal/$Gson$Types:1559:217
com/google/gson/internal/Excluder:1776:142
com/google/gson/internal/Excluder$1:1918:16
com/google/gson/FieldNamingPolicy:1934:35
com/google/gson/FieldNamingPolicy$1:1969:3
com/google/gson/FieldNamingPolicy$2:1972:4
com/google/gson/FieldNamingPolicy$3:1976:5
com/google/gson/FieldNamingPolicy$4:1981:4
com/google/gson/FieldNamingPolicy$5:1985:4
com/google/gson/FieldNamingPolicy$6:1989:4
com/google/gson/LongSerializationPolicy:1993:11
com/google/gson/LongSerializationPolicy$1:2004:4
com/google/gson/LongSerializationPolicy$2:2008:4
com/google/gson/JsonPrimitive:2012:129
com/google/gson/internal/ConstructorConstructor:2141:63
com/google/gson/internal/ObjectConstructor:2204:0
com/google/gson/internal/reflect/ReflectionAccessor:2204:8
com/google/gson/internal/reflect/PreJava9ReflectionAccessor:2212:4
com/google/gson/internal/reflect/UnsafeReflectionAccessor:2216:31
com/google/gson/internal/JavaVersion:2247:32
com/google/gson/internal/bind/TypeAdapters:2279:70
com/google/gson/internal/bind/TypeAdapters$3:2349:15
com/google/gson/internal/bind/TypeAdapters$4:2364:15
com/google/gson/internal/bind/TypeAdapters$5:2379:16
com/google/gson/internal/bind/TypeAdapters$6:2395:16
com/google/gson/internal/bind/TypeAdapters$7:2411:16
com/google/gson/internal/bind/TypeAdapters$11:2427:16
com/google/gson/internal/bind/TypeAdapters$12:2443:13
com/google/gson/internal/bind/TypeAdapters$13:2456:13
com/google/gson/internal/bind/TypeAdapters$14:2469:17
com/google/gson/internal/bind/TypeAdapters$15:2486:18
com/google/gson/internal/bind/TypeAdapters$16:2504:15
com/google/gson/internal/bind/TypeAdapters$17:2519:17
com/google/gson/internal/bind/TypeAdapters$18:2536:17
com/google/gson/internal/bind/TypeAdapters$19:2553:15
com/google/gson/internal/bind/TypeAdapters$20:2568:15
com/google/gson/internal/bind/TypeAdapters$21:2583:18
com/google/gson/internal/bind/TypeAdapters$22:2601:21
com/google/gson/internal/bind/TypeAdapters$23:2622:16
com/google/gson/internal/bind/TypeAdapters$24:2638:16
com/google/gson/internal/bind/TypeAdapters$27:2654:47
com/google/gson/internal/bind/TypeAdapters$28:2701:32
com/google/gson/internal/bind/TypeAdapters$29:2733:84
com/google/gson/internal/bind/TypeAdapters$1:2817:8
com/google/gson/TypeAdapter$1:2825:12
com/google/gson/internal/bind/TypeAdapters$32:2837:6
com/google/gson/internal/bind/TypeAdapters$2:2843:42
com/google/gson/internal/bind/TypeAdapters$33:2885:8
com/google/gson/internal/bind/TypeAdapters$8:2893:12
com/google/gson/internal/bind/TypeAdapters$9:2905:10
com/google/gson/internal/bind/TypeAdapters$10:2915:26
com/google/gson/internal/LazilyParsedNumber:2941:27
com/google/gson/internal/bind/TypeAdapters$35:2968:7
com/google/gson/internal/bind/TypeAdapters$35$1:2975:10
com/google/gson/internal/bind/TypeAdapters$25:2985:11
com/google/gson/internal/bind/TypeAdapters$26:2996:6
com/google/gson/internal/bind/TypeAdapters$26$1:3002:13
com/google/gson/internal/bind/TypeAdapters$34:3015:8
com/google/gson/JsonArray:3023:110
com/google/gson/JsonObject:3133:67
com/google/gson/internal/bind/TypeAdapters$30:3200:10
com/google/gson/internal/bind/TypeAdapters$EnumTypeAdapter:3210:32
com/google/gson/internal/bind/ObjectTypeAdapter:3242:41
com/google/gson/internal/bind/ObjectTypeAdapter$1:3283:5
com/google/gson/Gson$4:3288:10
com/google/gson/Gson$5:3298:23
com/google/gson/internal/bind/DateTypeAdapter:3321:39
com/google/gson/internal/bind/DateTypeAdapter$1:3360:6
com/google/gson/internal/bind/TimeTypeAdapter:3366:23
com/google/gson/internal/bind/TimeTypeAdapter$1:3389:6
com/google/gson/internal/bind/SqlDateTypeAdapter:3395:23
com/google/gson/internal/bind/SqlDateTypeAdapter$1:3418:6
com/google/gson/internal/bind/ArrayTypeAdapter:3424:31
com/google/gson/internal/bind/TypeAdapterRuntimeTypeWrapper:3455:20
com/google/gson/internal/bind/ArrayTypeAdapter$1:3475:13
com/google/gson/internal/bind/CollectionTypeAdapterFactory:3488:11
com/google/gson/internal/bind/CollectionTypeAdapterFactory$Adapter:3499:28
com/google/gson/internal/bind/MapTypeAdapterFactory:3527:20
com/google/gson/internal/bind/MapTypeAdapterFactory$Adapter:3547:103
com/google/gson/internal/bind/JsonAdapterAnnotationTypeAdapterFactory:3650:29
com/google/gson/internal/bind/TreeTypeAdapter:3679:35
com/google/gson/internal/bind/ReflectiveTypeAdapterFactory:3714:78
com/google/gson/internal/bind/ReflectiveTypeAdapterFactory$BoundField:3792:1
com/google/gson/internal/bind/ReflectiveTypeAdapterFactory$1:3793:21
com/google/gson/internal/bind/ReflectiveTypeAdapterFactory$Adapter:3814:39
com/google/json/JsonSanitizer:3853:651
com/google/json/JsonSanitizer$UnbracketedComma:4504:3
com/google/json/JsonSanitizer$State:4507:17
com/google/json/JsonSanitizer$1:4524:27
com/google/gson/internal/JsonReaderInternalAccess:4551:1
com/google/gson/stream/JsonReader$1:4552:14
com/google/gson/stream/JsonToken:4566:17
com/google/gson/internal/bind/TypeAdapters$36:4583:33
com/google/gson/internal/Primitives:4616:38
com/google/gson/internal/LinkedTreeMap:4654:195
com/google/gson/internal/LinkedTreeMap$1:4849:5
com/google/gson/internal/LinkedTreeMap$1:4849:5
com/google/gson/internal/LinkedTreeMap$Node:4854:33
ERROR: Coverage IDs are out of sync
com.code_intelligence.jazzer.agent.CoverageIdException: Failed to synchronize coverage IDs
 at com.code_intelligence.jazzer.agent.SynchronizedCoverageIdStrategy.obtainFirstId(CoverageIdStrategy.kt:164)
 at com.code_intelligence.jazzer.agent.RuntimeInstrumentor.instrument(RuntimeInstrumentor.kt:156)
 at com.code_intelligence.jazzer.agent.RuntimeInstrumentor.transformInternal(RuntimeInstrumentor.kt:126)
 at com.code_intelligence.jazzer.agent.RuntimeInstrumentor.transform(RuntimeInstrumentor.kt:106)
 at java.instrument/java.lang.instrument.ClassFileTransformer.transform(ClassFileTransformer.java:246)
 at java.instrument/sun.instrument.TransformerManager.transform(TransformerManager.java:188)
 at java.instrument/sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:563)
 at java.base/java.lang.ClassLoader.defineClass1(Native Method)
 at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
 at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
 at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:825)
 at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:723)
 at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:646)
 at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:604)
 at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168)
 at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
 at com.google.gson.internal.LinkedTreeMap.<clinit>(LinkedTreeMap.java:40)
 at com.google.gson.JsonObject.<init>(JsonObject.java:33)
 at com.google.gson.internal.bind.TypeAdapters$29.read(TypeAdapters.java:720)
 at com.google.gson.internal.bind.TypeAdapters$29.read(TypeAdapters.java:698)
 at com.google.gson.internal.bind.TypeAdapters$35$1.read(TypeAdapters.java:894)
 at com.google.gson.Gson.fromJson(Gson.java:932)
 at com.google.gson.Gson.fromJson(Gson.java:897)
 at com.google.gson.Gson.fromJson(Gson.java:846)
 at com.google.gson.Gson.fromJson(Gson.java:817)
 at ValidJsonFuzzer.fuzzerTestOneInput(ValidJsonFuzzer.java:42)
Caused by: java.lang.IllegalStateException: Multiple entries for com/google/gson/internal/LinkedTreeMap$1 in ID file
 at com.code_intelligence.jazzer.agent.SynchronizedCoverageIdStrategy.obtainFirstId(CoverageIdStrategy.kt:160)
 ... 25 more
==16069== ERROR: libFuzzer: fuzz target exited
SUMMARY: libFuzzer: fuzz target exited
MS: 1 CrossOver-; base unit: 68a520d0869334d38917c788260bdf8e111ebcd6
0x8c,0x8c,0x8c,0x8c,0x8c,0x8c,0x8c,0x8c,0x8c,0x8c,0x8c,0x8c,0x8c,0x8c,0x8c,0x8c,0x8c,0x8c,0x8c,0xbd,0xbd,0xbd,0xbd,0xbd,0xbd,0xbd,0xbd,0xbd,0xbd,0xbd,0xbd,0xbd,0xbd,0xbd,0xbd,0xbd,0xbd,0xbd,0xbd,0xbd,0xbd,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x3a,0x7b,0x7d,0x99,0x4f,0x4f,0x4f,0x4f,0x4f,0x6e,0x74,0x65,0x2b,0x74,0x4f,0x4f,0x5c,0x41,0x33,
\x8c\x8c\x8c\x8c\x8c\x8c\x8c\x8c\x8c\x8c\x8c\x8c\x8c\x8c\x8c\x8c\x8c\x8c\x8c\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xbd\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99\x99:{}\x99OOOOOnte+tOO\\A3
artifact_prefix='/mnt/scratch0/clusterfuzz/bot/inputs/fuzzer-testcases/'; Test unit written to /mnt/scratch0/clusterfuzz/bot/inputs/fuzzer-testcases/crash-9c654f80c310e4ab3a3d60fef120719a45053a3d
Base64: jIyMjIyMjIyMjIyMjIyMjIyMjL29vb29vb29vb29vb29vb29vb29vb3//////////////////////////////5mZmZmZmZmZmZmZmTp7fZlPT09PT250ZSt0T09cQTM=
stat::number_of_executed_units: 386
stat::average_exec_per_sec:     386
stat::new_units_added:          130
stat::slowest_unit_time_sec:    0
stat::peak_rss_mb:              166
INFO: exiting: 77 time: 22s

Understand macOS test incompatibilities

TODO:

  • fix shared library suffix on osx (ExampleFuzzerWithNative)
  • get in touch with libFuzzer to see if it could have better exit code support on OSX (JpegImageParserFuzzer)
  • investigate if stack overflow support on OSX could be improved (ExampleStackOverflowFuzzer)

Bazel report:

//examples:ExampleFuzzerWithNative                                       FAILED in 3.0s
//examples:ExampleStackOverflowFuzzer                                    FAILED in 2.3s
//examples:JpegImageParserFuzzer                                         FAILED in 23.0s

ExampleFuzzerWithNative and ExampleStackOverflowFuzzer fail with Unexpected exit code: 139 and no other useful output.

JpegImageParserFuzzer really starts fuzzing, discovers java.lang.NegativeArraySizeException and then fails with Unexpected exit code: 0

`UnsatisfiedLinkError` if there is no class to instrument

❯ bazel run //:jazzer -- --autofuzz=java.util.regex.Pattern::compile 
INFO: Invocation ID: 1fd163aa-afe7-4555-b345-b1d2d9533867
INFO: Analyzed target //:jazzer (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //driver:jazzer_driver up-to-date:
  bazel-bin/driver/jazzer_driver
INFO: Elapsed time: 0.113s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
INFO: Loaded 8 hooks from com.code_intelligence.jazzer.sanitizers.Deserialization
INFO: Loaded 3 hooks from com.code_intelligence.jazzer.sanitizers.ExpressionLanguageInjection
INFO: Loaded 8 hooks from com.code_intelligence.jazzer.sanitizers.NamingContextLookup
INFO: Loaded 1 hooks from com.code_intelligence.jazzer.sanitizers.OsCommandInjection
INFO: Loaded 1 hooks from com.code_intelligence.jazzer.sanitizers.ReflectiveCall
INFO: Loaded 1 hooks from com.code_intelligence.jazzer.sanitizers.RegexInjection
Exception in thread "main" java.lang.UnsatisfiedLinkError: 'void com.code_intelligence.jazzer.runtime.CoverageMap.initialize(long)'
	at com.code_intelligence.jazzer.runtime.CoverageMap.initialize(Native Method)
	at com.code_intelligence.jazzer.runtime.CoverageMap.<clinit>(CoverageMap.java:55)
	at com.code_intelligence.jazzer.instrumentor.CoverageRecorder.updateCoveredIdsWithCoverageMap(CoverageRecorder.kt:60)
terminate called after throwing an instance of 'std::runtime_error'
  what():  Java exception occurred in CoverageTracker JNI code

Test Inputs Generation

I'm starting to use jazzer, but I am interested to know if there is any way to obtain as well the inputs that do not find crashes, that is, all the provided inputs for the target prior to the crash.

Support advanced libFuzzer arguments with @FuzzTest

Makes sense. I've been using -merge to save off different corpus directories at different stages and then merge them back into one corpus later on. I guess I was wondering more generally about all the LibFuzzer single-dash options, which the CLI docs seem to punt as "just go read the LibFuzzer docs and do whatever you want", so I was wondering if the same approach was planned here... -merge being the main place where I've taken advantage of this flexibility (so far).

Originally posted by @gredler in #475 (comment)

I don't have a fully fleshed out plan yet for how to deal with these "advanced" libFuzzer flags. I would like to keep them out of the @fuzztest annotation, which should offer a friendly UX to users new to fuzzing. Instead, I'm thinking of making Jazzer available as a standalone JAR used from the CLI and/or making it possible to tune libFuzzer arguments via system properties.

_Originally posted by @fmeum

Reproducers for mutation graph entries

Currently, the reproducers are only created for the crashes. Would it be possible to have an option for also including the mutation graph or all of the inputs? Currently I've tweaked the code locally to get reproducers for every test case when I only want the mutation graph entries. For longer fuzzing runs, storage problems can be expected.

out-of-memory in ExampleFuzzer with keep_going

Please check the ExampleFuzzer with option --keep_going more than 1.

java_fuzz_target_test(
    name = "ExampleFuzzer",
    ...
    fuzzer_args = [
        "--keep_going=10",
    ],
)

With export JAVA_OPTS='-verbose:gc' I can see that heap is full after a few minutes.
Checked on 3b473ad

$ BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 ./bazelisk run --config=toolchain --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux //examples:ExampleFuzzer
...
[Full GC (Ergonomics)  1519600K->1519599K(1677312K), 1.4917747 secs]
[Full GC (Ergonomics)  1519600K->1519527K(1677312K), 3.3910757 secs]
[Full GC (Ergonomics)  1519529K->1519528K(1677312K), 1.4910728 secs]
[Full GC (Ergonomics)  1519529K->1519396K(1677312K), 3.2149110 secs]
...

Is it an issue?

Coverage keep increasing for Tomcat fuzz targets

When I am writing fuzz targets for Tomcat, sometimes the coverage will keep increasing until it reaches JAZZER_MAX_NUM_COUNTERS. The Jazzer output shows that Jazzer keep instrumenting JdbcLeakPrevention.

I think this issue is triggered when I call tomcat.start() in the fuzzerTestOneInput.

Screenshot from 2022-07-08 13-44-45

https://github.com/apache/tomcat/blob/main/java/org/apache/catalina/loader/JdbcLeakPrevention.java

Maybe it's worth looking at how Jazzer interacts with JdbcLeakPrevention.

Thank you!
Henry

Hook not triggered for internal method

Hello,

I have a problem with hooks that do not seem to trigger.
Here is a simple reproducer, where I just set up a hook for method java.util.PriorityQueue.siftUpUsingComparator(PriorityQueue.java:675) and where I throw an Exception in case the hook is not triggered.
When executing it, I get the following output where we can see that I can trigger this function without triggering the hook.
Thank you in advance for any help.

\cc @prashast

Note : hooking the add method is working but hooking internal methods that are called behind the scene is not.

For Build.bazel :

java_fuzz_target_test(
    name = "ReproducerHookFuzzer",
    srcs = [
        "src/main/java/com/example/ReproducerHookFuzzer.java",
        "src/main/java/com/example/ReproducerHook.java",
    ],
    # Comment out the next line to keep the fuzzer running indefinitely.
    hook_classes = ["com.example.ReproducerHook"],
    target_class = "com.example.ReproducerHookFuzzer",
)

My hook reproducerHook.java

package com.example;
import java.io.*; 

import java.util.PriorityQueue;
import com.code_intelligence.jazzer.api.HookType;
import com.code_intelligence.jazzer.api.MethodHook;
import java.lang.invoke.MethodHandle;
import com.code_intelligence.jazzer.api.Jazzer;
import com.code_intelligence.jazzer.api.FuzzerSecurityIssueHigh;

public class ReproducerHook {
  @MethodHook(type = HookType.BEFORE, targetClassName = "java.util.PriorityQueue",
      targetMethod = "siftUpUsingComparator", targetMethodDescriptor = "")
  public static void
  hookRuntime(MethodHandle handle, Object thisObject, Object[] args, int hookId) {
    Jazzer.reportFindingFromHook(new FuzzerSecurityIssueHigh("getOutputProperties TODO Check triggered !"));
    throw new FuzzerSecurityIssueHigh("TemplatesImpl.getOutputProperties has been called");
  }
}

And finally my dummy fuzzer ReproducerHookFuzzer.java:

package com.example;

import java.io.*; 

import java.util.Comparator;
import java.util.PriorityQueue;
import java.lang.AssertionError;

public class ReproducerHookFuzzer {
  public static void fuzzerTestOneInput(byte[] input) throws IOException, ClassNotFoundException {
    final Comparator<Object> comparator = new Comparator<Object>() {
      public int compare(Object i1, Object i2) {
        throw new AssertionError();
      }
    };
    
    final PriorityQueue<Object> queue = new PriorityQueue<Object>(2, comparator);
		queue.add(new Integer("1"));
		queue.add(new Integer("2"));
  }
}

That outputs the following, where we can see that the hook is not triggered despite the method having been called :

root@2418a07cb720:/tmp/jazzer/examples# ../bazelisk-linux-amd64 run //examples:ReproducerHookFuzzer
INFO: Analyzed target //examples:ReproducerHookFuzzer (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //examples:ReproducerHookFuzzer up-to-date:
  bazel-bin/examples/ReproducerHookFuzzer.jar
  bazel-bin/examples/ReproducerHookFuzzer
INFO: Elapsed time: 0.172s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: external/bazel_tools/tools/test/test-setup.sh examples/ReproducerHookFuzzer jazzer/driver/jazzer_driver jazzer/examples/ReproducerHookFuzzINFO: Build completed successfully, 1 total action
exec ${PAGER:-/usr/bin/less} "$0" || exit 1
Executing tests from //examples:ReproducerHookFuzzer
-----------------------------------------------------------------------------
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
INFO: Loaded 1 hooks from com.example.ReproducerHook
INFO: Loaded 8 hooks from com.code_intelligence.jazzer.sanitizers.Deserialization
INFO: Loaded 1 hooks from com.code_intelligence.jazzer.sanitizers.ReflectiveCall
INFO: Loaded 3 hooks from com.code_intelligence.jazzer.sanitizers.ExpressionLanguageInjection
INFO: Loaded 8649 no-throw method signatures
INFO: Instrumented com.example.ReproducerHookFuzzer (took 95 ms, size +34%)
INFO: libFuzzer ignores flags that start with '--'
INFO: Running with entropic power schedule (0xFF, 100).
INFO: Seed: 2735196724
INFO: Loaded 1 modules   (512 inline 8-bit counters): 512 [0x7f28e84bc010, 0x7f28e84bc210), 
INFO: Loaded 1 PC tables (512 PCs): 512 [0x7f28bafff010,0x7f28bb001010), 
INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 4096 bytes
INFO: Instrumented com.example.ReproducerHookFuzzer$1 (took 2 ms, size +30%)

== Java Exception: java.lang.AssertionError
        at com.example.ReproducerHookFuzzer$1.compare(ReproducerHookFuzzer.java:13)
        at java.base/java.util.PriorityQueue.siftUpUsingComparator(PriorityQueue.java:675)
        at java.base/java.util.PriorityQueue.siftUp(PriorityQueue.java:652)
        at java.base/java.util.PriorityQueue.offer(PriorityQueue.java:345)
        at java.base/java.util.PriorityQueue.add(PriorityQueue.java:326)
        at com.example.ReproducerHookFuzzer.fuzzerTestOneInput(ReproducerHookFuzzer.java:19)
DEDUP_TOKEN: 5fd26f5695a87482
== libFuzzer crashing input ==
MS: 0 ; base unit: 0000000000000000000000000000000000000000


artifact_prefix='/root/.cache/bazel/_bazel_root/7b91779107cdc414b1652b7e849f6e9a/execroot/jazzer/bazel-out/k8-opt/testlogs/examples/ReproducerHookFuzzer/test.outputs/'; Test unit written to /root/.cache/bazel/_bazel_root/7b91779107cdc414b1652b7e849f6e9a/execroot/jazzer/bazel-out/k8-opt/testlogs/examples/ReproducerHookFuzzer/test.outputs/crash-da39a3ee5e6b4b0d3255bfef95601890afd80709
Base64: 
reproducer_path='/root/.cache/bazel/_bazel_root/7b91779107cdc414b1652b7e849f6e9a/execroot/jazzer/bazel-out/k8-opt/testlogs/examples/ReproducerHookFuzzer/test.outputs'; Java reproducer written to /root/.cache/bazel/_bazel_root/7b91779107cdc414b1652b7e849f6e9a/execroot/jazzer/bazel-out/k8-opt/testlogs/examples/ReproducerHookFuzzer/test.outputs/Crash_da39a3ee5e6b4b0d3255bfef95601890afd80709.java

Some reproducers do not compile

Hello, I'm fuzzing an old version of Jsoup as an exercise. I'm using the autofuzzer and outputting reproducers. I'm trying to run the reproducers individually and noticed that some of them don't compile. For example:

public class Crash_c8b1d033b996bea197a6c1d8e839fbdf99584532 {
  public static void main(String[] args) throws Throwable {
    org.jsoup.Jsoup.parse((java.lang.String) null, "\\b\\n\\n\\n", new org.jsoup.parser.Parser((org.jsoup.parser.TreeBuilder) ((java.util.function.Supplier<org.jsoup.parser.HtmlTreeBuilder>) (() -> {org.jsoup.parser.HtmlTreeBuilder autofuzzVariable0 = new org.jsoup.parser.HtmlTreeBuilder(); return autofuzzVariable0;})).get()));
  }
}

gives the error

error: TreeBuilder is not public in org.jsoup.parser; cannot be accessed from outside package
org.jsoup.Jsoup.parse((java.lang.String) null, "\b\n\n\n", new org.jsoup.parser.Parser((org.jsoup.parser.TreeBuilder) ((java.util.function.Supplier<org.jsoup.parser.HtmlTreeBuilder>) (() -> {org.jsoup.parser.HtmlTreeBuilder autofuzzVariable0 = new org.jsoup.parser.HtmlTreeBuilder(); return autofuzzVariable0;})).get()));

The target jar being fuzzed is included in the classpath when I try to compile reproducer. I am building from source and the target is jsoup's 1.13.1 release, before they fixed the bugs this tool found.

If I manually change that TreeBuilder to XmlTreeBuilder it compiles. XmlTreeBuilder extends the abstract class TreeBuilder if that helps.

Some tests are flaky

A local test run gave the following results:

$ bazel build //... && bazel test --test_env=JAZZER_CI=1 //... --runs_per_test=10 --runs_per_test_detects_flakes
//driver/src/test/java/com/code_intelligence/jazzer/junit:AutofuzzTest_fuzzing FLAKY, failed in 3 out of 10 in 301.8s
  Stats over 10 runs: max = 301.8s, min = 26.4s, avg = 124.0s, dev = 118.9s
//sanitizers/src/test/java/com/example:OsCommandInjectionProcessBuilder   FLAKY, failed in 2 out of 10 in 300.6s

BUILD.bazel:3:11: Compiling driver/sanitizer_hooks_with_pc.cpp failed: - MacOs M1

while running bazel run //:jazzer , I encounter the following error:

ERROR: /Redacted/jazzer/driver/BUILD.bazel:3:11: Compiling driver/sanitizer_hooks_with_pc.cpp failed: (Exit 1): cc_wrapper.sh failed: error executing command external/local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 ... (remaining 24 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
driver/sanitizer_hooks_with_pc.cpp:70:51: error: unknown register name 'rdi' in asm
  [[maybe_unused]] register uint64_t arg1_loc asm(REG_1) = arg1;
                                                  ^
driver/sanitizer_hooks_with_pc.cpp:56:15: note: expanded from macro 'REG_1'
#define REG_1 "rdi"
              ^
driver/sanitizer_hooks_with_pc.cpp:71:51: error: unknown register name 'rsi' in asm
  [[maybe_unused]] register uint64_t arg2_loc asm(REG_2) = arg2;
                                                  ^
driver/sanitizer_hooks_with_pc.cpp:57:15: note: expanded from macro 'REG_2'
#define REG_2 "rsi"
              ^
driver/sanitizer_hooks_with_pc.cpp:72:48: error: unknown register name 'rdx' in asm
  [[maybe_unused]] register void *func_loc asm(REG_3) = func;
                                               ^
driver/sanitizer_hooks_with_pc.cpp:58:15: note: expanded from macro 'REG_3'
#define REG_3 "rdx"
              ^
driver/sanitizer_hooks_with_pc.cpp:73:54: error: unknown register name 'rcx' in asm
  [[maybe_unused]] register uint64_t fake_pc_loc asm(REG_4) = fake_pc;
                                                     ^
driver/sanitizer_hooks_with_pc.cpp:59:15: note: expanded from macro 'REG_4'
#define REG_4 "rcx"
              ^
4 errors generated.
Target //driver:jazzer_driver failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 13.309s, Critical Path: 0.32s
INFO: 60 processes: 58 internal, 2 darwin-sandbox.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully

A bug when performing gep-related instrumentation.

Opcodes.AALOAD, Opcodes.BALOAD,
Opcodes.CALOAD, Opcodes.DALOAD,
Opcodes.FALOAD, Opcodes.IALOAD,
Opcodes.LALOAD, Opcodes.SALOAD -> {
if (InstrumentationType.GEP !in types) continue@loop
if (!isConstantIntegerPushInsn(inst.previous)) continue@loop
method.instructions.insertBefore(inst, gepLoadInstrumentation())
}
Opcodes.INVOKEINTERFACE, Opcodes.INVOKESPECIAL, Opcodes.INVOKESTATIC, Opcodes.INVOKEVIRTUAL -> {
if (InstrumentationType.GEP !in types) continue@loop
if (!isGepLoadMethodInsn(inst as MethodInsnNode)) continue@loop
if (!isConstantIntegerPushInsn(inst.previous)) continue@loop
method.instructions.insertBefore(inst, gepLoadInstrumentation())
}

When reading the code above, I found that the gep instrumentations are performed only after a "constant integer push" (see Line 122 and Line 128), which means we instrument when accessing an array element via a constant index.

However, Clang's document says the opposite, i.e., we need to instrument every non-constant array index (https://clang.llvm.org/docs/SanitizerCoverage.html#tracing-data-flow). So, I wonder if this is a bug or I misunderstand something.

// Called before a GetElemementPtr (GEP) instruction
// for every non-constant array index.
void __sanitizer_cov_trace_gep(uintptr_t Idx);

slow-unit does not reproduce and hangs jazzer

I'm currently testing GZIPInputStream and a portion of the Jackson library. My fuzzer ends up writing a slow-unit to disk, but never writes the reproducer .java. It also never finishes and just sits in futex syscall when I look through /proc/pid/syscall.

I'm basically asking to see is this an issue with jazzer or did I find a not reproducible bug in my fuzz test. I can post my testcase and whatever else is needed. Just didn't want to end up disclosing a 0-day in the library here if it exists.

What kind of information would be beneficial to your team to see if it's jazzer?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.