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

Issue 723608 link

Starred by 3 users

Issue metadata

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



Sign in to add a comment

Tip-of-tree fails to start under ASan due to ODR violations

Project Member Reported by terelius@chromium.org, May 17 2017

Issue description

Chrome Version: f5065232010251bad1cccddcc2a0d27ac2232f67
OS: Linux (Goobuntu)

What steps will reproduce the problem?
(1) Build chrome with ASan enabled (ninja -C out/Default chrome)
(2) Attempt to start chrome (out/Default/chrome)

What is the expected result?
Chrome starts.

What happens instead?
ASan induced crash due to ODR violations:

~/chromium/src (master)$ out/Default/chrome
=================================================================
==133496==ERROR: AddressSanitizer: odr-violation (0x7f5f06e6b820):
  [1] size=9 'switches::kHeadless' ../../ui/gfx/switches.cc:22:12
  [2] size=9 'switches::kHeadless' ../../ui/gfx/switches.cc:22:12
These globals were registered at these points:
  [1]:
    #0 0x56143e82fcde (~/chromium/src/out/Default/chrome+0x18cecde)
    #1 0x7f5f06c0596d (~/chromium/src/out/Default/./libgfx.so+0x39496d)

  [2]:
    #0 0x56143e82fcde  (~/chromium/src/out/Default/chrome+0x18cecde)
    #1 0x7f5f06865b0d (~/chromium/src/out/Default/./libcolor_space.so+0x47b0d)

==133496==HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0
SUMMARY: AddressSanitizer: odr-violation: global 'switches::kHeadless' at ../../ui/gfx/switches.cc:22:12
==133496==ABORTING

 

Comment 1 by h...@chromium.org, May 19 2017

Cc: dvallet@chromium.org thakis@chromium.org euge...@chromium.org
Status: Available (was: Untriaged)
eugenis: Does this make any sense to you? [1] and [2] are the same definition, so how does it become an ODR violation?

terelius: Where did you run into this? Is it on a bot somewhere?

Comment 2 by thakis@chromium.org, May 19 2017

They're from different .so's. something's getting statically linked into two shlibs, which isn't so great.
Right, a typical ODR. There are actually two instances of switches::kHeadless in the program, which can have all kinds of fun effects.

Comment 4 by thakis@chromium.org, May 19 2017

Owner: ccameron@chromium.org
This was broken in https://codereview.chromium.org/2795093002/ basically.
Re #1: This was a local compilation on my desktop.
Status: Assigned (was: Available)
It looks like component("geometry_skia") also defines GFX_IMPLEMENTATION in ui/gfx/BUILD.gn. I'll look at both of them.

Comment 8 by dcheng@chromium.org, Jun 16 2017

Cc: dcheng@chromium.org
I just hit this as well; it'd be nice to fix this. It's pretty easy to repro; the GN args I'm using on Linux are:

is_component_build = true
dcheck_always_on = true
use_goma = true
is_asan = true
is_debug = false  # Release build.
symbol_level = 2
Project Member

Comment 9 by bugdroid1@chromium.org, Jun 16 2017

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

commit fd83a51df6653957aa077d1f1083bfe4118920c4
Author: ccameron <ccameron@chromium.org>
Date: Fri Jun 16 21:26:12 2017

ui/gfx: Use separate components for color_space and switches

The need for switches to be separate is a temporary consequence of
many workarounds for the non-color-correct-rendering path spread
throughout the code. Once these workarounds are removed, the
switches component can be pulled back into color_space and sources.

R=thakis
TBR=avi for content/
BUG= 723608 

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

[modify] https://crrev.com/fd83a51df6653957aa077d1f1083bfe4118920c4/chrome/browser/about_flags.cc
[modify] https://crrev.com/fd83a51df6653957aa077d1f1083bfe4118920c4/chrome/browser/chromeos/login/chrome_restart_request.cc
[modify] https://crrev.com/fd83a51df6653957aa077d1f1083bfe4118920c4/content/browser/gpu/gpu_process_host.cc
[modify] https://crrev.com/fd83a51df6653957aa077d1f1083bfe4118920c4/content/browser/renderer_host/render_process_host_impl.cc
[modify] https://crrev.com/fd83a51df6653957aa077d1f1083bfe4118920c4/content/browser/renderer_host/render_view_host_impl.cc
[modify] https://crrev.com/fd83a51df6653957aa077d1f1083bfe4118920c4/content/renderer/gpu/render_widget_compositor.cc
[modify] https://crrev.com/fd83a51df6653957aa077d1f1083bfe4118920c4/content/shell/app/shell_main_delegate.cc
[modify] https://crrev.com/fd83a51df6653957aa077d1f1083bfe4118920c4/content/test/layouttest_support.cc
[modify] https://crrev.com/fd83a51df6653957aa077d1f1083bfe4118920c4/ui/compositor/compositor.cc
[modify] https://crrev.com/fd83a51df6653957aa077d1f1083bfe4118920c4/ui/compositor/compositor_util.cc
[modify] https://crrev.com/fd83a51df6653957aa077d1f1083bfe4118920c4/ui/display/mac/screen_mac.mm
[modify] https://crrev.com/fd83a51df6653957aa077d1f1083bfe4118920c4/ui/gfx/BUILD.gn
[modify] https://crrev.com/fd83a51df6653957aa077d1f1083bfe4118920c4/ui/gfx/color_space.h
[add] https://crrev.com/fd83a51df6653957aa077d1f1083bfe4118920c4/ui/gfx/color_space_export.h
[add] https://crrev.com/fd83a51df6653957aa077d1f1083bfe4118920c4/ui/gfx/color_space_switches.cc
[add] https://crrev.com/fd83a51df6653957aa077d1f1083bfe4118920c4/ui/gfx/color_space_switches.h
[modify] https://crrev.com/fd83a51df6653957aa077d1f1083bfe4118920c4/ui/gfx/color_space_win.h
[modify] https://crrev.com/fd83a51df6653957aa077d1f1083bfe4118920c4/ui/gfx/icc_profile.cc
[modify] https://crrev.com/fd83a51df6653957aa077d1f1083bfe4118920c4/ui/gfx/icc_profile.h
[modify] https://crrev.com/fd83a51df6653957aa077d1f1083bfe4118920c4/ui/gfx/mac/io_surface.cc
[modify] https://crrev.com/fd83a51df6653957aa077d1f1083bfe4118920c4/ui/gfx/skia_color_space_util.cc
[modify] https://crrev.com/fd83a51df6653957aa077d1f1083bfe4118920c4/ui/gfx/skia_color_space_util.h
[modify] https://crrev.com/fd83a51df6653957aa077d1f1083bfe4118920c4/ui/gfx/switches.cc
[modify] https://crrev.com/fd83a51df6653957aa077d1f1083bfe4118920c4/ui/gfx/switches.h
[add] https://crrev.com/fd83a51df6653957aa077d1f1083bfe4118920c4/ui/gfx/switches_export.h

Status: Fixed (was: Assigned)

Sign in to add a comment