You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Jim Apple (Code Review)" <ge...@cloudera.org> on 2017/03/14 05:36:40 UTC

[Impala-ASF-CR] IMPALA-5031: Suppress noisy UBSAN errors.

Jim Apple has uploaded a new change for review.

  http://gerrit.cloudera.org:8080/6378

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
---
M bin/run-backend-tests.sh
M bin/start-catalogd.sh
M bin/start-impalad.sh
M bin/start-statestored.sh
A bin/ubsan-suppressions.txt
5 files changed, 34 insertions(+), 1 deletion(-)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iac7a568ccc2d90ee174ccc286c108d0b28018fbb
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Jim Apple <jb...@apache.org>

[Impala-ASF-CR] IMPALA-5031: Suppress noisy UBSAN errors.

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
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 <ta...@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 <jb...@apache.org>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>

[Impala-ASF-CR] IMPALA-5031: Suppress noisy UBSAN errors.

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change.

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


Patch Set 2: Verified+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Iac7a568ccc2d90ee174ccc286c108d0b28018fbb
Gerrit-PatchSet: 2
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-5031: Suppress noisy UBSAN errors.

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change.

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


Patch Set 2:

Build started: http://jenkins.impala.io:8080/job/gerrit-verify-dryrun/390/

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Iac7a568ccc2d90ee174ccc286c108d0b28018fbb
Gerrit-PatchSet: 2
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-5031: Suppress noisy UBSAN errors.

Posted by "Jim Apple (Code Review)" <ge...@cloudera.org>.
Jim Apple has uploaded a new patch set (#2).

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
---
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(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/78/6378/2
-- 
To view, visit http://gerrit.cloudera.org:8080/6378
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Iac7a568ccc2d90ee174ccc286c108d0b28018fbb
Gerrit-PatchSet: 2
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>

[Impala-ASF-CR] IMPALA-5031: Suppress noisy UBSAN errors.

Posted by "Tim Armstrong (Code Review)" <ge...@cloudera.org>.
Tim Armstrong has posted comments on this change.

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


Patch Set 2: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Iac7a568ccc2d90ee174ccc286c108d0b28018fbb
Gerrit-PatchSet: 2
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Jim Apple <jb...@apache.org>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-HasComments: No