Skip to content

Commit e958446

Browse files
committed
Merge branch 'master' of github.com:mozilla/bugbot into performancebug-rule
2 parents cb773ca + bb0903b commit e958446

File tree

3 files changed

+41
-9
lines changed

3 files changed

+41
-9
lines changed

bugbot/crash/analyzer.py

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,29 @@ def is_near_allocator_related_crash(self) -> bool:
484484
"""
485485
return self.is_near_allocator_crash or self.is_potential_near_allocator_crash
486486

487+
@cached_property
488+
def num_phc_crashes(self) -> int:
489+
"""The number of crashes that are related to a potential Probabilistic
490+
Heap Checker (PHC) bug.
491+
"""
492+
return sum(
493+
crash["count"] for crash in self.signature["facets"]["phc_alloc_stack"]
494+
)
495+
496+
@property
497+
def is_potential_phc_crash(self) -> bool:
498+
"""Whether the crash is related to a potential Probabilistic Heap
499+
Checker (PHC) bug.
500+
"""
501+
return self.num_phc_crashes > 0
502+
503+
@property
504+
def is_phc_crash(self) -> bool:
505+
"""Whether the crash is related to a potential Probabilistic Heap
506+
Checker (PHC) bug.
507+
"""
508+
return self.num_phc_crashes == self.num_crashes
509+
487510

488511
class SignatureAnalyzer(SocorroDataAnalyzer, ClouseauDataAnalyzer):
489512
"""Analyze the data related to a signature.
@@ -596,14 +619,11 @@ def fetch_representative_processed_crash(self) -> dict:
596619

597620
@cached_property
598621
def is_potential_security_crash(self) -> bool:
599-
"""Whether the crash is related to a potential security bug.
600-
601-
The value will be True if:
602-
- the signature is related to near allocator poison value crashes, or
603-
- one of the potential regressors is a security bug
604-
"""
605-
return self.is_near_allocator_related_crash or any(
606-
bug.is_security for bug in self.regressed_by_potential_bugs
622+
"""Whether the crash is related to a potential security bug."""
623+
return (
624+
self.is_near_allocator_related_crash
625+
or self.is_potential_phc_crash
626+
or any(bug.is_security for bug in self.regressed_by_potential_bugs)
607627
)
608628

609629
def has_moz_crash_reason(self, reason: str) -> bool:
@@ -877,6 +897,7 @@ def fetch_socorro_info(self) -> tuple[list[dict], int]:
877897
"cpu_arch",
878898
"platform_pretty_version",
879899
"_histogram.date",
900+
"phc_alloc_stack",
880901
# The following are needed for SignatureStats:
881902
"platform",
882903
"is_garbage_collecting",

bugbot/rules/file_crash_bug.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def get_bugs(self, date):
184184
# [ ] Estimated future crash volume
185185

186186
bug_data = {
187-
"blocks": "bugbot-auto-crash",
187+
"blocks": ["bugbot-auto-crash"],
188188
"type": "defect",
189189
"keywords": ["crash"],
190190
"summary": title,
@@ -216,6 +216,9 @@ def get_bugs(self, date):
216216
]
217217
bug_data["cc"].append(signature.regressed_by_author["name"])
218218

219+
if signature.is_potential_phc_crash:
220+
bug_data["blocks"].append("PHC")
221+
219222
if signature.is_potential_security_crash:
220223
bug_data["groups"] = ["core-security"]
221224

templates/file_crash_bug_description.md.jinja

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ all crashes happened on or near an allocator poison value
5959
{{ signature.num_near_allocator_crashes }} out of {{ signature.num_crashes }} crashes happened on or near an allocator poison value
6060
{%- endif %}
6161
{%- endif %}
62+
{% if signature.is_potential_phc_crash -%}
63+
- **Is PHC crash:** {{ "Yes - " if signature.is_potential_phc_crash else "No" }}
64+
{%- if signature.is_phc_crash -%}
65+
all crashes have PHC allocation stack trace
66+
{%- elif signature.is_potential_phc_crash -%}
67+
{{ signature.num_phc_crashes }} out of {{ signature.num_crashes }} crashes have PHC allocation stack trace
68+
{%- endif %}
69+
{%- endif %}
6270

6371

6472

0 commit comments

Comments
 (0)