Skip to content

[pdata/pprofile] add bounds checks to FromAttributeIndices#15517

Merged
mx-psi merged 4 commits into
open-telemetry:mainfrom
florianl:pprofiles-fixes-2
Jul 2, 2026
Merged

[pdata/pprofile] add bounds checks to FromAttributeIndices#15517
mx-psi merged 4 commits into
open-telemetry:mainfrom
florianl:pprofiles-fixes-2

Conversation

@florianl

@florianl florianl commented Jun 30, 2026

Copy link
Copy Markdown
Member

Description

FromAttributeIndices passed AttributeIndices values directly to table.At() and StringTable.At() without validating them first. An out-of-range or negative index causes a panic, crashing the collector process.

Fix this by checking each index against the respective table length before access and returning a descriptive error instead.

Note

As this is a breaking change, the respective change for OTel collector contrib is open-telemetry/opentelemetry-collector-contrib#49373.

Link to tracking issue

Fixes #

Testing

Documentation

Authorship

  • I, a human, wrote this pull request description myself.

@florianl
florianl requested review from a team, dmathieu and mx-psi as code owners June 30, 2026 08:31
@github-actions
github-actions Bot requested review from bogdandrutu and dmitryax June 30, 2026 08:31
FromAttributeIndices passed AttributeIndices values directly to
table.At() and StringTable.At() without validating them first. An
out-of-range or negative index causes a panic, crashing the
collector process.

Fix this by checking each index against the respective table length
before access and returning a descriptive error instead.

Signed-off-by: Florian Lehner <[email protected]>
@florianl
florianl force-pushed the pprofiles-fixes-2 branch from 6e8f0e2 to ad13889 Compare June 30, 2026 08:31
@codspeed-hq

This comment was marked as low quality.

@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.09%. Comparing base (a23b4aa) to head (e47f30b).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #15517   +/-   ##
=======================================
  Coverage   91.09%   91.09%           
=======================================
  Files         726      726           
  Lines       48031    48037    +6     
=======================================
+ Hits        43752    43758    +6     
  Misses       2981     2981           
  Partials     1298     1298           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Florian Lehner <[email protected]>
Comment thread .chloggen/pprofiles-fixes-2.yaml Outdated
florianl added a commit to florianl/opentelemetry-collector-contrib that referenced this pull request Jun 30, 2026
open-telemetry/opentelemetry-collector#15517 is a breaking change to prevent a panic. Handle this change for OTel collector contrib.

Signed-off-by: Florian Lehner <[email protected]>
Comment thread pdata/pprofile/attributes.go
@florianl

florianl commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

/rerun

@mx-psi mx-psi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@florianl ping me on Slack when you are ready to merge this so we can trigger a update-otel PR on contrib and minimize disruption on contrib tests

@mx-psi
mx-psi added this pull request to the merge queue Jul 2, 2026
Merged via the queue into open-telemetry:main with commit 193fe1b Jul 2, 2026
63 of 69 checks passed
mx-psi pushed a commit to open-telemetry/opentelemetry-collector-contrib that referenced this pull request Jul 2, 2026
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

open-telemetry/opentelemetry-collector#15517 is
a breaking change to prevent a panic. Handle this change for OTel
collector contrib.

<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes

<!--Describe what testing was performed and which tests were added.-->
#### Testing

<!--Describe the documentation added.-->
#### Documentation

<!--Authorship attestation. See AGENTS.md for details. AI agents must
not check this box on behalf
of the user; the human author must check it themselves before the PR is
ready for review.-->
#### Authorship

- [x] I, a human, wrote this pull request description myself.

<!--Please delete paragraphs that you did not use before submitting.-->

---------

Signed-off-by: Florian Lehner <[email protected]>
lazureykis added a commit to lazureykis/opentelemetry-collector that referenced this pull request Jul 6, 2026
- FromAttributeIndices now returns (pcommon.Map, error) after open-telemetry#15517; update
  the assertSampleDictAttr test helper to check the error.
- setString now returns errTooManyStringTableEntries, matching the sentinel
  fix in open-telemetry#15511; drop the stale "preserve parity" workaround.

Assisted-by: Claude Opus 4.8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants