-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Java] Incorrect getBufferSize for a dense union vector #38242
Comments
wotbrew
changed the title
Incorrect getBufferSize for a dense union vector with (non-fixed) legs of different lengths.
Incorrect getBufferSize for a dense union vector
Oct 12, 2023
wotbrew
added a commit
to wotbrew/arrow
that referenced
this issue
Oct 17, 2023
wotbrew
added a commit
to wotbrew/arrow
that referenced
this issue
Oct 17, 2023
wotbrew
added a commit
to wotbrew/arrow
that referenced
this issue
Oct 17, 2023
wotbrew
added a commit
to wotbrew/arrow
that referenced
this issue
Oct 17, 2023
…UV getBufferSizeFor (apache#38242)
wotbrew
added a commit
to wotbrew/arrow
that referenced
this issue
Oct 17, 2023
…UV getBufferSizeFor (apache#38242)
wotbrew
added a commit
to wotbrew/arrow
that referenced
this issue
Oct 17, 2023
…UV getBufferSizeFor (apache#38242)
wotbrew
added a commit
to wotbrew/arrow
that referenced
this issue
Oct 17, 2023
…UV getBufferSizeFor (apache#38242)
wotbrew
changed the title
Incorrect getBufferSize for a dense union vector
[Java] Incorrect getBufferSize for a dense union vector
Oct 17, 2023
wotbrew
added a commit
to wotbrew/arrow
that referenced
this issue
Oct 20, 2023
…UV getBufferSizeFor (apache#38242)
wotbrew
added a commit
to wotbrew/arrow
that referenced
this issue
Oct 20, 2023
…UV getBufferSizeFor (apache#38242)
pitrou
pushed a commit
that referenced
this issue
Oct 23, 2023
…ionVector#getBufferSizeFor (#38305) ### What changes are included in this PR? Fix incorrect implementation of `DenseUnionVector.getBufferSizeFor`. Sum the type id counts before calling `getBufferSizeFor` on the union's child vectors. ### Are these changes tested? Yes. A test verifies the OOB read (requires bounds check), and an example count is correct, fails as expected before fix. **This PR contains a "Critical Fix".** For users of DenseUnionVector the size can calculated incorrectly, as well as cause of out-of-bounds buffer reads which may return garbage (or potentially segfaulting) if bounds checking is off. * Closes: #38242 Authored-by: Dan Stone <[email protected]> Signed-off-by: Antoine Pitrou <[email protected]>
JerAguilon
pushed a commit
to JerAguilon/arrow
that referenced
this issue
Oct 23, 2023
…enseUnionVector#getBufferSizeFor (apache#38305) ### What changes are included in this PR? Fix incorrect implementation of `DenseUnionVector.getBufferSizeFor`. Sum the type id counts before calling `getBufferSizeFor` on the union's child vectors. ### Are these changes tested? Yes. A test verifies the OOB read (requires bounds check), and an example count is correct, fails as expected before fix. **This PR contains a "Critical Fix".** For users of DenseUnionVector the size can calculated incorrectly, as well as cause of out-of-bounds buffer reads which may return garbage (or potentially segfaulting) if bounds checking is off. * Closes: apache#38242 Authored-by: Dan Stone <[email protected]> Signed-off-by: Antoine Pitrou <[email protected]>
JerAguilon
pushed a commit
to JerAguilon/arrow
that referenced
this issue
Oct 25, 2023
…enseUnionVector#getBufferSizeFor (apache#38305) ### What changes are included in this PR? Fix incorrect implementation of `DenseUnionVector.getBufferSizeFor`. Sum the type id counts before calling `getBufferSizeFor` on the union's child vectors. ### Are these changes tested? Yes. A test verifies the OOB read (requires bounds check), and an example count is correct, fails as expected before fix. **This PR contains a "Critical Fix".** For users of DenseUnionVector the size can calculated incorrectly, as well as cause of out-of-bounds buffer reads which may return garbage (or potentially segfaulting) if bounds checking is off. * Closes: apache#38242 Authored-by: Dan Stone <[email protected]> Signed-off-by: Antoine Pitrou <[email protected]>
loicalleyne
pushed a commit
to loicalleyne/arrow
that referenced
this issue
Nov 13, 2023
…enseUnionVector#getBufferSizeFor (apache#38305) ### What changes are included in this PR? Fix incorrect implementation of `DenseUnionVector.getBufferSizeFor`. Sum the type id counts before calling `getBufferSizeFor` on the union's child vectors. ### Are these changes tested? Yes. A test verifies the OOB read (requires bounds check), and an example count is correct, fails as expected before fix. **This PR contains a "Critical Fix".** For users of DenseUnionVector the size can calculated incorrectly, as well as cause of out-of-bounds buffer reads which may return garbage (or potentially segfaulting) if bounds checking is off. * Closes: apache#38242 Authored-by: Dan Stone <[email protected]> Signed-off-by: Antoine Pitrou <[email protected]>
dgreiss
pushed a commit
to dgreiss/arrow
that referenced
this issue
Feb 19, 2024
…enseUnionVector#getBufferSizeFor (apache#38305) ### What changes are included in this PR? Fix incorrect implementation of `DenseUnionVector.getBufferSizeFor`. Sum the type id counts before calling `getBufferSizeFor` on the union's child vectors. ### Are these changes tested? Yes. A test verifies the OOB read (requires bounds check), and an example count is correct, fails as expected before fix. **This PR contains a "Critical Fix".** For users of DenseUnionVector the size can calculated incorrectly, as well as cause of out-of-bounds buffer reads which may return garbage (or potentially segfaulting) if bounds checking is off. * Closes: apache#38242 Authored-by: Dan Stone <[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
Describe the bug, including details regarding any error messages, version, and platform.
DenseUnionVector.getBufferSizeFor
takes a count parameter. My expectation is the count represents the number of elements in the union you wish to account for.However, that count is passed directly to
internalStruct.getBufferSizeFor
, which I suspect is a bug.This is because struct fields normally have the same valueCount, but this is not likely true when used in a union. If your children have different lengths:
Observed on
13.0.0
and12.0.1
.Repro:
Component(s)
Java
The text was updated successfully, but these errors were encountered: