You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "Joe McDonnell (Jira)" <ji...@apache.org> on 2020/06/01 22:36:00 UTC

[jira] [Resolved] (IMPALA-9781) Fix GCC 7 runtime issue: Unaligned loads and stores for int128_t types

     [ https://issues.apache.org/jira/browse/IMPALA-9781?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joe McDonnell resolved IMPALA-9781.
-----------------------------------
    Resolution: Fixed

> Fix GCC 7 runtime issue: Unaligned loads and stores for int128_t types
> ----------------------------------------------------------------------
>
>                 Key: IMPALA-9781
>                 URL: https://issues.apache.org/jira/browse/IMPALA-9781
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Backend
>    Affects Versions: Impala 4.0
>            Reporter: Joe McDonnell
>            Assignee: Joe McDonnell
>            Priority: Major
>             Fix For: Impala 4.0
>
>
> 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():
>  
> {code:java}
>     case 16:
>       return DecimalVal(*reinterpret_cast<int128_t*>(t->GetSlot(slot_offset_)));
> {code}
> DecimalUtil::DecodeFromFixedLenByteArray():
>  
>  
> {code:java}
>   template<typename T>
>   static inline void DecodeFromFixedLenByteArray(
>       const uint8_t* buffer, int fixed_len_size, T* v) {
> ...
>     *v = 0; <--- unaligned store
> {code}
> DictDecoder::GetValue():
> {code:java}
>   virtual void GetValue(int index, void* buffer) {
>     T* val_ptr = reinterpret_cast<T*>(buffer);
>     ...
>     *val_ptr = dict_[index]; <--- unaligned store
>   }
> {code}
> These can be converted to use memcpy / memset to avoid the unaligned stores/loads.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org