Jim Apple has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/13889


Change subject: IMPALA-5031: Fix undefined behavior: ptr overflow
......................................................................

IMPALA-5031: Fix undefined behavior: ptr overflow

In expr.add, the standard says:

    When an expression that has integral type is added to or
    subtracted from a pointer, the result has the type of the pointer
    operand. ... If both the pointer operand and the result point to
    elements of the same array object, or one past the last element of
    the array object, the evaluation shall not produce an overflow;
    otherwise, the behavior is undefined.

This is triggered in the end-to-end tests.h The interesting part of
the backtrace is:

exec/parquet/hdfs-parquet-scanner.cc:1405:45: runtime error: pointer
  index expression with base 0x00001300e0e9 overflowed to
  0xffffffff1300e0ea
    #0 HdfsParquetScanner::ProcessFooter()
       exec/parquet/hdfs-parquet-scanner.cc:1405:45
    #1 HdfsParquetScanner::Open(ScannerContext*)
       exec/parquet/hdfs-parquet-scanner.cc:186:26
    #2 HdfsScanNodeBase::CreateAndOpenScannerHelper(
       HdfsPartitionDescriptor*, ScannerContext*,
       scoped_ptr<HdfsScanner>*) exec/hdfs-scan-node-base.cc:721:59
    #3 HdfsScanNodeMt::CreateAndOpenScanner(HdfsPartitionDescriptor*,
       ScannerContext*, scoped_ptr<HdfsScanner>*)
       exec/hdfs-scan-node-mt.cc:127:19
    #4 HdfsScanNodeMt::GetNext(RuntimeState*, RowBatch*, bool*)
       exec/hdfs-scan-node-mt.cc:97:21

Change-Id: I81c7db75b564045106edf3d46e2c4a62be77359f
---
M be/src/exec/parquet/hdfs-parquet-scanner.cc
1 file changed, 6 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/89/13889/1
--
To view, visit http://gerrit.cloudera.org:8080/13889
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I81c7db75b564045106edf3d46e2c4a62be77359f
Gerrit-Change-Number: 13889
Gerrit-PatchSet: 1
Gerrit-Owner: Jim Apple <jbap...@apache.org>

Reply via email to