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

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   ### Describe the bug
   
   Reading BYTE_ARRAY-backed Decimal32 values can trigger UBSan:
   
       runtime error: store to misaligned address for type 'uint64_t'
   
   The converter always writes two `uint64_t` values, even when the destination 
is Decimal32 (4 bytes) or Decimal64 (8 bytes):
   
   
https://github.com/apache/arrow/blob/d5eb88e93ea7776a6eb3b1b59b5b795f4331d6d3/cpp/src/parquet/arrow/reader_internal.cc#L728-L730
   
   This became reachable for Decimal32/64 after GH-44345 / PR #47427.
   
   The stores should be replaced with:
   
       std::memset(out_ptr, 0, type_length);
   
   The existing `TestReadDecimals.Decimal32ByteArray` test reproduces it when 
alignment sanitization is enabled.
   
   ### Component(s)
   
   C++, Parquet


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to