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 b320c6b
Show file tree
Hide file tree
Showing 6 changed files with 55 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
18 changes: 18 additions & 0 deletions socorro/schemas/processed_crash.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,15 @@ definitions:
the crash).
type: ["string", "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
permissions: ["public"]
permissions: ["public"]
crashing_thread:
description: >
The thread id of the thread that caused the crash or requested
Expand Down Expand Up @@ -2457,6 +2466,15 @@ 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"]
permissions: ["public"]
crash_report_keys:
description: >
List of crash annotations and files in the submitted crash report.
Expand Down
3 changes: 3 additions & 0 deletions socorro/tests/schemas/test_socorro_data_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ def test_validate_processed_crash_schema():
"cpu_info",
"cpu_microcode_version",
"crash_id",
"crash_inconsistencies.[]",
"crash_report_keys.[]",
"crash_time",
"crashing_thread",
Expand Down Expand Up @@ -383,6 +384,7 @@ def test_validate_processed_crash_schema():
"json_dump.crash_info",
"json_dump.crash_info.address",
"json_dump.crash_info.assertion",
"json_dump.crash_info.crash_inconsistencies.[]",
"json_dump.crash_info.crashing_thread",
"json_dump.crash_info.instruction",
"json_dump.crash_info.memory_accesses.[]",
Expand Down Expand Up @@ -779,6 +781,7 @@ def test_validate_processed_crash_schema():
"upload_file_minidump_browser.json_dump.crash_info",
"upload_file_minidump_browser.json_dump.crash_info.address",
"upload_file_minidump_browser.json_dump.crash_info.assertion",
"upload_file_minidump_browser.json_dump.crash_info.crash_inconsistencies.[]",
"upload_file_minidump_browser.json_dump.crash_info.crashing_thread",
"upload_file_minidump_browser.json_dump.crash_info.instruction",
"upload_file_minidump_browser.json_dump.crash_info.memory_accesses.[]",
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 b320c6b

Please sign in to comment.