Skip to content

Conversation

@morrisonlevi
Copy link
Collaborator

Description

It's rare but we sometimes see extract_function_name in crash reports due to failed memory allocations. At the moment, refactoring this function return a Result<T, E> instead of T would be difficult because of its callers like common_labels which 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

  • Test coverage seems ok.
  • Appropriate labels assigned.

@morrisonlevi morrisonlevi added profiling Relates to the Continuous Profiler crashtracker-identified labels Jan 9, 2026
@morrisonlevi morrisonlevi requested a review from a team as a code owner January 9, 2026 21:07
@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Jan 9, 2026

⚠️ Tests

Fix all issues with Cursor

⚠️ Warnings

❄️ 3 New flaky tests detected

Bug #44811 (Improve error messages when creating new SoapClient which contains invalid data) from PHP.ext.soap.tests.bugs (Datadog) (Fix with Cursor)
001+ ** ERROR: process timed out **
001- SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://php.net' : %s
002- 
003- ok
bug65538_002.phpt - Bug #65538: SSL context "cafile" disallows URL stream wrappers from php-src.php-src.ext.openssl.tests (Datadog) (Fix with Cursor)
001+ ** ERROR: process timed out **
002- 
004- 
testDynamicRouteWithOptionalsFilled from tests/Integrations/Symfony/V3_3.DDTrace\Tests\Integrations\Symfony\V3_3\PathParamsTest (Datadog) (Fix with Cursor)
DDTrace\Tests\Integrations\Symfony\V3_3\PathParamsTest::testDynamicRouteWithOptionalsFilled
Failed asserting that 0 matches expected 1.

tests/Integrations/Symfony/PathParamsTestSuite.php:21
tests/Common/RetryTraitVersionGeneric.php:28
phpvfscomposer://tests/vendor/phpunit/phpunit/phpunit:97

🧪 2141 Tests failed

    testSearchPhpBinaries from integration.DDTrace\Tests\Integration\PHPInstallerTest (Fix with Cursor)

testSimplePushAndProcess from laravel-58-test.DDTrace\Tests\Integrations\Laravel\V5_8\QueueTest (Datadog) (Fix with Cursor)
Risky Test
phpvfscomposer://tests/vendor/phpunit/phpunit/phpunit:97
testSimplePushAndProcess from laravel-8x-test.DDTrace\Tests\Integrations\Laravel\V8_x\QueueTest (Datadog) (Fix with Cursor)
DDTrace\Tests\Integrations\Laravel\V8_x\QueueTest::testSimplePushAndProcess
Test code or tested code printed unexpected output: spanLinksTraceId: 696178aa000000000ef3b15e9e5fd98b
tid: 696178aa00000000
hexProcessTraceId: 0ef3b15e9e5fd98b
hexProcessSpanId: bb23b9cde3957b37
processTraceId: 1077399755813804427
processSpanId: 13484826003215055671
View all
This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 6ffab61 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@pr-commenter
Copy link

pr-commenter bot commented Jan 9, 2026

Benchmarks [ profiler ]

Benchmark execution time: 2026-01-09 21:16:06

Comparing candidate commit 1890aeb in PR branch levi/extract_function_name with baseline commit 3112dff in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 29 metrics, 7 unstable metrics.

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.90%. Comparing base (3112dff) to head (6ffab61).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3561      +/-   ##
==========================================
- Coverage   61.91%   61.90%   -0.02%     
==========================================
  Files         140      140              
  Lines       13281    13281              
  Branches     1758     1758              
==========================================
- Hits         8223     8221       -2     
- Misses       4269     4272       +3     
+ Partials      789      788       -1     

see 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3112dff...6ffab61. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants