diff --git a/socorro/external/es/super_search_fields.py b/socorro/external/es/super_search_fields.py index df44a25767..7516b99c26 100644 --- a/socorro/external/es/super_search_fields.py +++ b/socorro/external/es/super_search_fields.py @@ -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", diff --git a/socorro/external/legacy_es/super_search_fields.py b/socorro/external/legacy_es/super_search_fields.py index c5999de886..6ebe2c53c6 100644 --- a/socorro/external/legacy_es/super_search_fields.py +++ b/socorro/external/legacy_es/super_search_fields.py @@ -1060,6 +1060,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", diff --git a/socorro/mozilla_rulesets.py b/socorro/mozilla_rulesets.py index 4628e4b73b..2e990c910c 100644 --- a/socorro/mozilla_rulesets.py +++ b/socorro/mozilla_rulesets.py @@ -9,6 +9,7 @@ AndroidOSInfoRule, ) from socorro.processor.rules.breakpad import ( + CrashInconsistenciesRule, CrashingThreadInfoRule, HasGuardPageAccessRule, MinidumpSha256HashRule, @@ -88,6 +89,7 @@ CrashingThreadInfoRule(), TruncateStacksRule(), PossibleBitFlipsRule(), + CrashInconsistenciesRule(), HasGuardPageAccessRule(), MajorVersionRule(), PluginRule(), diff --git a/socorro/processor/rules/breakpad.py b/socorro/processor/rules/breakpad.py index 5c1fa576d6..2382c2fb53 100644 --- a/socorro/processor/rules/breakpad.py +++ b/socorro/processor/rules/breakpad.py @@ -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 diff --git a/socorro/schemas/processed_crash.schema.yaml b/socorro/schemas/processed_crash.schema.yaml index 2b66eea794..ade3b9864f 100644 --- a/socorro/schemas/processed_crash.schema.yaml +++ b/socorro/schemas/processed_crash.schema.yaml @@ -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 @@ -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. diff --git a/socorro/tests/schemas/test_socorro_data_schemas.py b/socorro/tests/schemas/test_socorro_data_schemas.py index 130ad2774c..10e4c0c89c 100644 --- a/socorro/tests/schemas/test_socorro_data_schemas.py +++ b/socorro/tests/schemas/test_socorro_data_schemas.py @@ -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", @@ -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.[]", @@ -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.[]", diff --git a/webapp/crashstats/crashstats/jinja2/crashstats/report_index.html b/webapp/crashstats/crashstats/jinja2/crashstats/report_index.html index ed934aa0c7..1fa198ae50 100644 --- a/webapp/crashstats/crashstats/jinja2/crashstats/report_index.html +++ b/webapp/crashstats/crashstats/jinja2/crashstats/report_index.html @@ -347,6 +347,15 @@

{{ report.product }} {{ report.version }} Crash Report [@ {{ report.signatur {% endif %} + {% if report.crash_inconsistencies %} + + Crash Inconsistencies + +
{{ report.crash_inconsistencies }}
+ + + {% endif %} + Process Type