clusterfuzz icon indicating copy to clipboard operation
clusterfuzz copied to clipboard

ClusterFuzz is unable to parse the JSONs with the Coverage

Open sfiecko opened this issue 2 years ago • 0 comments

Hi!

I have tried to upload coverage stats to the CF hosted in GCP. Sadly, on both JSONs that I have provided the project.json and the fuzzer_name.json from the ClangCoverage there is a parsing problem:

Empty or malformed code coverage JSON (gs://coverage.sta-np-11528163.appspot.com/ENVS/fuzzer_stats/20220804/): Expecting value: line 1 column 1 (char 0). Traceback (most recent call last): File "/srv/handlers/cron/fuzzer_coverage.py", line 46, in _read_json result = json.loads(data) File "/opt/python3.7/lib/python3.7/json/init.py", line 348, in loads return _default_decoder.decode(s) File "/opt/python3.7/lib/python3.7/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/opt/python3.7/lib/python3.7/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

image

ENVS.json - as the main json for the coverage with the project's name as the name of the file:

{
    "report_date": "20220804",
    "fuzzer_stats_dir": "gs://coverage.HIDDEN.appspot.com/ENVS/fuzzer_stats/20220804",
    "report_summary_path": "gs://coverage.HIDDEN.appspot.com/ENVS/reports/20220804/linux/summary.json",
    "html_report_url": "https://storage.googleapis.com/oss-fuzz-coverage/zlib/reports/20190112/linux/index.html"
}

The json from the fuzzer_stats is generated by llvm-cov tools. Both JSONs are valid, tested with Linux/Windows ending characters, UTF-8 converted.

Have you encountered something like this? I have opened both files locally, they are working. I know about the flow (open -> json.loads) and I have verified, that the code should follow that path. Sadly, there is this strange decoding error.

What is more -> Within Datastore and CoverageInformation I can see that it actually worked with the database. There is an error with displaying that data: image

Best regards, Sebastian

sfiecko avatar Aug 12 '22 12:08 sfiecko