Add git.Blob Fuzz Target by DaveLak · Pull Request #1911 · gitpython-developers/GitPython (original) (raw)

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation1 Commits2 Checks26 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

DaveLak

Adds a new fuzz target for git.Blob, using fuzzed data for all __init__ arguments.

60 second local test run output:

INFO: A corpus is not provided, starting from an empty corpus
#2	INITED cov: 211 ft: 211 corp: 1/1b exec/s: 0 rss: 72Mb
#10	NEW    cov: 230 ft: 232 corp: 2/4b lim: 4 exec/s: 0 rss: 74Mb L: 3/3 MS: 2 InsertByte-InsertByte-
#26	NEW    cov: 230 ft: 251 corp: 3/7b lim: 4 exec/s: 0 rss: 76Mb L: 3/3 MS: 1 ChangeByte-
#128	pulse  cov: 230 ft: 251 corp: 3/7b lim: 4 exec/s: 64 rss: 77Mb
#181	REDUCE cov: 230 ft: 251 corp: 3/6b lim: 4 exec/s: 60 rss: 77Mb L: 2/3 MS: 4 ChangeBinInt-CopyPart-EraseBytes-ChangeBit-
#256	pulse  cov: 230 ft: 251 corp: 3/6b lim: 4 exec/s: 64 rss: 77Mb
#512	pulse  cov: 230 ft: 251 corp: 3/6b lim: 6 exec/s: 56 rss: 77Mb
#1024	pulse  cov: 230 ft: 251 corp: 3/6b lim: 11 exec/s: 56 rss: 77Mb
#1919	NEW    cov: 239 ft: 260 corp: 4/27b lim: 21 exec/s: 56 rss: 77Mb L: 21/21 MS: 1 InsertRepeatedBytes-
#1926	REDUCE cov: 239 ft: 260 corp: 4/26b lim: 21 exec/s: 56 rss: 77Mb L: 20/20 MS: 2 ChangeBit-EraseBytes-
#2048	pulse  cov: 239 ft: 260 corp: 4/26b lim: 21 exec/s: 55 rss: 77Mb
#2122	REDUCE cov: 239 ft: 260 corp: 4/25b lim: 21 exec/s: 55 rss: 77Mb L: 1/20 MS: 1 EraseBytes-
#2537	REDUCE cov: 281 ft: 302 corp: 5/50b lim: 25 exec/s: 56 rss: 78Mb L: 25/25 MS: 4 ChangeBit-InsertRepeatedBytes-ChangeBinInt-ChangeBinInt-
#3382	DONE   cov: 281 ft: 302 corp: 5/50b lim: 33 exec/s: 55 rss: 78Mb
Done 3382 runs in 61 second(s)
stat::number_of_executed_units: 3382
stat::average_exec_per_sec:     55
stat::new_units_added:          7
stat::slowest_unit_time_sec:    0
stat::peak_rss_mb:              78

@DaveLak

Based on the test_blob.py unit test.

@DaveLak

This increases the edges reached by the fuzzer, making for a more effective test with higher coverage.

Byron

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

It's a bit unpleasant to see that that the git.Blob has a path associated to it, as if it was always read from a loose object, with IO then dominating the runtime. I'd always hope there are ways to trigger the important code without touching disk for it.

@DaveLak DaveLak deleted the add-blob-fuzz-target branch

May 15, 2024 14:58

2 participants

@DaveLak @Byron