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

Issue 677223 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner: ----
Closed: Jan 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug

Blocking:
issue 578344



Sign in to add a comment

rewrite_to_chrome_style asserts/fails about conflicting overrides

Project Member Reported by lukasza@chromium.org, Dec 28 2016

Issue description

Error when running the tool:

rewrite_to_chrome_style: /usr/local/google/home/lukasza/src/chromium4/src/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp:149: bool (anonymous namespace)::MatchAllOverriddenMethods(const clang::CXXMethodDecl &, T &&, clang::ast_matchers::internal::ASTMatchFinder *, clang::ast_matchers::internal::BoundNodesTreeBuilder *) [T = const clang::ast_matchers::internal::Matcher<clang::CXXMethodDecl> &]: Assertion `override_matches != override_not_matches' failed.
Aborted (core dumped)
 

Comment 1 Deleted

Comment 2 Deleted

Repro:
rewrite_to_chrome_style -p out/gn/compile_commands.json third_party/WebKit/Source/core/testing/Internals.cpp
override_not_matches = 1
override_matches = 1

Problematic decl: CXXMethodDecl 0x7f9c5aefad00 <../../third_party/WebKit/Source/platform/heap/Visitor.h:130:52, line:74:35> col:21 used trace 'void (class blink::Visitor *)' virtual

Mismatched overrides: NOT MATCHING: gen/blink/core/testing/InternalSettingsGenerated.h:158:3 <Spelling=../../third_party/WebKit/Source/platform/heap/Visitor.h:130:52> : CXXMethodDecl 0x7f9c5aef1a30 <../../third_party/WebKit/Source/platform/heap/Visitor.h:130:52, line:74:35> col:21 used trace 'void (class blink::Visitor *)' virtual

MATCHING: ../../third_party/WebKit/Source/platform/Supplementable.h:112:3 <Spelling=../../third_party/WebKit/Source/platform/heap/Visitor.h:132:64> : CXXMethodDecl 0x7f9c5d9798b8 <../../third_party/WebKit/Source/platform/heap/Visitor.h:132:64, line:89:67> col:21 trace 'void (class blink::Visitor *)' virtual


Which kind of makes sense.  To restore consistency we might want to / have to start rewriting identifiers declared in generated code?
Note that when (locally/temporarily) allowing rewriting of identifiers declared in generated code, I am still hitting the conflicting-overrides-assert in a different place:

override_not_matches = 1
override_matches = 1

Problematic decl: CXXMethodDecl 0x7f8018bf5e90 <../../third_party/WebKit/Source/core/inspector/InspectorSession.h:54:3, col:37> col:8 flushProtocolNotifications 'void (void)'

Mismatched overrides: MATCHING: gen/blink/core/inspector/protocol/Forward.h:87:5 : CXXMethodDecl 0x1137adc0 <gen/blink/core/inspector/protocol/Forward.h:87:5, col:49> col:18 flushProtocolNotifications 'void (void)' virtual pure

NOT MATCHING: ../../v8/include/v8-inspector.h:254:5 : CXXMethodDecl 0x113735a0 <../../v8/include/v8-inspector.h:254:5, col:49> col:18 flushProtocolNotifications 'void (void)' virtual pure
gen/blink/core/inspector/protocol/Forward.h (the last and problematic part of the file) is generated via third_party/inspector_protocol/lib/FrontendChannel_h.template.

It seems that //third_party/inspector_protocol/inspector_protocol.gni is imported from:
- third_party/WebKit/Source/core/inspector/BUILD.gn - namespace = blink::protocol
- components/ui_devtools/BUILD.gn - namespace = ui::devtools::protocol
- content/browser/devtools/BUILD.gn - namespace = content::protocol
Additionally, v8/third_party/inspector_protocol/inspector_protocol.gni is imported from:
- v8/src/inspector/BUILD.gn - namespace = v8_inspector::protocol

So - it seems that FrontendChannel_h.template controls generation of code both in Blink and outside of Blink namespaces.  Therefore we probably want to avoid renaming things in code generated in blink::protocol namespace.

dcheng@ - WDYT about proceeding with option #1 below?

We need to do something about #c4 above.

Option #1: special-case this - don't assert if the method name is "trace" (but keep asserting otherwise).

Option #2: stop asserting altogether and instead print some diagnostics to stderr and fallback to something (to saying "matched")?  This has some risk of silently introducing subtle changes in behavior after the rename.

Option #3: start renaming identifiers declared in generated code (i.e. https://codereview.chromium.org/2604023002/).
Cc: lukasza@chromium.org
Owner: ----
Status: Available (was: Started)
Project Member

Comment 9 by bugdroid1@chromium.org, Jan 5 2017

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

commit e399244f0856a821a469e7f5a4fd5105e786020b
Author: lukasza <lukasza@chromium.org>
Date: Thu Jan 05 19:40:51 2017

Safe fallback for known "conflicting overrides" during rename.

BUG= 677223 

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

[modify] https://crrev.com/e399244f0856a821a469e7f5a4fd5105e786020b/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp

Cc: danakj@chromium.org
Status: Fixed (was: Available)
AFAIK, we don't get a "conflicting overrides" error anymore.

Sign in to add a comment