You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "zanmato1984 (via GitHub)" <gi...@apache.org> on 2024/07/25 06:38:49 UTC

[I] [C++][Compute] Invalid memory access when resizing row table [arrow]

zanmato1984 opened a new issue, #43414:
URL: https://github.com/apache/arrow/issues/43414

   ### Describe the bug, including details regarding any error messages, version, and platform.
   
   When resizing the underlying buffer for the var-length content of the row table, we do:
   https://github.com/apache/arrow/blob/674e221f41c602c8f71c7a2c8e53e7c7c11b1ede/cpp/src/arrow/compute/row/row_internal.cc#L296-L299
   
   It is treating the second buffer (row content if the row table is fixed length, or offset otherwise) as offset regardless of the fix-length-ness. The fix-length-ness is checked afterwards, in which case resizing the var-length buffer is unnecessary and return.
   
   But treating the second buffer as offset unconditionally is problematic because, at least but not last, it could be sized less than required by an offset buffer. Consider a row table containing only one `uint8` column and alignment being `1` byte, there will be `1` byte per row, less than `4` bytes per row as an offset, causing the offset access beyond the buffer boundary.
   
   I have a repro case in my local and will send out as UT with my fix PR.
   
   ### Component(s)
   
   C++


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [C++][Compute] Invalid memory access when resizing row table [arrow]

Posted by "felipecrv (via GitHub)" <gi...@apache.org>.
felipecrv closed issue #43414: [C++][Compute] Invalid memory access when resizing row table
URL: https://github.com/apache/arrow/issues/43414


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [C++][Compute] Invalid memory access when resizing row table [arrow]

Posted by "felipecrv (via GitHub)" <gi...@apache.org>.
felipecrv commented on issue #43414:
URL: https://github.com/apache/arrow/issues/43414#issuecomment-2266316637

   Issue resolved by pull request 43415
   https://github.com/apache/arrow/pull/43415


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [C++][Compute] Invalid memory access when resizing row table [arrow]

Posted by "zanmato1984 (via GitHub)" <gi...@apache.org>.
zanmato1984 commented on issue #43414:
URL: https://github.com/apache/arrow/issues/43414#issuecomment-2249570191

   take


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org