Skip to content

Commit 02f994b

Browse files
backesoliverchang
andauthored
Use fuzz target name instead of "NULL" (#3564)
If no process name is available but we have a fuzz target name, use that instead of "NULL". This hopefully reduces the amount of "Abrt · NULL" reports we are seeing. Co-authored-by: Oliver Chang <[email protected]>
1 parent aa9168a commit 02f994b

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

src/clusterfuzz/_internal/tests/core/crash_analysis/stack_parsing/stack_analyzer_test.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1764,6 +1764,21 @@ def test_sanitizer_signal_abrt_unknown(self):
17641764
expected_state, expected_stacktrace,
17651765
expected_security_flag)
17661766

1767+
def test_sanitizer_signal_abrt_fuzz_target(self):
1768+
"""Same as above, but this time we specify a fuzz target which should
1769+
then be used as fallback crash state."""
1770+
os.environ['FUZZ_TARGET'] = 'mock-fuzz-target'
1771+
data = self._read_test_data('sanitizer_signal_abrt_unknown.txt')
1772+
expected_type = 'Abrt'
1773+
expected_address = '0x000000000001'
1774+
expected_state = 'mock-fuzz-target\n'
1775+
expected_stacktrace = data
1776+
expected_security_flag = False
1777+
1778+
self._validate_get_crash_data(data, expected_type, expected_address,
1779+
expected_state, expected_stacktrace,
1780+
expected_security_flag)
1781+
17671782
def test_syzkaller_kasan(self):
17681783
"""Test syzkaller kasan."""
17691784
data = self._read_test_data('kasan_syzkaller.txt')

src/clusterfuzz/stacktraces/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def __init__(self):
3636
self.crash_stacktrace = ''
3737
self.crash_categories = set()
3838
self.frame_count = 0
39-
self.process_name = 'NULL'
39+
self.process_name = None
4040
self.process_died = False
4141

4242
# Following fields are for internal use only and subject to change. Do not
@@ -354,10 +354,10 @@ def filter_crash_parameters(self, state):
354354
else:
355355
state.crash_state += line[:LINE_LENGTH_CAP] + '\n'
356356

357-
# Don't return an empty crash state if we have a crash type. Either set
358-
# to NULL or use the crashing process name if available.
357+
# Don't return an empty crash state if we have a crash type. Use the
358+
# process name or fuzz target if available, or set to 'NULL'.
359359
if state.crash_type and not state.crash_state.strip():
360-
state.crash_state = state.process_name
360+
state.crash_state = state.process_name or self.fuzz_target or 'NULL'
361361

362362
# For timeout, OOMs, const-input-overwrites in fuzz targets, force use of
363363
# fuzz target name since stack itself is not usable for deduplication.

0 commit comments

Comments
 (0)