From a2644c06ee28c97ab670d59c416e59b8325fc678 Mon Sep 17 00:00:00 2001 From: "kjellander@webrtc.org" Date: Thu, 25 Feb 2016 14:23:15 +0100 Subject: [PATCH] Disable tests failing under UBSan to enable deployment to main waterfall. modules_unittests: https://build.chromium.org/p/client.webrtc.fyi/builders/Linux%20UBSan/builds/1138/steps/modules_unittests/logs/stdio [ RUN ] ByteIoTest.Test64SBitBigEndian ../../webrtc/modules/rtp_rtcp/source/byte_io_unittest.cc:34:33: runtime error: shift exponent 64 is too large for 64-bit type 'long' rtc_unittests: https://build.chromium.org/p/client.webrtc.fyi/builders/Linux%20UBSan/builds/1138/steps/rtc_unittests/logs/stdio [ RUN ] IPAddressTest.TestCountIPMaskBits ../../webrtc/base/ipaddress.cc:415:20: runtime error: negation of -2147483648 cannot be represented in type 'int32_t' (aka 'int'); cast to an unsigned type to negate this value to itself [ RUN ] BandwidthSmootherTest.TestSampleRollover ../../webrtc/base/rollingaccumulator.h:73:22: runtime error: signed integer overflow: 2147483647 * 2147483647 cannot be represented in type 'int' [ RUN ] RandomNumberGeneratorTest.UniformSignedInterval ../../webrtc/base/random_unittest.cc:121:50: runtime error: signed integer overflow: 2147483647 - -2147483648 cannot be represented in type 'int' rtc_media_unittests: https://build.chromium.org/p/client.webrtc.fyi/builders/Linux%20UBSan/builds/1138/steps/rtc_media_unittests/logs/stdio [ RUN ] VideoCommonTest.TestComputeScaleWithHighFps ../../webrtc/media/base/videocommon.cc:75:34: runtime error: signed integer overflow: 2621440 - -2147483648 cannot be represented in type 'int' BUG=webrtc:5487, webrtc:5490, webrtc:5491 NOTRY=True R=pbos@webrtc.org TBR=henrika@webrtc.org Review URL: https://codereview.webrtc.org/1727233005 . Cr-Commit-Position: refs/heads/master@{#11764} --- webrtc/base/bandwidthsmoother_unittest.cc | 8 ++++- webrtc/base/ipaddress_unittest.cc | 8 ++++- webrtc/base/random_unittest.cc | 8 ++++- webrtc/media/base/videocommon_unittest.cc | 8 ++++- .../rtp_rtcp/source/byte_io_unittest.cc | 32 ++++++++++++++++--- 5 files changed, 56 insertions(+), 8 deletions(-) diff --git a/webrtc/base/bandwidthsmoother_unittest.cc b/webrtc/base/bandwidthsmoother_unittest.cc index 132c0b13a7..0ac753e6a7 100644 --- a/webrtc/base/bandwidthsmoother_unittest.cc +++ b/webrtc/base/bandwidthsmoother_unittest.cc @@ -88,7 +88,13 @@ TEST(BandwidthSmootherTest, TestSampleTooFewSamples) { EXPECT_EQ(kBandwidthSample, mon.get_bandwidth_estimation()); } -TEST(BandwidthSmootherTest, TestSampleRollover) { +// Disabled for UBSan: https://bugs.chromium.org/p/webrtc/issues/detail?id=5491 +#ifdef UNDEFINED_SANITIZER +#define MAYBE_TestSampleRollover DISABLED_TestSampleRollover +#else +#define MAYBE_TestSampleRollover TestSampleRollover +#endif +TEST(BandwidthSmootherTest, MAYBE_TestSampleRollover) { const int kHugeBandwidth = 2000000000; // > INT_MAX/1.1 BandwidthSmoother mon(kHugeBandwidth, kTimeBetweenIncrease, diff --git a/webrtc/base/ipaddress_unittest.cc b/webrtc/base/ipaddress_unittest.cc index 62773c143a..cbe8f26548 100644 --- a/webrtc/base/ipaddress_unittest.cc +++ b/webrtc/base/ipaddress_unittest.cc @@ -669,7 +669,13 @@ TEST(IPAddressTest, TestAsIPv6Address) { EXPECT_EQ(addr, addr2); } -TEST(IPAddressTest, TestCountIPMaskBits) { +// Disabled for UBSan: https://bugs.chromium.org/p/webrtc/issues/detail?id=5491 +#ifdef UNDEFINED_SANITIZER +#define MAYBE_TestCountIPMaskBits DISABLED_TestCountIPMaskBits +#else +#define MAYBE_TestCountIPMaskBits TestCountIPMaskBits +#endif +TEST(IPAddressTest, MAYBE_TestCountIPMaskBits) { IPAddress mask; // IPv4 on byte boundaries EXPECT_PRED2(CheckMaskCount, "255.255.255.255", 32); diff --git a/webrtc/base/random_unittest.cc b/webrtc/base/random_unittest.cc index febae1c28f..3b47a00806 100644 --- a/webrtc/base/random_unittest.cc +++ b/webrtc/base/random_unittest.cc @@ -198,7 +198,13 @@ TEST(RandomNumberGeneratorTest, UniformUnsignedInterval) { BucketTestUnsignedInterval(1000, 1000000, 0, 2147483999, 4, &prng); } -TEST(RandomNumberGeneratorTest, UniformSignedInterval) { +// Disabled for UBSan: https://bugs.chromium.org/p/webrtc/issues/detail?id=5491 +#ifdef UNDEFINED_SANITIZER +#define MAYBE_UniformSignedInterval DISABLED_UniformSignedInterval +#else +#define MAYBE_UniformSignedInterval UniformSignedInterval +#endif +TEST(RandomNumberGeneratorTest, MAYBE_UniformSignedInterval) { Random prng(66260695729ull); BucketTestSignedInterval(2, 100000, 0, 1, 3, &prng); BucketTestSignedInterval(7, 100000, -2, 4, 3, &prng); diff --git a/webrtc/media/base/videocommon_unittest.cc b/webrtc/media/base/videocommon_unittest.cc index 72b828c028..84a728b19b 100644 --- a/webrtc/media/base/videocommon_unittest.cc +++ b/webrtc/media/base/videocommon_unittest.cc @@ -126,7 +126,13 @@ TEST(VideoCommonTest, TestComputeScaleWithLowFps) { } // Same as TestComputeScale but with 15 fps instead of 5 fps. -TEST(VideoCommonTest, TestComputeScaleWithHighFps) { +// Disabled for UBSan: https://bugs.chromium.org/p/webrtc/issues/detail?id=5487 +#ifdef UNDEFINED_SANITIZER +#define MAYBE_TestComputeScaleWithHighFps DISABLED_TestComputeScaleWithHighFps +#else +#define MAYBE_TestComputeScaleWithHighFps TestComputeScaleWithHighFps +#endif +TEST(VideoCommonTest, MAYBE_TestComputeScaleWithHighFps) { int scaled_width, scaled_height; // Request small enough but high fps. Expect 1/2 size. diff --git a/webrtc/modules/rtp_rtcp/source/byte_io_unittest.cc b/webrtc/modules/rtp_rtcp/source/byte_io_unittest.cc index d0e6cbb6eb..fbc6bf8469 100644 --- a/webrtc/modules/rtp_rtcp/source/byte_io_unittest.cc +++ b/webrtc/modules/rtp_rtcp/source/byte_io_unittest.cc @@ -140,14 +140,26 @@ TEST_F(ByteIoTest, Test24SBitBigEndian) { TestWrite::WriteBigEndian, 3>(true); } -TEST_F(ByteIoTest, Test32SBitBigEndian) { +// Disabled for UBSan: https://bugs.chromium.org/p/webrtc/issues/detail?id=5490 +#ifdef UNDEFINED_SANITIZER +#define MAYBE_Test32SBitBigEndian DISABLED_Test32SBitBigEndian +#else +#define MAYBE_Test32SBitBigEndian Test32SBitBigEndian +#endif +TEST_F(ByteIoTest, MAYBE_Test32SBitBigEndian) { TestRead::ReadBigEndian, sizeof(int32_t)>(true); TestWrite::WriteBigEndian, sizeof(int32_t)>(true); } -TEST_F(ByteIoTest, Test64SBitBigEndian) { +// Disabled for UBSan: https://bugs.chromium.org/p/webrtc/issues/detail?id=5490 +#ifdef UNDEFINED_SANITIZER +#define MAYBE_Test64SBitBigEndian DISABLED_Test64SBitBigEndian +#else +#define MAYBE_Test64SBitBigEndian Test64SBitBigEndian +#endif +TEST_F(ByteIoTest, MAYBE_Test64SBitBigEndian) { TestRead::ReadBigEndian, sizeof(int64_t)>(true); TestWrite::WriteBigEndian, @@ -192,14 +204,26 @@ TEST_F(ByteIoTest, Test24SBitLittleEndian) { TestWrite::WriteLittleEndian, 3>(false); } -TEST_F(ByteIoTest, Test32SBitLittleEndian) { +// Disabled for UBSan: https://bugs.chromium.org/p/webrtc/issues/detail?id=5490 +#ifdef UNDEFINED_SANITIZER +#define MAYBE_Test32SBitLittleEndian DISABLED_Test32SBitLittleEndian +#else +#define MAYBE_Test32SBitLittleEndian Test32SBitLittleEndian +#endif +TEST_F(ByteIoTest, MAYBE_Test32SBitLittleEndian) { TestRead::ReadLittleEndian, sizeof(int32_t)>(false); TestWrite::WriteLittleEndian, sizeof(int32_t)>(false); } -TEST_F(ByteIoTest, Test64SBitLittleEndian) { +// Disabled for UBSan: https://bugs.chromium.org/p/webrtc/issues/detail?id=5490 +#ifdef UNDEFINED_SANITIZER +#define MAYBE_Test64SBitLittleEndian DISABLED_Test64SBitLittleEndian +#else +#define MAYBE_Test64SBitLittleEndian Test64SBitLittleEndian +#endif +TEST_F(ByteIoTest, MAYBE_Test64SBitLittleEndian) { TestRead::ReadLittleEndian, sizeof(int64_t)>(false); TestWrite::WriteLittleEndian,