Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1831)

Unified Diff: appengine/findit/crash/type_enums.py

Issue 2593593003: [Predator] Add Clusterfuzz stacktrace parser. (Closed)
Patch Set: Rebase and fix nit. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/findit/crash/test/type_enums_test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/crash/type_enums.py
diff --git a/appengine/findit/crash/type_enums.py b/appengine/findit/crash/type_enums.py
index 4874f56fa0ad0e60f22a27ac99016875bb4cabdb..78a7718cc10ab4cc01942c3ecfa053939960bde3 100644
--- a/appengine/findit/crash/type_enums.py
+++ b/appengine/findit/crash/type_enums.py
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+from collections import OrderedDict
+
class CallStackFormatType(object):
JAVA = 1
@@ -18,3 +20,44 @@ class CrashClient(object):
class LanguageType(object):
CPP = 1
JAVA = 2
+
+
+class SanitizerType(object):
+ ADDRESS_SANITIZER = 1,
+ THREAD_SANITIZER = 2,
+ MEMORY_SANITIZER = 3,
+ SYZYASAN = 4,
+ UBSAN = 5
+ UNSUPPORTED = 6
+
+ stacktrace_marker_to_sanitizer = {
+ 'AddressSanitizer': ADDRESS_SANITIZER,
+ 'ThreadSanitizer': THREAD_SANITIZER,
+ 'MemorySanitizer': MEMORY_SANITIZER,
+ 'syzyasan': SYZYASAN,
+ ': runtime error:': UBSAN
+ }
+
+ # Some signature may contain others, for example 'syzyasan' contains 'asan',
+ # in order to match signature in build type correctly, use ordered dict with
+ # decreasing length of signature.
+ job_type_marker_to_sanitizer = OrderedDict(
+ [('syzyasan', SYZYASAN),
+ ('ubsan', UBSAN),
+ ('asan', ADDRESS_SANITIZER),
+ ('msan', MEMORY_SANITIZER),
+ ('tsan', THREAD_SANITIZER)])
+
+ @staticmethod
+ def GetSanitizerType(job_type, stacktrace_string):
+ for marker, sanitizer_type in (
+ SanitizerType.job_type_marker_to_sanitizer.iteritems()):
+ if marker.lower() in job_type.lower():
+ return sanitizer_type
+
+ for marker, sanitizer_type in (
+ SanitizerType.stacktrace_marker_to_sanitizer.iteritems()):
+ if marker.lower() in stacktrace_string.lower():
+ return sanitizer_type
+
+ return SanitizerType.UNSUPPORTED
« no previous file with comments | « appengine/findit/crash/test/type_enums_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698