New issue
Advanced search Search tips

Issue 776705 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

Compiling with gcc fails under base/numerics

Reported by tomas.po...@gmail.com, Oct 20 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36

Steps to reproduce the problem:
Try to compile Chromium with gcc 6.3.1

What is the expected behavior?

What went wrong?
[70/363] /opt/rh/devtoolset-6/root/usr/bin/g++ -MMD -MF base/metrics/histogram_samples.o.d  -I/home/machine/rpmbuild/BUILD/chromium-63.0.3239.9/out_bootstrap/gen -I/home/machine/rpmbuild/BUILD/chromium-63.0.3239.9 -DNO_TCMALLOC -D__STDC_FORMAT_MACROS -O2 -g0 -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -pthread -pipe -fno-exceptions -std=c++14 -Wno-c++11-narrowing -c /home/machine/rpmbuild/BUILD/chromium-63.0.3239.9/base/metrics/histogram_samples.cc -o base/metrics/histogram_samples.o
FAILED: base/metrics/histogram_samples.o 
/opt/rh/devtoolset-6/root/usr/bin/g++ -MMD -MF base/metrics/histogram_samples.o.d  -I/home/machine/rpmbuild/BUILD/chromium-63.0.3239.9/out_bootstrap/gen -I/home/machine/rpmbuild/BUILD/chromium-63.0.3239.9 -DNO_TCMALLOC -D__STDC_FORMAT_MACROS -O2 -g0 -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -pthread -pipe -fno-exceptions -std=c++14 -Wno-c++11-narrowing -c /home/machine/rpmbuild/BUILD/chromium-63.0.3239.9/base/metrics/histogram_samples.cc -o base/metrics/histogram_samples.o
In file included from /home/machine/rpmbuild/BUILD/chromium-63.0.3239.9/base/numerics/checked_math.h:13:0,
                 from /home/machine/rpmbuild/BUILD/chromium-63.0.3239.9/base/numerics/safe_math.h:8,
                 from /home/machine/rpmbuild/BUILD/chromium-63.0.3239.9/base/time/time.h:63,
                 from /home/machine/rpmbuild/BUILD/chromium-63.0.3239.9/base/metrics/histogram_base.h:20,
                 from /home/machine/rpmbuild/BUILD/chromium-63.0.3239.9/base/metrics/histogram_samples.h:16,
                 from /home/machine/rpmbuild/BUILD/chromium-63.0.3239.9/base/metrics/histogram_samples.cc:5:
/home/machine/rpmbuild/BUILD/chromium-63.0.3239.9/base/numerics/checked_math_impl.h: In instantiation of 'static constexpr bool base::internal::CheckedSubOp<T, U, typename std::enable_if<(std::is_integral<_Tp>::value && std::is_integral<_Tp2>::value)>::type>::Do(T, U, V*) [with V = short unsigned int; T = short unsigned int; U = short unsigned int]':
/home/machine/rpmbuild/BUILD/chromium-63.0.3239.9/base/numerics/checked_math.h:245:29:   required from 'constexpr base::internal::CheckedNumeric<T>& base::internal::CheckedNumeric<T>::MathOp(R) [with M = base::internal::CheckedSubOp; R = short unsigned int; T = short unsigned int]'
/home/machine/rpmbuild/BUILD/chromium-63.0.3239.9/base/numerics/checked_math.h:340:1:   required from 'constexpr base::internal::CheckedNumeric<T>& base::internal::CheckedNumeric<T>::operator-=(R) [with Src = short unsigned int; T = short unsigned int]'
/home/machine/rpmbuild/BUILD/chromium-63.0.3239.9/base/metrics/histogram_samples.cc:145:20:   required from here
/home/machine/rpmbuild/BUILD/chromium-63.0.3239.9/base/numerics/checked_math_impl.h:130:15: error: uninitialized variable 'presult' in 'constexpr' function
     Promotion presult;
               ^~~~~~~
/home/machine/rpmbuild/BUILD/chromium-63.0.3239.9/base/numerics/checked_math_impl.h: In instantiation of 'static constexpr bool base::internal::CheckedAddOp<T, U, typename std::enable_if<(std::is_integral<_Tp>::value && std::is_integral<_Tp2>::value)>::type>::Do(T, U, V*) [with V = short unsigned int; T = short unsigned int; U = short unsigned int]':
/home/machine/rpmbuild/BUILD/chromium-63.0.3239.9/base/numerics/checked_math.h:245:29:   required from 'constexpr base::internal::CheckedNumeric<T>& base::internal::CheckedNumeric<T>::MathOp(R) [with M = base::internal::CheckedAddOp; R = short unsigned int; T = short unsigned int]'
/home/machine/rpmbuild/BUILD/chromium-63.0.3239.9/base/numerics/checked_math.h:339:1:   required from 'constexpr base::internal::CheckedNumeric<T>& base::internal::CheckedNumeric<T>::operator+=(R) [with Src = short unsigned int; T = short unsigned int]'
/home/machine/rpmbuild/BUILD/chromium-63.0.3239.9/base/metrics/histogram_samples.cc:147:20:   required from here
/home/machine/rpmbuild/BUILD/chromium-63.0.3239.9/base/numerics/checked_math_impl.h:70:15: error: uninitialized variable 'presult' in 'constexpr' function
     Promotion presult;
               ^~~~~~~

There are other fails in base/numerics/clamped_math_impl.h as well.

Did this work before? N/A 

Chrome version: 63.0.3239.9  Channel: dev
OS Version: 
Flash Version:
 
Cc: thomasanderson@chromium.org
Labels: Needs-Triage-M63
Project Member

Comment 2 by bugdroid1@chromium.org, Oct 23 2017

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

commit ec48e4ae39eea7377870732a1bb9cf62e84af42e
Author: Tomas Popela <tomas.popela@gmail.com>
Date: Mon Oct 23 10:25:37 2017

Fix the build of base/numerics with GCC

Initialize the uninitialized variables where the build is failing.

BUG= 776705 

Change-Id: I5782e18086a752b3676f8738930bf0553f3f97ad
Reviewed-on: https://chromium-review.googlesource.com/730709
Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: Justin Schuh <jschuh@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510753}
[modify] https://crrev.com/ec48e4ae39eea7377870732a1bb9cf62e84af42e/base/numerics/checked_math_impl.h
[modify] https://crrev.com/ec48e4ae39eea7377870732a1bb9cf62e84af42e/base/numerics/clamped_math_impl.h

Status: Fixed (was: Unconfirmed)
Cc: jsc...@chromium.org
Labels: Merge-Request-63
Owner: wolenetz@chromium.org
In https://bugs.chromium.org/p/chromium/issues/detail?id=777391#c10, the reporter of this issue requested that we merge the fix for this issue (#2) to M-63.

Self-assigning and requesting merge, though I'll need explicit lgtm and help with merge request justification from jschuh@ before being comfortable with landing such merge to M-63 since I'm less familiar with #2.

Comment 5 by jsc...@chromium.org, Oct 26 2017

It should be a safe merge, because I can't see how the emitted binary would actually change on any of the compilers we support. The only impact really should be fixing the compile failure on GCC.
Project Member

Comment 6 by sheriffbot@chromium.org, Oct 26 2017

Labels: -Merge-Request-63 Hotlist-Merge-Approved Merge-Approved-63
Your change meets the bar and is auto-approved for M63. Please go ahead and merge the CL to branch 3239 manually. Please contact milestone owner if you have questions.
Owners: cmasso@(Android), cmasso@(iOS), gkihumba@(ChromeOS), govind@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 7 by gov...@chromium.org, Oct 26 2017

Please merge your change to M63 branch 3239 by 4:00 PM PT, today(Thursday). Thank you.
@#5-7 thanks. I'll cherry-pick this shortly.
Project Member

Comment 9 by bugdroid1@chromium.org, Oct 26 2017

Labels: -merge-approved-63 merge-merged-3239
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8190cfb2c0e2e0e1b93d730d87fcfb7ba89f8391

commit 8190cfb2c0e2e0e1b93d730d87fcfb7ba89f8391
Author: Tomas Popela <tomas.popela@gmail.com>
Date: Thu Oct 26 19:24:04 2017

To M63: Fix the build of base/numerics with GCC

Initialize the uninitialized variables where the build is failing.

BUG= 776705 
TBR=jschuh@chromium.org

Change-Id: I5782e18086a752b3676f8738930bf0553f3f97ad
Reviewed-on: https://chromium-review.googlesource.com/730709
Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: Justin Schuh <jschuh@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#510753}(cherry picked from commit ec48e4ae39eea7377870732a1bb9cf62e84af42e)
Reviewed-on: https://chromium-review.googlesource.com/740221
Reviewed-by: Matthew Wolenetz <wolenetz@chromium.org>
Cr-Commit-Position: refs/branch-heads/3239@{#247}
Cr-Branched-From: adb61db19020ed8ecee5e91b1a0ea4c924ae2988-refs/heads/master@{#508578}
[modify] https://crrev.com/8190cfb2c0e2e0e1b93d730d87fcfb7ba89f8391/base/numerics/checked_math_impl.h
[modify] https://crrev.com/8190cfb2c0e2e0e1b93d730d87fcfb7ba89f8391/base/numerics/clamped_math_impl.h

Sign in to add a comment