Repository navigation
Add fanbase fuzz: fuzz a project's own program, and keep what is found private - #11
Merged
Merged
Conversation
…d private For each spec, Fandango makes inputs and every target (by default every one in --target-dir that reads the format) is run on each. A target that crashes, hangs or is killed goes into the private record, as with evaluate --incidents. An input the targets disagree on, or that every target rejects although the spec says decodes: always, is a finding: findings are grouped by what each target said, and one input of each group is reduced by delta debugging, asking the fastest target first. They go into the same record, under findings/, which `fanbase incidents open` reads. What is printed is counts. --only-own-targets keeps it to the project's own program: targets only from --target-dir, each running a harness of its own folder, no folder linking out of it, never the registry's. The GitHub Action always passes it. Also: --hide-crashes now hides a target killed by SIGKILL or SIGXCPU too. It was counted as resource-limit, with "killed by SIGKILL" as its reason, in public; it is now an error, as a crash or a hang is.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A new command,
fanbase fuzz, for a project that wants its own program fuzzed with Fanbase specs, in its CI or on its developers' machines. The Fandango GitHub Action calls it.For each spec, Fandango makes the inputs, and every target (by default, every target in
--target-dirthat reads the format) is run on every one. Then:evaluate --incidents;decodes: always, is a finding. Findings are grouped by what each target said (the gist of each rejection, without positions and quoted text), and the smallest input of each group is reduced by delta debugging (lines, then characters) to one that gets the same answers. While reducing, the fastest target is asked first, and the first one that answers differently ends the try;findings/<id>/(a report with what each target said and how to make the inputs again, the reduced input, the original one), sofanbase incidents openreads it as it is;--json-file, is counts: accepted, rejected and error per target, and how many kinds of finding. A target that broke is counted as an error, as with--hide-crashes. With--recipientsthe record is encrypted, and the lines about each finding are not printed either.--only-own-targetskeeps it to the project's own program: targets come only from--target-dir, never from the registry; each has to run a harness of its own folder ({dir}/...), not a program of the machine; and a target folder that links out of--target-diris refused. The action always passes it.--failexits 1 when anything was found.Also
--hide-crasheshid crashes and hangs, but a target killed by SIGKILL or SIGXCPU was counted asresource-limit, with "killed by SIGKILL" as its reason, in public. It is now counted as an error, as the others are. Published counts of such targets move fromresource-limittoerror; accepted counts don't change.run_target's asking about one file is nowtargets.ask(), whichfuzzuses as well.load_targetcan look in a project's own folders, before the registry's or instead of it; its message is unchanged when there are none.incidents.write_private) can carry more than incidents (Extra), under a name of its own.How it was tried
tests/test_fuzz.py, and one intests/test_incidents.pythat fails without the fix above). The whole suite passes;mypyis clean;ruff --select F,E9reports only the two unused imports that are onmainalready.main), 60 inputs each fromuvlanduvl-lexical: 7 kinds of disagreement, each reduced to 21–46 bytes (166 for one), which are bugs reported upstream already; the printed output was counts only.jsonspec, through the action's own script with a real age key: the crash went into the record, the rejected valid input was reduced to1E0, and the log and summary had counts only. A--target-diroutside the repository, and a registry target, were refused.Checklist
fanbase>=0.7