Open vanhauser-thc opened 4 months ago
Sorry about the confusion. You need to specify the full absolute path for the grammar file, please try:
cmake -DCMAKE_BUILD_TYPE=Release -Bbuild -G Ninja -DBUILD_TESTING=OFF -DGRAMMAR_FILE=`pwd`/grammars/lua/Lua.g4
instead.
Thanks, yes this makes it work!
Now that I have built Polyglot I try to fuzz mruby, but apparently not much is happening:
AFL_DISABLE_TRIM=1 AFL_FAST_CAL=1 AFL_CUSTOM_MUTATOR_ONLY=1 POLYGLOT_CONFIG=/PolyGlot/grammars/ruby/semantic.yml AFL_CUSTOM_MUTATOR_LIBRARY=/PolyGlot/build/libpolyglot_mutator.so afl-fuzz -i /mruby/test/t -o /share/out-polyglot -- /mruby/bin/mruby @@
Is it not running or not finding new paths? Could you try build/corpus_evaluate --corpus_dir your_corpus
to see whether you have a good corpus?
Hmm I get this:
/PolyGlot (main) # build/corpus_evaluate --corpus_dir grammars/ruby/corpus/
Unparsable files: (TOTAL42 )
grammars/ruby/corpus/float.rb
[...]
grammars/ruby/corpus/basicobject.rb
Missing types in corpus:
statement
args
program
val
sntart
the corpus directory has 42 files and it lists all files as unparsable (these files are the mruby test files)
for completeness, this is the grammars/ruby/semantic.yml
file:
---
__comments: ''
InitFileDir: grammars/ruby/corpus/
BuiltinObjFile: ''
IsWeakType: true
SyntaxOnly: true
BasicTypes:
- ANYTYPE
The semantic files are not related. Unparsable means the corpus files are not accepted by the grammar. Would you confirm that whether the g4 file is correct? Like, if you build a antlr parser on it, does it parse the corpus file?
I try to follow the example commands from the README with the supplied LUA grammar, but building polyglot fails:
what am I doing wrong?