Proto commits in CodeIntelligenceTesting/jazzer

These 26 commits are when the Protocol Buffers files have changed:

Commit:f57adfd
Author:Khaled Yakdan
Committer:Khaled Yakdan

chore: update copyright headers to mention Apache 2.0

The documentation is generated from this commit.

Commit:4621ea2
Author:Khaled Yakdan
Committer:Khaled Yakdan

chore: change source files headers to mention the new license

Commit:3869b73
Author:Fabian Meumertzheim
Committer:Fabian Meumertzheim

mutator: Set required fields to defaults when reading incomplete proto A proto message deserialized from bytes can be incomplete, which results in an error when building it if required fields are missing. To prevent this, walk the proto and initialize all unset required fields to defaults recursively.

Commit:4d7fcaa
Author:Norbert Schneider
Committer:Norbert Schneider

mutator: Add libprotobuf-mutator test to compare implementations

Commit:ee02cf9
Author:Fabian Meumertzheim
Committer:Fabian Meumertzheim

mutation: Do not initialize recursive proto fields When recursive proto fields are initialized, the resulting messages have an expected nesting depth on the order of the inverse of the frequency with which a nullable value is non-null, which tends to run into StackOverflowErrors quickly. This is fixed by checking whether a given proto field is recursive and if so, only initializing it "layer by layer" in mutations rather than all at once during initialization.

Commit:24e75dc
Author:Fabian Meumertzheim
Committer:Fabian Meumertzheim

Add test

Commit:9311385
Author:Fabian Meumertzheim
Committer:Fabian Meumertzheim

mutator: Add AnySource annotation The annotation controls the message types used for Any proto fields in (recursive) submessages. This requires passing the annotation through to message field types as well as extending the mutator cache key to cover the annotation value.

Commit:0a4a243
Author:Fabian Meumertzheim

WIP

Commit:50b4370
Author:Fabian Meumertzheim
Committer:Fabian Meumertzheim

mutator: Add libprotobuf-mutator test proto to stress test These tests also provide coverage for the oneof index bug fixed in the previous commit.

Commit:10f7aea
Author:Fabian Meumertzheim
Committer:Fabian Meumertzheim

mutator: Reland support for empty messages Instead of using enhancing the explicit fixed value mutator, simply let `combine` accept no arguments. In this case, having an empty `initInPlace` has the correct semantics of not modifying what it has been given.

Commit:e83a70d
Author:Fabian Meumertzheim
Committer:Fabian Meumertzheim

mutator: Revert `fixedValue` back to `SerializingMutator` `fixedValue` didn't behave correctly as a `SerializingInPlaceMutator` on a non-default value as it would not be able to ensure that the object given to `initInPlace` is indeed the fixed value - it just didn't change the object and thus only worked correctly for default instances. This reverts commits: * 81cc0bbcdae1471114a54e458790c2b1c60cc68b * bdd71b3dfdecf537ff355df5a32c92b7b44e8041 * 1605864822b519e7e241504472fd50605ceeb9aa

Commit:bdd71b3
Author:Fabian Meumertzheim
Committer:Fabian Meumertzheim

mutator: Add support for empty proto messages

Commit:0a15f0a
Author:Peter Samarin
Committer:Fabian Meumertzheim

Add fully random placeholder mutators for doubles and floats

Commit:e81b804
Author:Fabian Meumertzheim
Committer:Fabian Meumertzheim

mutation: Add support for map proto fields While map fields in protos are represented as repeated message fields to the reflection API, this "illusion" wasn't convincing enough for us to support them automatically: There is a single class that represents all MapEntry messages, even though there are many different message types due to the possible key/value type combinations. In addition, modelling a map as a list of entries means that some mutations, e.g. duplicating a list entry, would silently not affect the map. Instead, we are now mapping a proto map field to an actual map to which we apply our map mutator.

Commit:01b8cf4
Author:Fabian Meumertzheim
Committer:Fabian Meumertzheim

mutation: Add a mutator for Protobuf enum fields Co-authored-by: Norbert Schneider <norbert.schneider@code-intelligence.com> Co-authored-by: Peter Samarin <peter.samarin@code-intelligence.com>

Commit:b270e8f
Author:Fabian Meumertzheim
Committer:Fabian Meumertzheim

mutation: Handle unsupported proto field types gracefully Instead of failing when an unsupported proto field type is encountered, emit a warning and don't mutate it.

Commit:5fe62b4
Author:434b
Committer:GitHub

initital proto2 support (#644) initial proto2 support

Commit:11f0482
Author:Fabian Meumertzheim
Committer:Fabian Meumertzheim

driver: Optionally use the new experimental mutator The mutator can be enabled via the `--experimental_mutator` flag and, if disabled, should not add any measurable overhead. The new mutator can only be used via fuzzerTestOneInput, JUnit support remains follow-up work. The integration is highly unoptimized with many redundant copies. As follow-up work, this should be properly benchmarked and improved where necessary.

Commit:e73c06b
Author:Fabian Meumertzheim
Committer:Fabian Meumertzheim

mutation: Add support for string fields in protos

Commit:33a8bbb
Author:Fabian Meumertzheim
Committer:Fabian Meumertzheim

mutation: Add support for bytes fields in protos

Commit:b96dc65
Author:Fabian Meumertzheim
Committer:Fabian Meumertzheim

mutation: Add support for integral proto fields

Commit:27ef3af
Author:Fabian Meumertzheim
Committer:Fabian Meumertzheim

mutation: Add explicit support for oneof message fields While `oneof`s were handled by the existing code, the mutator wasn't aware of the `oneof`'s state and would thus change it frequently, which ends up invalidating mutations applied to its other fields. With this commit, `oneof` fields have their current state tracked and mutated in 1 out of 100 cases, which allows individual fields to reach more complicated states.

Commit:d840a2c
Author:Fabian Meumertzheim
Committer:Fabian Meumertzheim

mutation: Add support for recursive message types In order to support Protobuf messages types that transitively refer to themselves, the factory for Builder mutators is modified to generate a single shared mutator instance for a given builder type, which ensures that recursive structures are represented as finite directed graphs (no longer just trees) of mutators.

Commit:005d04a
Author:Fabian Meumertzheim
Committer:Fabian Meumertzheim

mutation: Add support for repeated message fields This requires introducing a new mutable list view as the reflection API for repeated message fields is subtly different from the one for other types of fields.

Commit:09a51d6
Author:Fabian Meumertzheim
Committer:Fabian Meumertzheim

mutation: Add basic support for message fields Support for repeated and recursive message fields will come in follow-up commits.

Commit:acbf483
Author:Fabian Meumertzheim
Committer:Fabian Meumertzheim

Add a structured mutation framework