Skip to content

pkg/symbolizer: strip compiler suffixes from function names - #8182

Open
paul-nikulshin wants to merge 1 commit into
google:masterfrom
paul-nikulshin:master
Open

paul-nikulshin wants to merge 1 commit into
google:masterfrom
paul-nikulshin:master

Conversation

@paul-nikulshin

Copy link
Copy Markdown
Contributor

Function names reported by addr2line may contain compiler-generated suffixes such as .isra.12, .constprop.78, .part.2 and .cold.53, including chains like .isra.7.part.3. Depending on the PC, the same function can produce different names, which defeats deduplication in Interner and makes report names unstable.

Strip the suffixes in parse() before interning the name.

Tests are based on real names from pkg/report/testdata/linux .

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements stripping of compiler-generated suffixes (such as .isra, .constprop, .part, and .cold) from function names during symbolization, allowing different clones of a function to share the same interned name. It also adds comprehensive unit tests for this functionality. The review feedback suggests optimizing cleanFuncName with a fast path to avoid regex overhead for names without dots, and updating the test assertions to use github.com/stretchr/testify/assert to align with the repository style guide.

Comment thread pkg/symbolizer/addr2line.go Resolved
Comment thread pkg/symbolizer/addr2line_test.go Resolved
@github-actions github-actions Bot added the well-shaped PR has no conflicts and all checks pass label Nov 20, 2026
Comment thread pkg/symbolizer/addr2line.go Resolved
Comment thread pkg/symbolizer/addr2line_test.go Resolved
Comment thread pkg/symbolizer/addr2line_test.go Resolved
@codecov

codecov Bot commented Nov 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.9%. Comparing base (b2c6945) to head (6d39aed).
⚠️ Report is 51 commits behind head on master.

Additional details and impacted files
Files with missing lines Coverage Δ
pkg/symbolizer/addr2line.go 70.9% <100.0%> (+1.8%) ⬆️

... and 23 files with indirect coverage changes

🚀 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.

Comment thread pkg/symbolizer/addr2line.go Resolved
Function names reported by addr2line may contain compiler-generated suffixes
such as .isra.12, .constprop.78, .part.2 and .cold.53, including chains like
.isra.7.part.3. Depending on the PC, the same function can produce different
names, which defeats deduplication in Interner and makes report names unstable.

Strip the suffixes in parse() before interning the name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

well-shaped PR has no conflicts and all checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants