impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Impala Public Jenkins (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-5031: Suppress noisy UBSAN errors.
Date Fri, 17 Mar 2017 19:57:09 GMT
Impala Public Jenkins has submitted this change and it was merged.

Change subject: IMPALA-5031: Suppress noisy UBSAN errors.
......................................................................


IMPALA-5031: Suppress noisy UBSAN errors.

The current version of the standard C++ library that Impala is often
compiled with (libstdc++ 4.9.2) contains some undefined behavior. This
patch prevents that behavior from showing up in UBSAN errors.

The behavior in question is in violation of chapter 5 ("Expressions")
paragraph 4: "If during the evaluation of an expression, the result is
not mathematically defined or not in the range of representable values
for its type, the behavior is undefined." The bitwise complement of an
enumeration value does not necessarily produce another value of the
same enumeration, so the following can exhibit undefined behavior:

    enum _Ios_Fmtflags {
      _S_boolalpha = 1L << 0,
      _S_dec = 1L << 1,
      _S_fixed = 1L << 2,
      _S_hex = 1L << 3,
      _S_internal = 1L << 4,
      _S_left = 1L << 5,
      _S_oct = 1L << 6,
      _S_right = 1L << 7,
      _S_scientific = 1L << 8,
      _S_showbase = 1L << 9,
      _S_showpoint = 1L << 10,
      _S_showpos = 1L << 11,
      _S_skipws = 1L << 12,
      _S_unitbuf = 1L << 13,
      _S_uppercase = 1L << 14,
      _S_adjustfield = _S_left | _S_right | _S_internal,
      _S_basefield = _S_dec | _S_oct | _S_hex,
      _S_floatfield = _S_scientific | _S_fixed,
      _S_ios_fmtflags_end = 1L << 16
    };

    _Ios_Fmtflags operator~(_Ios_Fmtflags __a) {
      return _Ios_Fmtflags(~static_cast<int>(__a));
    }

This patch also fixes some omissions from the last UBSAN patch and
sets the UBSAN environment variables in all the useful locations.

Change-Id: Iac7a568ccc2d90ee174ccc286c108d0b28018fbb
Reviewed-on: http://gerrit.cloudera.org:8080/6378
Reviewed-by: Tim Armstrong <tarmstrong@cloudera.com>
Tested-by: Impala Public Jenkins
---
M bin/run-backend-tests.sh
M bin/start-impalad.sh
M bin/start-statestored.sh
A bin/ubsan-suppressions.txt
4 files changed, 31 insertions(+), 1 deletion(-)

Approvals:
  Impala Public Jenkins: Verified
  Tim Armstrong: Looks good to me, approved



-- 
To view, visit http://gerrit.cloudera.org:8080/6378
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iac7a568ccc2d90ee174ccc286c108d0b28018fbb
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Jim Apple <jbapple-impala@apache.org>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Tim Armstrong <tarmstrong@cloudera.com>

Mime
View raw message