New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 616957 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jun 2016
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

-Wstrict-overflow triggered for net::WindowedFilterTest

Project Member Reported by bcf@chromium.org, Jun 2 2016

Issue description

Version: master
OS: chromecast

What steps will reproduce the problem?
Build net_unittests
Compiler version is armv7a-cros-linux-gnueabi-g++.real.elf (4.9.2_cos_gg_21201ea_4.9.2-r116)
4.9.x-google 20150123 (prerelease)

What is the expected output?
Tests should build

What do you see instead?
In file included from
../../net/quic/congestion_control/windowed_filter_test.cc:5:0:
../../net/quic/congestion_control/windowed_filter.h: In member function 'virtual
void
net::test::{anonymous}::WindowedFilterTest_SampleChangesThirdBestMin_Test::TestBody()':
../../net/quic/congestion_control/windowed_filter.h:84:12: error: assuming
signed overflow does not occur when assuming that (X - c) <= X is always true
[-Werror=strict-overflow]
     } else if (Compare()(new_sample, estimates_[2].sample)) {
            ^
../../net/quic/congestion_control/windowed_filter.h: In member function 'virtual
void
net::test::{anonymous}::WindowedFilterTest_SampleChangesSecondBestMin_Test::TestBody()':
../../net/quic/congestion_control/windowed_filter.h:81:5: error: assuming signed
overflow does not occur when assuming that (X - c) <= X is always true
[-Werror=strict-overflow]
     if (Compare()(new_sample, estimates_[1].sample)) {
     ^
../../net/quic/congestion_control/windowed_filter.h: In member function 'virtual
void
net::test::{anonymous}::WindowedFilterTest_SampleChangesAllMins_Test::TestBody()':
../../net/quic/congestion_control/windowed_filter.h:74:5: error: assuming signed
overflow does not occur when assuming that (X - c) <= X is always true
[-Werror=strict-overflow]
     if (estimates_[0].sample == zero_value_ ||
     ^
../../net/quic/congestion_control/windowed_filter.h: In member function 'virtual
void net::test::{anonymous}::WindowedFilterTest_ExpireAllMins_Test::TestBody()':
../../net/quic/congestion_control/windowed_filter.h:84:12: error: assuming
signed overflow does not occur when assuming that (X + c) < X is always false
[-Werror=strict-overflow]
     } else if (Compare()(new_sample, estimates_[2].sample)) {

 
Project Member

Comment 1 by bugdroid1@chromium.org, Jun 6 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d66635d239b6f91dcb7e11160a0bee7d99bb2e92

commit d66635d239b6f91dcb7e11160a0bee7d99bb2e92
Author: bcf <bcf@chromium.org>
Date: Mon Jun 06 19:31:05 2016

net::WindowedFilterTest: Add explicit overflow checks

Aggressive inlining causes -Wstrict-overflow to be triggered.

BUG= 616957 
BUG=internal b/29059135

Review-Url: https://codereview.chromium.org/2036613002
Cr-Commit-Position: refs/heads/master@{#398092}

[modify] https://crrev.com/d66635d239b6f91dcb7e11160a0bee7d99bb2e92/net/quic/congestion_control/windowed_filter_test.cc

Comment 2 by bcf@chromium.org, Jun 6 2016

Status: Fixed (was: Started)

Sign in to add a comment