[Crashlytics] Fix regex parsing issues#1488
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the Crashlytics stack trace parser to correctly handle stripped stack traces, specifically by refining regular expressions and handling file identifiers enclosed in angle brackets. It also refactors regex usage from Regex.Matches to Regex.IsMatch and Regex.Match for better efficiency. The review feedback suggests further performance optimizations by avoiding redundant regex evaluations between the matching and parsing steps, as well as simplifying a redundant string comparison condition.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refactors and improves the stack trace parsing logic in Crashlytics to support stripped stack traces, simplifying the matching flow and updating the regular expressions. The review feedback highlights two important improvements: replacing greedy wildcards in the file info regex to prevent potential catastrophic backtracking, and adding a defensive guard clause in ParseStackTraceString to avoid a NullReferenceException when the input stack trace is null or empty.
Description
Adjust the regex used to parse stack traces to be more precise, to avoid catastrophic backtracking issues caused by greedy matching.
Fixes #1484
Testing
Testing examples with regex tools, to compare the results.
https://github.com/firebase/firebase-unity-sdk/actions/runs/29283437546
Type of Change
Place an
xthe applicable box: