renatahodovan / fuzzinator

Fuzzinator Random Testing Framework
BSD 3-Clause "New" or "Revised" License
190 stars 37 forks source link

Fighting with ini configuration #25

Open dsmic opened 4 years ago

dsmic commented 4 years ago

I do have a fuzzer=fuzzinator.fuzzer.RandomContent working, and I also were able to run half of a fuzzer with grammar:

grammarinator is called, but my SUT not. Help would be great :)

[sut.jerry]
call=fuzzinator.call.SubprocessCall
#call.decorate(0)=fuzzinator.call.ExitCodeFilter
#call.decorate(11)=fuzzinator.call.FileReaderDecorator

[sut.jerry.call]
command=/media/detlef/Fast/KALI/fuzzer/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js
#command=/media/detlef/Fast/KALI/fuzzer/ASTFuzz/a.out

cwd=.

# Parameter section for ExitCodeFilter.
[sut.jerry.call.decorate(0)]
exit_codes=[3]

[fuzz.jerryscript-grammarinator]
sut=sut.jerry
fuzzer=fuzzinator.fuzzer.SubprocessRunner

[fuzz.jerryscript-grammarinator.fuzzer.init]
outdir=./jerryscript/grammarinator/{uid}/
command=grammarinator-generate
        --unlexer=./ecma_unparser/ECMAScriptUnlexer.py
        --unparser=./ecma_unparser/ECMAScriptUnparser.py
        --max-depth=20
        --out=./fuzzgrammar/%d.js
        -n=100
        --population=./pop
        --tree-transformers=grammarinator.runtime.simple_space_transformer
contents=False

# Test cases are defined here as file paths but they should be saved as content.
[sut.jerryscript]
call.decorate(11)=fuzzinator.call.FileReaderDecorator
renatahodovan commented 4 years ago

At the first sight it seems that the config of jerryscript-grammarinator references the sut in the old format (sut.jerry). Now, it's enough (actually mandatory) to reference it as jerry.

[fuzz.jerryscript-grammarinator]
sut=jerry
fuzzer=fuzzinator.fuzzer.SubprocessRunner

One more note: since you use relative references in the grammarinator command, you should define the working directory as well (cwd=... in the [fuzz.jerryscript-grammarinator.fuzzer.init] section).

Please let me know if it solved the generation.

dsmic commented 4 years ago

Thanks: I come closer. I did not install from github but with pip: in the pip version sut.jerry was necessary. Installing both from github results in different versions of antlerinator==4.7.1-1 needed.

Now I have fuzzinator from github (supports jerry without sut) and gramminator from pip :)

[sut.jerry]
call=fuzzinator.call.StdinSubprocessCall
#call.decorate(0)=fuzzinator.call.ExitCodeFilter
#call.decorate(11)=fuzzinator.call.FileReaderDecorator
call.decorate(1)=fuzzinator.call.UniqueIdDecorator

[sut.jerry.call]
command=/media/detlef/Fast/KALI/fuzzer/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js -
#command=/media/detlef/Fast/KALI/fuzzer/ASTFuzz/a.out

cwd=/media/detlef/Fast/KALI/fuzzer/grammar/

# Parameter section for ExitCodeFilter.
[sut.jerry.call.decorate(0)]
exit_codes=[3]

[fuzz.jerryscript-gg]
sut=jerry
fuzzer=fuzzinator.fuzzer.SubprocessRunner
batch=100

[fuzz.jerryscript-gg.fuzzer.init]
sut=jerry
cwd=/media/detlef/Fast/KALI/fuzzer/grammar/
outdir=./fuzzgrammar/{uid}/
command=grammarinator-generate --unlexer=./ecma_unparser/ECMAScriptUnlexer.py --unparser=./ecma_unparser/ECMAScriptUnparser.py --max-depth=20 --out=./fuzzgrammar/{uid}/%d.js -n=100 --tree-transformers=grammarinator.runtime.simple_space_transformer 
#--population=./pop 
#contents=False

# UniqueIdDecorator
[sut.jerry.call.decorate(1)]
properties=["type", "condition", "path"]