Skip to content

Commit

Permalink
Remove built-in ignore list from FuzzManagerReporter
Browse files Browse the repository at this point in the history
Reporting to FuzzManager allows proper triage and prevents
frequent issues and fuzzblockers from going unnoticed.
  • Loading branch information
tysmith committed Sep 22, 2023
1 parent 077a7a8 commit 4015a5e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 56 deletions.
23 changes: 0 additions & 23 deletions grizzly/common/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,25 +226,6 @@ def _process_rr_trace(self, report):
# remove traces so they are not uploaded to FM (because they are huge)
rmtree(trace_path)

@staticmethod
def _ignored(report):
# This is here to prevent reporting stack-less crashes
# that were caused by system OOM
log_data = report.preferred.read_text("utf-8", errors="ignore")
# ignore sanitizer OOMs missing stack
if report.stack is None:
mem_errs = (
"ERROR: Failed to mmap",
# NOTE: max_allocation_size_mb can trigger a similar message
": AddressSanitizer failed to allocate",
"Sanitizer: internal allocator is out of memory trying to allocate",
)
# scan log data for memory error strings
if any(msg in log_data for msg in mem_errs):
return True
# ignore Valgrind crashes
return log_data.startswith("VEX temporary storage exhausted.")

def _submit_report(self, report, test_cases, force):
collector = Collector(tool=self.tool)

Expand All @@ -263,10 +244,6 @@ def _submit_report(self, report, test_cases, force):
else:
LOG.debug("sigCacheDir does not exist (%r)", collector.sigCacheDir)

if self._ignored(report):
LOG.info("Report is in ignore list")
return None

if report.is_hang:
self.add_extra_metadata("is_hang", True)

Expand Down
42 changes: 9 additions & 33 deletions grizzly/common/test_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,31 +156,22 @@ def test_fuzzmanager_reporter_01(mocker, tmp_path):


@mark.parametrize(
"tests, frequent, ignored, force, sig_cache",
"tests, frequent, force, sig_cache",
[
# report - without test
(False, False, False, False, True),
(False, False, False, True),
# report - with test
(True, False, False, False, True),
(True, False, False, True),
# report - frequent
(True, True, False, False, True),
(True, True, False, True),
# report - forced frequent
(True, True, False, True, True),
# report - ignored
(True, False, True, False, True),
(True, True, True, True),
# report - missing sigCacheDir
(False, False, False, False, False),
(False, False, False, False),
],
)
def test_fuzzmanager_reporter_02(
mocker, tmp_path, tests, frequent, ignored, force, sig_cache
):
def test_fuzzmanager_reporter_02(mocker, tmp_path, tests, frequent, force, sig_cache):
"""test FuzzManagerReporter.submit()"""
mocker.patch(
"grizzly.common.reporter.FuzzManagerReporter._ignored",
new_callable=mocker.MagicMock,
return_value=ignored,
)
mocker.patch("grizzly.common.reporter.Path.cwd", return_value=tmp_path)
mocker.patch("grizzly.common.reporter.getenv", autospec=True, return_value="0")
fake_collector = mocker.patch("grizzly.common.reporter.Collector", autospec=True)
Expand Down Expand Up @@ -213,7 +204,7 @@ def test_fuzzmanager_reporter_02(
)
assert not log_path.is_dir()
assert fake_collector.call_args == ({"tool": "fake-tool"},)
if (frequent and not force) or ignored:
if frequent and not force:
assert fake_collector.return_value.submit.call_count == 0
assert fake_test.dump.call_count == 0
else:
Expand All @@ -222,21 +213,6 @@ def test_fuzzmanager_reporter_02(
assert fake_test.dump.call_count == 1


def test_fuzzmanager_reporter_03(mocker, tmp_path):
"""test FuzzManagerReporter._ignored()"""
log_file = tmp_path / "test.log"
log_file.touch()
report = mocker.Mock(spec_set=Report, path=tmp_path, preferred=log_file, stack=None)
# not ignored
assert not FuzzManagerReporter._ignored(report)
# ignored - sanitizer OOM missing stack
log_file.write_bytes(b"ERROR: Failed to mmap")
assert FuzzManagerReporter._ignored(report)
# ignored - Valgrind OOM
log_file.write_bytes(b"VEX temporary storage exhausted.")
assert FuzzManagerReporter._ignored(report)


@mark.parametrize(
"tool, sanitized",
[
Expand All @@ -250,7 +226,7 @@ def test_fuzzmanager_reporter_03(mocker, tmp_path):
("TeSt-ToOl", "test-tool"),
],
)
def test_fuzzmanager_reporter_04(tool, sanitized):
def test_fuzzmanager_reporter_03(tool, sanitized):
"""test FuzzManagerReporter() sanitizing tool"""
assert FuzzManagerReporter(tool).tool == sanitized

Expand Down

0 comments on commit 4015a5e

Please sign in to comment.