[ 
https://issues.apache.org/jira/browse/IMPALA-9781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17120048#comment-17120048
 ] 

ASF subversion and git services commented on IMPALA-9781:
---------------------------------------------------------

Commit 7a2e80cf602b8c13d935cfc06a2a55a3c48f8d0b in impala's branch 
refs/heads/master from Joe McDonnell
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=7a2e80c ]

Revert "IMPALA-9781: Fix GCC 7 unaligned 128-bit loads / stores"

The change in decimal-util.h introduced undefined behavior.
See IMPALA-9800.

This reverts commit 227da84c3757eb857008e7b82aad622ed959eb84.

Change-Id: Id2b2e43c478a220ff545fdbca712e47905c8d22b
Reviewed-on: http://gerrit.cloudera.org:8080/16006
Reviewed-by: Joe McDonnell <[email protected]>
Reviewed-by: Tim Armstrong <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>


> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to