-
Notifications
You must be signed in to change notification settings - Fork 218
/
mozilla_rulesets.py
137 lines (130 loc) · 3.99 KB
/
mozilla_rulesets.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
from socorro import settings
from socorro.lib.libsocorrodataschema import get_schema
from socorro.processor.rules.android import (
AndroidCPUInfoRule,
AndroidOSInfoRule,
)
from socorro.processor.rules.breakpad import (
CrashingThreadInfoRule,
HasGuardPageAccessRule,
MinidumpSha256HashRule,
MinidumpStackwalkRule,
PossibleBitFlipsRule,
TruncateStacksRule,
)
from socorro.processor.rules.general import (
CollectorMetadataRule,
CPUInfoRule,
CrashReportKeysRule,
DeNoneRule,
DeNullRule,
IdentifierRule,
OSInfoRule,
)
from socorro.processor.rules.java import JavaStackTraceRule
from socorro.processor.rules.memory_report_extraction import MemoryReportExtraction
from socorro.processor.rules.mozilla import (
AccessibilityRule,
AddonsRule,
BetaVersionRule,
BreadcrumbsRule,
ConvertModuleSignatureInfoRule,
CopyFromRawCrashRule,
DatesAndTimesRule,
DistributionIdRule,
ESRVersionRewrite,
FenixVersionRewriteRule,
MajorVersionRule,
MissingSymbolsRule,
ModulesInStackRule,
ModuleURLRewriteRule,
MacBootArgsRule,
MacCrashInfoRule,
MozCrashReasonRule,
OSPrettyVersionRule,
OutOfMemoryBinaryRule,
PHCRule,
PluginRule,
ReportTypeRule,
SignatureGeneratorRule,
SubmittedFromRule,
ThemePrettyNameRule,
TopMostFilesRule,
UtilityActorsNameRule,
)
DEFAULT_RULESET = [
# fix the raw crash removing null characters and Nones
DeNullRule(),
DeNoneRule(),
# capture collector things
CrashReportKeysRule(),
CollectorMetadataRule(),
# fix ModuleSignatureInfo if it needs fixing
ConvertModuleSignatureInfoRule(),
# rules to change the internals of the raw crash
FenixVersionRewriteRule(),
ESRVersionRewrite(),
# rules to transform a raw crash into a processed crash
CopyFromRawCrashRule(schema=get_schema("processed_crash.schema.yaml")),
SubmittedFromRule(),
IdentifierRule(),
MinidumpSha256HashRule(),
MinidumpStackwalkRule(
dump_field=settings.STACKWALKER["dump_field"],
symbols_urls=settings.STACKWALKER["symbols_urls"],
command_line=settings.STACKWALKER["command_line"],
command_path=settings.STACKWALKER["command_path"],
kill_timeout=settings.STACKWALKER["kill_timeout"],
symbol_cache_path=settings.STACKWALKER["symbol_cache_path"],
symbol_tmp_path=settings.STACKWALKER["symbol_tmp_path"],
),
ModuleURLRewriteRule(),
CrashingThreadInfoRule(),
TruncateStacksRule(),
PossibleBitFlipsRule(),
HasGuardPageAccessRule(),
MajorVersionRule(),
PluginRule(),
AccessibilityRule(),
AddonsRule(),
DatesAndTimesRule(),
OutOfMemoryBinaryRule(),
PHCRule(),
BreadcrumbsRule(schema=get_schema("processed_crash.schema.yaml")),
JavaStackTraceRule(),
MacBootArgsRule(),
MacCrashInfoRule(),
MozCrashReasonRule(),
UtilityActorsNameRule(),
ReportTypeRule(),
# post processing of the processed crash
CPUInfoRule(),
AndroidCPUInfoRule(),
DistributionIdRule(),
OSInfoRule(),
AndroidOSInfoRule(),
BetaVersionRule(
version_string_api=settings.BETAVERSIONRULE_VERSION_STRING_API,
),
OSPrettyVersionRule(),
TopMostFilesRule(),
ModulesInStackRule(),
MissingSymbolsRule(),
ThemePrettyNameRule(),
MemoryReportExtraction(),
# generate signature now that we've done all the processing it depends on
SignatureGeneratorRule(),
]
REGENERATE_SIGNATURE_RULESET = [
SignatureGeneratorRule(),
]
RULESETS = {
# NOTE(willkg): the rulesets defined in here must match the set of rulesets in
# webapp/crashstats/settings/base.py VALID_RULESETS for them to be available to the
# Reprocessing API
"default": DEFAULT_RULESET,
"regenerate_signature": REGENERATE_SIGNATURE_RULESET,
}