[pdata/pprofile] add bounds checks to FromAttributeIndices#15517
Merged
Conversation
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
force-pushed
the
pprofiles-fixes-2
branch
from
June 30, 2026 08:31
6e8f0e2 to
ad13889
Compare
This comment was marked as low quality.
This comment was marked as low quality.
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Signed-off-by: Florian Lehner <[email protected]>
florianl
commented
Jun 30, 2026
1 task
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]>
ms-hujia
reviewed
Jun 30, 2026
ms-hujia
approved these changes
Jul 1, 2026
Member
Author
|
/rerun |
atoulme
approved these changes
Jul 1, 2026
Merged
via the queue into
open-telemetry:main
with commit Jul 2, 2026
193fe1b
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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