Skip to content

Commit

Permalink
bug-1918240: Add crash_inconsistencies field from rust-minidump
Browse files Browse the repository at this point in the history
  • Loading branch information
relud committed Oct 21, 2024
1 parent 510c865 commit cc8d2ed
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 0 deletions.
3 changes: 3 additions & 0 deletions socorro/external/legacy_es/super_search_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,9 @@ def apply_schema_properties(fields, schema):
"crashing_thread_name",
in_database_name="crashing_thread_name",
),
"crash_inconsistencies": keyword_field(
"crash_inconsistencies",
),
"date": {
"data_validation_type": "datetime",
"form_field_choices": [],
Expand Down
2 changes: 2 additions & 0 deletions socorro/mozilla_rulesets.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
AndroidOSInfoRule,
)
from socorro.processor.rules.breakpad import (
CrashInconsistenciesRule,
CrashingThreadInfoRule,
HasGuardPageAccessRule,
MinidumpSha256HashRule,
Expand Down Expand Up @@ -88,6 +89,7 @@
CrashingThreadInfoRule(),
TruncateStacksRule(),
PossibleBitFlipsRule(),
CrashInconsistenciesRule(),
HasGuardPageAccessRule(),
MajorVersionRule(),
PluginRule(),
Expand Down
20 changes: 20 additions & 0 deletions socorro/processor/rules/breakpad.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,26 @@ def action(self, raw_crash, dumps, processed_crash, tmpdir, status):
processed_crash["address"] = address


class CrashInconsistenciesRule(Rule):
"""Copy crash_inconsistencies values if there are any
Fills in:
* crash_inconsistencies (list[str]): A list of inconsistencies detected by comparing
crash reason/crash address with crashing instruction and memory information
"""

def predicate(self, raw_crash, dumps, processed_crash, tmpdir, status):
return processed_crash.get("json_dump", None) is not None

def action(self, raw_crash, dumps, processed_crash, tmpdir, status):
crash_info = glom.glom(processed_crash, "json_dump.crash_info", default={})

crash_inconsistencies = crash_info.get("crash_inconsistencies")
processed_crash["crash_inconsistencies"] = crash_inconsistencies


class MinidumpSha256HashRule(Rule):
"""Copy sha256 hash of upload_file_minidump value if there is one
Expand Down
15 changes: 15 additions & 0 deletions socorro/schemas/processed_crash.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,13 @@ definitions:
permissions: ["public"]
type: ["object", "null"]
permissions: ["public"]
crash_inconsistencies:
description: >
A list of inconsistencies detected by comparing crash reason/crash
address with crashing instruction and memory information.
type: ["array", "null"]
items:
type: string
crashing_thread:
description: >
The thread that crashed. This is copied from `threads` with some
Expand Down Expand Up @@ -2457,6 +2464,14 @@ properties:
description: Unique identifier of this crash report.
type: string
permissions: ["public"]
crash_inconsistencies:
description: >
A list of inconsistencies detected by comparing crash reason/crash
address with crashing instruction and memory information.
type: ["array", "null"]
items:
type: string
permissions: ["public"]
crash_report_keys:
description: >
List of crash annotations and files in the submitted crash report.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,15 @@ <h2>{{ report.product }} {{ report.version }} Crash Report [@ {{ report.signatur
</tr>
{% endif %}

{% if report.crash_inconsistencies %}
<tr title="{{ fields_desc['processed_crash.crash_inconsistencies'] }}">
<th scope="row">Crash Inconsistencies</th>
<td>
<pre>{{ report.crash_inconsistencies }}</pre>
</td>
</tr>
{% endif %}

<tr title="{{ fields_desc['processed_crash.process_type'] }}">
<th scope="row">Process Type</th>
<td>
Expand Down

0 comments on commit cc8d2ed

Please sign in to comment.