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

Segmented sort test fix #1591

Merged
merged 2 commits into from
Apr 5, 2024
Merged

Conversation

alliepiper
Copy link
Collaborator

@alliepiper alliepiper commented Apr 4, 2024

Description

The unspecified segment generator was randomly writing 0s into the begin/end offset arrays, while num_items was computed as end_offsets.back() + 243, intended to pad the key/value arrays with a trailing unspecified segment.

If one of the randomly zeroed offsets was the last segment in the array, the num_items would be set to 243, which is less than many of the valid segment ranges, causing out-of-bounds reads/writes and corrupting memory.

Fixed this by removing the last segment from consideration when generating the zeroed segments.

Ref #1380

The unspecified segment generator was randomly
writing 0s into the begin/end offset arrays, while
num_items was computed as `end_offsets.back() + 243`, intended to pad the key/value arrays with a
trailing unspecified segment.

If one of the randomly zeroed offsets was the
last segment in the array, the num_items would be
set to 243, which is less than many of the
valid segment ranges, causing out-of-bounds
reads/writes and corrupting memory.

Fixed this by removing the last segment from
consideration when generating the zeroed
segments.
@alliepiper alliepiper requested review from a team as code owners April 4, 2024 18:14
@alliepiper alliepiper merged commit ffb2592 into NVIDIA:main Apr 5, 2024
587 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants