New issue
Advanced search Search tips

Issue 831081 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug

Blocking:
issue 828582



Sign in to add a comment

ToT clang has new "casts away qualifiers" errors

Project Member Reported by h...@chromium.org, Apr 10 2018

Issue description

For example, from https://ci.chromium.org/buildbot/tryserver.chromium.linux/linux_chromium_asan_rel_ng/580229


In file included from ../../third_party/webrtc/call/rtp_bitrate_configurator.cc:11:
In file included from ../../third_party/webrtc/call/rtp_bitrate_configurator.h:14:
In file included from ../../third_party/webrtc/call/bitrate_constraints.h:16:
../../third_party/webrtc/api/optional.h:41:35: error: reinterpret_cast from 'const int *' to 'void *' casts away qualifiers
      FunctionThatDoesNothingImpl(reinterpret_cast<void*>(x)));
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~
../../third_party/webrtc/api/optional.h:280:45: note: in instantiation of function template specialization 'rtc::optional_internal::FunctionThatDoesNothing<const int>' requested here
    return has_value_ ? *optional_internal::FunctionThatDoesNothing(&value_)
                                            ^
../../third_party/webrtc/call/rtp_bitrate_configurator.cc:70:53: note: in instantiation of member function 'rtc::Optional<int>::value_or' requested here
      std::max(bitrate_config_mask_.min_bitrate_bps.value_or(0),
                                                    ^


This is due to Clang r329517.

Since it's an error we can't suppress it. Hopefully there aren't too many to fix.
 

Comment 1 by h...@chromium.org, Apr 10 2018

Status: Started (was: Assigned)
So far it only seems to fire in webrtc: https://webrtc-review.googlesource.com/c/src/+/68941

That also explains why it's only happening in asan builds: FunctionThatDoesNothing is only used there.
Project Member

Comment 2 by bugdroid1@chromium.org, Apr 10 2018

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

commit bda78c9464f4d0e6ff26b0035624a967269c3b0a
Author: Hans Wennborg <hans@chromium.org>
Date: Tue Apr 10 11:53:05 2018

Fix cast of const-qualified types in FunctionThatDoesNothingImpl

Recent Clang versions fixed a bug which had previously allowed some casts that
removed qualifiers to go undiagnosed.

This fixes the following kind of error:

  ./../third_party/webrtc/api/optional.h:41:35: error: reinterpret_cast from
        'const int *' to 'void *' casts away qualifiers
	FunctionThatDoesNothingImpl(reinterpret_cast<void*>(x)));
				    ^~~~~~~~~~~~~~~~~~~~~~~~~~
  ../../third_party/webrtc/api/optional.h:280:45: note: in instantiation of
      function template specialization
      'rtc::optional_internal::FunctionThatDoesNothing<const int>' requested here
      return has_value_ ? *optional_internal::FunctionThatDoesNothing(&value_)
					      ^
  ../../third_party/webrtc/call/rtp_bitrate_configurator.cc:70:53:

        note: in instantiation of member function 'rtc::Optional<int>::value_or'
        requested here
	std::max(bitrate_config_mask_.min_bitrate_bps.value_or(0),
                                                    ^

Bug:  chromium:831081 
Change-Id: I032ebd1f052fa2a50548e984febb7fa462df42ea
Reviewed-on: https://webrtc-review.googlesource.com/68941
Commit-Queue: Hans Wennborg <hans@chromium.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22804}
[modify] https://crrev.com/bda78c9464f4d0e6ff26b0035624a967269c3b0a/api/optional.cc
[modify] https://crrev.com/bda78c9464f4d0e6ff26b0035624a967269c3b0a/api/optional.h

Comment 3 by h...@chromium.org, Apr 10 2018

We need that rolled into Chromium now. Looks like it last rolled in Saturday (https://chromium-review.googlesource.com/1001052). I'm not sure what's up with that.

The auto-roller is here: https://webrtc-chromium-roll.skia.org/

Comment 4 by h...@chromium.org, Apr 10 2018

Cc: srte@chromium.org
+srte who's working on unblocking the webrtc roll.
Project Member

Comment 5 by bugdroid1@chromium.org, Apr 11 2018

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

commit 4ef762b207fa57159429481519fa4d4a9b16f409
Author: webrtc-chromium-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com <webrtc-chromium-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com>
Date: Wed Apr 11 02:51:36 2018

Roll src/third_party/webrtc/ 4da18e89b..3ef3bfc2a (33 commits)

https://webrtc.googlesource.com/src.git/+log/4da18e89bdee..3ef3bfc2aafa

$ git log 4da18e89b..3ef3bfc2a --date=short --no-merges --format='%ad %ae %s'

Created with:
  roll-dep src/third_party/webrtc
BUG=chromium:None,chromium:None,chromium:b/77579859,chromium:828350,chromium:831081,chromium:b/77579859,chromium:None,chromium:b/77579859,chromium:653569,chromium:None,chromium:none


The AutoRoll server is located here: https://webrtc-chromium-roll.skia.org

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC'd on the roll, and stop the roller if necessary.


CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_chromium_archive_rel_ng;master.tryserver.chromium.mac:mac_chromium_archive_rel_ng;master.tryserver.chromium.win:win-msvc-dbg
TBR=webrtc-chromium-sheriffs-robots@google.com

Change-Id: I71719fdca346a7f4d6ee290065e95b89427cba70
Reviewed-on: https://chromium-review.googlesource.com/1005366
Reviewed-by: webrtc-chromium-autoroll <webrtc-chromium-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com>
Commit-Queue: webrtc-chromium-autoroll <webrtc-chromium-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#549738}
[modify] https://crrev.com/4ef762b207fa57159429481519fa4d4a9b16f409/DEPS

Comment 6 by h...@chromium.org, Apr 11 2018

Status: Fixed (was: Started)

Sign in to add a comment