Replace the suboptimal fuzz_tree harness with a better alternative · gitpython-developers/GitPython@c84e643 · GitHub
Skip to content

Commit c84e643

Browse files
committed
Replace the suboptimal fuzz_tree harness with a better alternative
As discussed in the initial fuzzing integration PR[^1], `fuzz_tree.py`'s implementation was not ideal in terms of coverage and its reading/writing to hard-coded paths inside `/tmp` was problematic as (among other concerns), it causes intermittent crashes on ClusterFuzz[^2] when multiple workers execute the test at the same time on the same machine. The changes here replace `fuzz_tree.py` completely with a completely new `fuzz_repo.py` fuzz target which: - Uses `tempfile.TemporaryDirectory()` to safely manage tmpdir creation and tear down, including during multi-worker execution runs. - Retains the same feature coverage as `fuzz_tree.py`, but it also adds considerably more from much smaller data inputs and with less memory consumed (and it doesn't even have a seed corpus or target specific dictionary yet.) - Can likely be improved further in the future by exercising additional features of `Repo` to the harness. Because `fuzz_tree.py` was removed and `fuzz_repo.py` was not derived from it, the Apache License call outs in the docs were also updated as they only apply to the singe `fuzz_config.py` file now. [^1]: #1901 (comment) [^2]: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=68355
1 parent 797009d commit c84e643

5 files changed

Lines changed: 57 additions & 90 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions

fuzzing/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -225,14 +225,14 @@ to [the official OSS-Fuzz documentation][oss-fuzz-docs].
225225
## LICENSE
226226

227227
All files located within the `fuzzing/` directory are subject to [the same license](../LICENSE)
228-
as [the other files in this repository](../README.md#license) with two exceptions:
229-
230-
Two files located in this directory, [`fuzz_config.py`](./fuzz-targets/fuzz_config.py)
231-
and [`fuzz_tree.py`](./fuzz-targets/fuzz_tree.py), have been migrated here from the OSS-Fuzz project repository where
232-
they were originally created. As such, these two files retain their original license and copyright notice (Apache
233-
License, Version 2.0 and Copyright 2023 Google LLC respectively.) Each file includes a notice in their respective header
234-
comments stating that they have been modified. [LICENSE-APACHE](./LICENSE-APACHE) contains the original license used by
235-
the OSS-Fuzz project repository at the time they were migrated.
228+
as [the other files in this repository](../README.md#license) with one exception:
229+
230+
[`fuzz_config.py`](./fuzz-targets/fuzz_config.py) was migrated to this repository from the OSS-Fuzz project's repository
231+
where it was originally created. As such, [`fuzz_config.py`](./fuzz-targets/fuzz_config.py) retains its original license
232+
and copyright notice (Apache License, Version 2.0 and Copyright 2023 Google LLC respectively) as in a header
233+
comment, followed by a notice stating that it has have been modified contributors to GitPython.
234+
[LICENSE-APACHE](./LICENSE-APACHE) contains the original license used by the OSS-Fuzz project repository at the time the
235+
file was migrated.
236236

237237
[oss-fuzz-repo]: https://github.com/google/oss-fuzz
238238

fuzzing/dictionaries/fuzz_tree.dict

Lines changed: 0 additions & 13 deletions
This file was deleted.

fuzzing/fuzz-targets/fuzz_repo.py

Lines changed: 47 additions & 0 deletions

fuzzing/fuzz-targets/fuzz_tree.py

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)