Skip to content

GH-36949: [C++] Fix KeyColumnArray's buffers array bounds assertion. - #36966

Merged
pitrou merged 1 commit into
apache:mainfrom
Light-City:GH-36949
Aug 10, 2023
Merged

pitrou merged 1 commit into
apache:mainfrom
Light-City:GH-36949

Conversation

@Light-City

@Light-City Light-City commented Aug 1, 2023 •

Copy link
Copy Markdown
Contributor

Rationale for this change

file: light_array.h

The length of the buffers array is 3 (kMaxBuffers).

  • buffers_[kValidityBuffer]
  • buffers_[kFixedLengthBuffer]
  • buffers_[kVariableLengthBuffer]

So when we do the check, the asserted index should be less than 3, not equal to.

In addition, fix the comment line break format problem.

What changes are included in this PR?

  • KeyColumnArray

data and mutable_data ARROW_DCHECK.

  • ResizableArrayData class

Comment line break formatting for mutable_data functions

Are these changes tested?

no, just change assert bound.

Are there any user-facing changes?

no

The length of the buffers array is 3 (kMaxBuffers).
- buffers_[kValidityBuffer]
- buffers_[kFixedLengthBuffer]
- buffers_[kVariableLengthBuffer]

So when we do the check, the asserted index should be less than 3, not equal to.

In addition, fix the comment line break format problem.
@github-actions

github-actions Bot commented Aug 1, 2023

Copy link
Copy Markdown

⚠️ GitHub issue #36949 has been automatically assigned in GitHub to PR creator.

@pitrou pitrou 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.

Well spotted, thank you @Light-City

@conbench-apache-arrow

Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit 27949b4.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

loicalleyne pushed a commit to loicalleyne/arrow that referenced this pull request Nov 13, 2023
…tion. (apache#36966)

### Rationale for this change

file: light_array.h

The length of the buffers array is 3 (kMaxBuffers).

- buffers_[kValidityBuffer]
- buffers_[kFixedLengthBuffer]
- buffers_[kVariableLengthBuffer]

So when we do the check, the asserted index should be less than 3, not equal to.

In addition, fix the comment line break format problem.

### What changes are included in this PR?

- KeyColumnArray

data and mutable_data ARROW_DCHECK.

- ResizableArrayData class 

Comment line break formatting for mutable_data functions

### Are these changes tested?

no, just change assert bound.

### Are there any user-facing changes?

no
* Closes: apache#36949

Authored-by: light-city <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C++] light_array buffer boundary assertion?

2 participants