You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[C++][Compute] ascii_upper / ascii_lower / ascii_swapcase return an invalid array when the first offset is not 0 #54906
Describe the bug, including details regarding any error messages, version, and platform.
ascii_upper, ascii_lower and ascii_swapcase return an invalid array when the input has offset == 0 but its first value offset is not 0. Such an input is valid. The format only says that the first offset is generally 0, and ValidateFull() accepts the input.
Reproducer (pyarrow 26.0.0 from PyPI, Python 3.12, Windows 11):
When input.offset == 0, the input offsets buffer is reused unchanged.
The transformed data, however, is written to a new buffer of offsets[length] - offsets[0] bytes, starting at position 0.
So the reused offsets (5, 8, 8) point past the end of the 3-byte output data.
Reusing the offsets is only correct when offsets[0] == 0. Otherwise the existing else branch, which rebases the offsets by offsets[0], gives the right result.
This was found with an AI-assisted analysis of the C++ code against the columnar format specification. The reproducer above was run against pyarrow 26.0.0.
Activity
JonSnow1807 commentedon Oct 21, 2026
take