Describe the bug, including details regarding any error messages, version, and platform.
AppendTimestampBatch in cpp/src/arrow/adapters/orc/util.cc converts ORC second + nanosecond timestamps to Arrow int64 nanoseconds with a bare seconds * kOneSecondNanos + nanos. For a timestamp past ~year 2262 the multiply does not fit in int64, which is signed integer overflow (UB).
Reducing the expression under -fsanitize=signed-integer-overflow:
runtime error: signed integer overflow:
10000000000 * 1000000000 cannot be represented in type 'int64_t'
The conversion should detect the out-of-range case and return an error instead of computing the product with undefined behavior.
Component(s)
C++
Describe the bug, including details regarding any error messages, version, and platform.
AppendTimestampBatchincpp/src/arrow/adapters/orc/util.ccconverts ORC second + nanosecond timestamps to Arrow int64 nanoseconds with a bareseconds * kOneSecondNanos + nanos. For a timestamp past ~year 2262 the multiply does not fit in int64, which is signed integer overflow (UB).Reducing the expression under
-fsanitize=signed-integer-overflow:The conversion should detect the out-of-range case and return an error instead of computing the product with undefined behavior.
Component(s)
C++