Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
Impala 4.0.0
-
None
-
ghx-label-2
Description
When running with a release binary built with GCC 7, Impala crashes with multiple distinct unaligned memory errors. They are all related to manipulating 128-bit values. Presumably GCC 7 added an optimization to use an instruction that requires alignment for setting 128-bit values. The locations impacted are:
SlotRef::GetDecimalValInterpreted():
case 16: return DecimalVal(*reinterpret_cast<int128_t*>(t->GetSlot(slot_offset_)));
DecimalUtil::DecodeFromFixedLenByteArray():
template<typename T> static inline void DecodeFromFixedLenByteArray( const uint8_t* buffer, int fixed_len_size, T* v) { ... *v = 0; <--- unaligned store
DictDecoder::GetValue():
virtual void GetValue(int index, void* buffer) {
T* val_ptr = reinterpret_cast<T*>(buffer);
...
*val_ptr = dict_[index]; <--- unaligned store
}
These can be converted to use memcpy / memset to avoid the unaligned stores/loads.