[SER-1312] Improve crash grouping for partially symbolicated traces#7711
[SER-1312] Improve crash grouping for partially symbolicated traces#7711coskunaydinoglu wants to merge 6 commits into
Conversation
…essing - Remove symbol/frame offsets as one unit before the standalone-number rule, so partially symbolicated iOS frames normalize cleanly - Remove bare hex sequences (4+ chars, digit required) not covered by the 0x rule, e.g. load addresses and <...> address tokens - Fix custom smart_regexes: flags were passed as the replacement string, so only the first match was replaced (case-sensitively) with the literal text "gim"; now all matches are removed with gim flags as the config help text documents - Collapse whitespace runs and trim as the final smart-preprocessing step so column alignment differences no longer change the seed Crashes that differ only by memory addresses, frame offsets, or padding now produce identical grouping seeds (SER-1312, reported for partially symbolicated iOS SIGTRAP crashes).
Unit tests call groupStrategy() directly with explicit override settings: iOS SIGTRAP pair equality, bare-hex normalization, offset removal as a unit, distinct crashes staying distinct, smart_regexes all-match case-insensitive removal without gim injection, invalid regex resilience, smart_preprocessing=false passthrough, stacktrace strategy, and standalone-id regression. Plus an e2e smoke test that two partially symbolicated crashes land in one crash group.
Crash ingestion is fire-and-forget: /i returns 200 before the crash group upsert lands, so asserting immediately after submission is flaky on slow runners. Wait 100*testScalingFactor ms after each submission (suite convention) and poll the crashes query until the group count is stable before asserting. Also URL-encode the crash payloads so the literal '+ 50648' frame offset reaches the server instead of decoding to a space, exercising the offset-removal rule as intended. The strict lengthOf(1) assertion is unchanged.
|
CI status summary for reviewers: ✅ 9/10 checks green on ❌ Note on the earlier red runs (21:38–23:00 UTC June 11): the same code failed The two Generated by Claude Code |
Jira: https://countly.atlassian.net/browse/SER-1312
Summary
Customers (reported by Vakifbank) saw identical partially symbolicated iOS SIGTRAP crashes split into many separate crash groups. The grouping seed produced by
groupStrategy()inplugins/crashes/api/parts/stacktrace.jsretained per-report noise — frame offsets (+ 50648), bare hex load addresses without a0xprefix (104a30000,<0000000104a3c5d8>), and column-alignment whitespace — so semantically identical traces hashed to different groups.This change, gated behind the existing
smart_preprocessingsetting (no behavior change when it is disabled):+ 600,+0x1a4) before the standalone-number rule0x/UUID rulesBug fix: custom
smart_regexesThe custom-regex loop passed the flags string as the replacement:
seed.replace(new RegExp(reg), "gim"). Only the first match was replaced, case-sensitively, with the literal textgiminjected into the seed. Now:seed.replace(new RegExp(reg, "gim"), "")— all matches removed, exactly as the setting's help text has always documented.Release-notes note: one-time regrouping
For apps with
smart_preprocessingenabled, grouping seeds (and thus hashes) change. New incoming crashes may open new groups instead of joining pre-upgrade groups. Existing groups remain intact and readable; they simply stop accruing new occurrences for affected signatures. No migration or merge of historical groups is performed.Test plan
plugins/crashes/tests.js(groupStrategycalled directly with explicit override settings): iOS SIGTRAP pair equality, bare-hex normalization, offset-as-unit removal, distinct crashes staying distinct, smart_regexes all-match/case-insensitive removal with nogiminjection, invalid-regex resilience,smart_preprocessing: falsebyte-identical passthrough,stacktracestrategy, standalone-id regression — all 9 verified locally against the real module (output in commit d561055's review)crashesplugin suite: runs in CI (no test environment in the authoring checkout)https://claude.ai/code/session_01KV52CRKaxGSbBLugwh7XrJ
Generated by Claude Code