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

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

Commit 154c530c296036f65f8f7879e2a0eba101c6aced in impala's branch 
refs/heads/master from [~jbapple]
[ https://git-wip-us.apache.org/repos/asf?p=impala.git;h=154c530 ]

IMPALA-5031: Fix undefined behavior: right-shifting too far

In expr.shift, the C++ standard says of right shifts:

    The behavior is undefined if the right operand is negative, or
    greater than or equal to the length in bits of the promoted left
    operand.

In HdfsAvroScannerTest.DecimalTest, this is triggered, and the
interesting part of the backtrace is:

exec/hdfs-avro-scanner-ir.cc:272:18: runtime error: shift exponent 32 is too 
large for 32-bit type 'int32_t' (aka 'int')
    #0 0x1786f65 in HdfsAvroScanner::ReadAvroDecimal(int, unsigned char**, 
unsigned char*, bool, void*, MemPool*) exec/hdfs-avro-scanner-ir.cc:272:18
    #1 0x1617778 in void 
HdfsAvroScannerTest::TestReadAvroType<DecimalValue<int>, bool 
(HdfsAvroScanner::*)(int, unsigned char**, unsigned char*, bool, void*, 
MemPool*), unsigned long>(bool (HdfsAvroScanner::*)(int, unsigned char**, 
unsigned char*, bool, void*, MemPool*), unsigned long, unsigned char*, long, 
DecimalValue<int>, int, TErrorCode::type) exec/hdfs-avro-scanner-test.cc:88:20
    #2 0x1605705 in void HdfsAvroScannerTest::TestReadAvroDecimal<int>(unsigned 
char*, long, DecimalValue<int>, int, TErrorCode::type) 
exec/hdfs-avro-scanner-test.cc:184:5

Change-Id: Ic5be92912198af2a5e00053ceb9a4fab43ca6bb8
Reviewed-on: http://gerrit.cloudera.org:8080/11047
Reviewed-by: Jim Apple <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>


> UBSAN clean and method for testing UBSAN cleanliness
> ----------------------------------------------------
>
>                 Key: IMPALA-5031
>                 URL: https://issues.apache.org/jira/browse/IMPALA-5031
>             Project: IMPALA
>          Issue Type: Task
>          Components: Backend, Infrastructure
>    Affects Versions: Impala 2.9.0
>            Reporter: Jim Apple
>            Assignee: Jim Apple
>            Priority: Minor
>
> http://releases.llvm.org/3.8.0/tools/clang/docs/UndefinedBehaviorSanitizer.html
>  builds are supported after https://gerrit.cloudera.org/#/c/6186/, but 
> Impala's test suite triggers many errors under UBSAN. Those errors should be 
> fixed and then there should be a way to run the test suite under UBSAN and 
> fail if there were any errors detected.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to