fuzzinator backtraces are funny ... they show up a huge nested list of decorators until getting to the real problem. :)
yeah, this comes from the nature of decorator chains :)
:thumbsup:
Thanks so much for your help on this.
you're welcome :)
This was working before but after today's changes it's a byte string instead.
what were the changes?
Still trying to determine when this broke.
I am starting to think that validation never worked properly. I think that the command is a string when we first run the SUT. Then for validation we load the SUT from the database, create a path and the command becomes bytes
.
file_path
in the file_writer_decorator.py
.
bytes
.
fuzzer_1 | Exception in <fuzzinator.job.validate_job.ValidateJob object at 0xf48e6370>: expected str, got bytes
fuzzer_1 | Traceback (most recent call last):
fuzzer_1 | File "/jscfuzz/venv/lib/python3.7/site-packages/fuzzinator/controller.py", line 413, in _run_job
fuzzer_1 | for issue in job.run():
fuzzer_1 | File "/jscfuzz/venv/lib/python3.7/site-packages/fuzzinator/job/validate_job.py", line 29, in run
fuzzer_1 | _, new_issues = self.validate()
fuzzer_1 | File "/jscfuzz/venv/lib/python3.7/site-packages/fuzzinator/job/validate_job.py", line 37, in validate
fuzzer_1 | issue = sut_call(**sut_call_kwargs)
fuzzer_1 | File "/jscfuzz/venv/lib/python3.7/site-packages/fuzzinator/config.py", line 42, in __call__
fuzzer_1 | return self._callable(*args, **kwargs)
fuzzer_1 | File "/jscfuzz/venv/lib/python3.7/site-packages/fuzzinator/call/file_writer_decorator.py", line 60, in writer
fuzzer_1 | issue = fn(*args, **kwargs)
fuzzer_1 | File "/jscfuzz/venv/lib/python3.7/site-packages/fuzzinator/call/anonymize_decorator.py", line 46, in filter
fuzzer_1 | issue = fn(*args, **kwargs)
fuzzer_1 | File "/jscfuzz/venv/lib/python3.7/site-packages/fuzzinator/call/subprocess_property_decorator.py", line 59, in filter
fuzzer_1 | issue = fn(*args, **kwargs)
fuzzer_1 | File "/jscfuzz/venv/lib/python3.7/site-packages/fuzzinator/call/subprocess_property_decorator.py", line 59, in filter
fuzzer_1 | issue = fn(*args, **kwargs)
fuzzer_1 | File "/jscfuzz/venv/lib/python3.7/site-packages/fuzzinator/call/subprocess_property_decorator.py", line 59, in filter
fuzzer_1 | issue = fn(*args, **kwargs)
fuzzer_1 | [Previous line repeated 1 more time]
fuzzer_1 | File "/jscfuzz/venv/lib/python3.7/site-packages/fuzzinator/call/platform_info_decorator.py", line 34, in filter
fuzzer_1 | issue = fn(*args, **kwargs)
fuzzer_1 | File "/jscfuzz/venv/lib/python3.7/site-packages/fuzzinator/call/unique_id_decorator.py", line 45, in filter
fuzzer_1 | issue = fn(*args, **kwargs)
fuzzer_1 | File "/jscfuzz/venv/lib/python3.7/site-packages/fuzzinator/call/gdb_backtrace_decorator.py", line 60, in filter
fuzzer_1 | issue = fn(*args, **kwargs)
fuzzer_1 | File "/jscfuzz/venv/lib/python3.7/site-packages/fuzzinator/call/exit_code_filter.py", line 53, in filter
fuzzer_1 | issue = fn(*args, **kwargs)
fuzzer_1 | File "/jscfuzz/jsc32-fuzz/fuzzinator/igalia/fuzzinator/call/subprocess_jsccall.py", line 66, in SubprocessJSCCall
fuzzer_1 | command = formatter.vformat(command, (), mapping)
fuzzer_1 | File "/usr/lib/python3.7/string.py", line 190, in vformat
fuzzer_1 | result, _ = self._vformat(format_string, args, kwargs, used_args, 2)
fuzzer_1 | File "/usr/lib/python3.7/string.py", line 200, in _vformat
fuzzer_1 | self.parse(format_string):
fuzzer_1 | File "/usr/lib/python3.7/string.py", line 284, in parse
fuzzer_1 | return _string.formatter_parser(format_string)
fuzzer_1 | TypeError: expected str, got bytes
> use fuzzinator
switched to db fuzzinator
> db.getCollection('fuzzinator_issues').find({})
{ "_id" : ObjectId("60d1ea728c198c90cb14ffd5"), "id" : " ", "sut" : "jsc", "backtrace" : BinData(0,""), "build_command" : BinData(0,"L2pzY2Z1enovanNjMzItZnV6ei9jb25maWdzL2pzYy1idWlsZC5zaCBsaW51eDMyCg=="), "build_name" : BinData(0,"ZGVidWdPcHQgSlNDT25seQo="), "command" : BinData(0,"Li9XZWJLaXRCdWlsZC9EZWJ1Zy9iaW4vanNjIHtvcHRpb25zfSB7dGVzdH0K"), "count" : 67, "exit_code" : -6, "first_seen" : ISODate("2021-06-22T13:49:38.486Z"), "fuzzer" : "js-fuzzer", "last_seen" : ISODate("2021-06-22T14:05:05.959Z"), "node" : "bc861183bc96", "options" : "--returnEarlyFromInfiniteLoopsForFuzzing=1 --earlyReturnFromInfiniteLoopsLimit=1000000 --useConcurrentGC=0", "platform" : "Linux-5.10.0-0.bpo.7-arm64-aarch64-with-debian-10.9", "reduced" : null, "reported" : false, "stderr" : BinData(0,""), "stdout" : BinData(0,"QlVHTlVNQkVSOiAKU1RBVFVTOiBTd2l0Y2ggd2l0aCBtb3JlIHRoYW4gNjRrIGF0b21zCiBQQVNTRUQhIFN3aXRjaCB3aXRoIG1vcmUgdGhhbiA2NGsgYXRvbXMK"), "subconfig" : { "subconfig" : "c7b4b647b" }, "test" : "/jscfuzz/fuzzinator-tmp/js_fuzzer/10855-4102971824/fuzz-9.js", "version" : BinData(0,"YTZhZmZlYTdmZDEyMzUyMGM2MGI3MzExZjI1YThlZmRjMDFjZGU3Ygo=") }
command
is saved in the database as a BinData
and when it is read, it's read as bytes
.
sut
key for example.
command
into the database? it should not be there in the first place, it should be read from the config during the validation as well.
third: is it the master branch that you are currently using? https://github.com/pmatos/jsc32-fuzz
yes
which other issues did you see?
first, your id
field is empty: "id" : " "
. it should be filled with a unique identifier extracted/built e.g, from the stderr. This id helps fuzzinator to avoid saving the same issue multiple times. probably your regex filter should be double-checked. the problem with this means that fuzzinator cannot distinguish the issues properly and it might misses to save further issues.
id
.
"test"
field contains a file path instead of the content of the failing test case. the problem with this, that in a usual fuzzing scenario test cases are only kept until a batch of tests are executed. After this, the old tests are removed and new ones are generated. So, if you save the path of an old test, then you never will be able to reproduce. The solution is to use a FileReaderDecorator
like here: https://github.com/renatahodovan/fuzzinator-configs/blob/master/sut/jsc/jsc-grammarinator-cli.ini#L47
Tuomas (Apple fuzzing guy) suggested I stop fuzzing jsc with asan and when I removed the asan stuff, mistakingly I removed the regex as well.
I saw this change, but you removed too much.
call.decorate(3)=fuzzinator.call.SanitizerAutomatonFilter
should be replaced with call.decorate(3)=fuzzinator.call.RegexAutomatonFilter
. The later is the superclass of the previous. RegexAutomatonFilter
process the selected stream of the SUT and looks for error patterns. If it founds a matching pattern, than it saves the mathing group name and the matching content as key-value pairs into the issue dictionary. Later, the UniqueIdDecorator will reuse these (and other) fields to generate an identifier (this is the id
field which is empty now in your database)