fix: CrashFingerprint caps line length like GuestOutputTail
Description
CrashFingerprintTest.onlyTheTailIsRead hands extract() one 256 KB line, and the ASSERTION pattern backtracks quadratically on it. Locally that one test takes 4-5 minutes, and on CI it sometimes trips the 10-minute no-output watchdog: the recent watchdog failures on theme-manager-css-loader-import and #1570 have the test thread stuck in CrashFingerprint.matchLine.
In the app it can't happen, since GuestOutputTail already cuts lines to 4096 chars. extract() now applies the same cap (shared constant), so the test runs in milliseconds and still checks that only the tail is read.
Recording
n/a -- test/CI fix, nothing visible.
Type of Change
- Bug fix
- Performance / stability improvement
- Compatibility improvements
- Other (requires prior approval)
Test plan
-
CrashFingerprintTest: 19/19 pass,onlyTheTailIsRead277 s -> 0.04 s
Checklist
- If I have access to
#code-changes, I have discussed this change there and it has been green-lighted. If I do not have access, I have still provided clear context in this PR. If I skip both, I accept that this change may face delays in review, may not be reviewed at all, or may be closed. - This change aligns with the current project scope (core functionality, stability, or performance). If not, it has been explicitly approved beforehand.
- I have attached a recording of the change.
- I have read and agree to the contribution guidelines in
CONTRIBUTING.md.
Summary by cubic
Fixes a pathological slowdown in CrashFingerprint.extract() where one very long line caused some patterns to backtrack quadratically, making onlyTheTailIsRead (a single 256 KB line) run for minutes and occasionally trip the CI timeout.
Lines are now capped at 4096 chars, the same cap GuestOutputTail already applies, via a shared constant. In the app this changes nothing, since lines are already truncated before they reach extract(); the test now runs in 0.04 s instead of ~277 s while still verifying that only the tail is read.
Summary by CodeRabbit
- Bug Fixes
- Improved crash report matching for lines that end with carriage returns or exceed 4,096 characters, helping identify crashes more consistently.