Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix off-by-one error in chunk splitting #2697

Merged
merged 2 commits into from
Apr 12, 2024
Merged

Conversation

umanwizard
Copy link
Contributor

If the PC of the "end-of-function" marker was exactly one greater than the PC of the last real table entry, and if the unwind entries of the function (including the end-of-function marker) were too big to fit in the current chunk also by exactly one, then we would erroneously take the entire function except the marker, and start the next chunk with the marker. This commit fixes that defect.

Test Plan

Added a test for this case to maps_test.go

If the PC of the "end-of-function" marker was exactly one greater than
the PC of the last real table entry, and if the unwind entries of the
function (including the end-of-function marker) were too big to fit in
the current chunk also by exactly one, then we would erroneously take
the entire function _except_ the marker, and start the next chunk with
the marker. This commit fixes that defect.
@umanwizard umanwizard requested a review from a team as a code owner April 12, 2024 16:27
Copy link
Member

@brancz brancz left a comment

Choose a reason for hiding this comment

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

Nice!!

@brancz brancz merged commit 5435a77 into parca-dev:main Apr 12, 2024
11 of 12 checks passed
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.

2 participants