Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug-1918240: Add crash_inconsistencies field from rust-minidump #6759

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions socorro/external/es/super_search_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -1053,6 +1053,9 @@ def apply_schema_properties(fields, schema):
"query_type": "enum",
"storage_mapping": {"type": "string"},
},
"crash_inconsistencies": keyword_field(
name="crash_inconsistencies",
),
"crashing_thread": integer_field(name="crashing_thread"),
"crashing_thread_name": keyword_field(
"crashing_thread_name",
Expand Down
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 @@ -1060,6 +1060,9 @@ def apply_schema_properties(fields, schema):
"query_type": "enum",
"storage_mapping": {"type": "string"},
},
"crash_inconsistencies": keyword_field(
name="crash_inconsistencies",
),
relud marked this conversation as resolved.
Show resolved Hide resolved
"crashing_thread": integer_field(name="crashing_thread"),
"crashing_thread_name": keyword_field(
"crashing_thread_name",
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"]
relud marked this conversation as resolved.
Show resolved Hide resolved
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