fix(report): prevent corrupted utf8 when computing process name#269
Merged
cmacknz merged 2 commits intoelastic:mainfrom Nov 18, 2025
Merged
fix(report): prevent corrupted utf8 when computing process name#269cmacknz merged 2 commits intoelastic:mainfrom
cmacknz merged 2 commits intoelastic:mainfrom
Conversation
|
@mauri870 Your test is logically failing on Windows. Should we exclude the test from running there? |
99a6522 to
f96b89c
Compare
Member
Author
Thanks, I adjusted the test logic since we don't perform any truncation on Windows. |
Member
Author
|
/test |
Member
Author
|
Ugh, lots of flaky tests. I'll create issues for them. |
Member
Author
|
@kruskall Added you as a reviewer because I think your input will be valuable. Thanks! |
belimawr
approved these changes
Nov 17, 2025
Member
Author
|
/test |
Member
Author
|
/test |
Member
|
Force merged past known flaky test #270 |
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.
What does this PR do?
The processName function is not UTF-8 aware. It simply cuts the string to a fixed length without checking whether the index falls in the middle of a multibyte sequence, which results in corrupted UTF-8. Fix it by truncating the string using a UTF-8 safe approach.
Why is it important?
Prevents SetupMetricsOptions from erroring out on the call to
procStats.Init()when trying to apply a regex on a corrupted utf8 string here. See comment on linked issue for details.How to test this PR locally?
Checklist
CHANGELOG.mdRelated issues
��elastic-agent#11172.