fix(profiling): check long string before allocating#3561
fix(profiling): check long string before allocating#3561morrisonlevi merged 3 commits intomasterfrom
Conversation
|
Benchmarks [ profiler ]Benchmark execution time: 2026-01-12 09:03:32 Comparing candidate commit fa1f099 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 27 metrics, 9 unstable metrics. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3561 +/- ##
==========================================
- Coverage 61.91% 61.81% -0.11%
==========================================
Files 140 140
Lines 13281 13281
Branches 1758 1758
==========================================
- Hits 8223 8209 -14
- Misses 4269 4282 +13
- Partials 789 790 +1 see 3 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
realFlowControl
left a comment
There was a problem hiding this comment.
I've added some tests, looks good, thanks 🙇
aa59da0 to
fa1f099
Compare
Description
It's rare but we sometimes see
extract_function_namein crash reports due to failed memory allocations. At the moment, refactoring this function return aResult<T, E>instead ofTwould be difficult because of its callers likecommon_labelswhich can't fail either.But I did notice an easy fix for some cases: move the large string check earlier. This won't fix OOMs due to genuinely hitting the memory limits, but it will reduce the damage caused by bugs letting through large strings in the first place, which are usually errors.
I also renamed
[large string]to[suspiciously large string]to indicate that these are typically bugs. Class + method names are typically not 64 KiB or larger in size, nor are file names.Reviewer checklist