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

Issue 668207 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug

Blocking:
issue 82385



Sign in to add a comment

DataUseMeasurementTest.UserNotUserTest is failing on CrWinClangLLD64 tester

Project Member Reported by thakis@chromium.org, Nov 23 2016

Issue description

Started in one of these two builds:

https://build.chromium.org/p/chromium.fyi/builders/CrWinClangLLD64%20tester/builds/1340
https://build.chromium.org/p/chromium.fyi/builders/CrWinClangLLD64%20tester/builds/1341

Trigger is likely https://codereview.chromium.org/2462983003 or https://codereview.chromium.org/2491733002

DataUseMeasurementTest.UserNotUserTest (run #1):
[ RUN      ] DataUseMeasurementTest.UserNotUserTest
../../base/test/histogram_tester.cc(77): error: Value of: 0
Expected: count
Which is: 1
Histogram "DataUse.TrafficSize.System.Downstream.Foreground.NotCellular" does not exist.
../../base/test/histogram_tester.cc(77): error: Value of: 0
Expected: count
Which is: 1
Histogram "DataUse.TrafficSize.System.Upstream.Foreground.NotCellular" does not exist.
../../base/test/histogram_tester.cc(77): error: Value of: 0
Expected: count
Which is: 2
Histogram "DataUse.MessageSize.Suggestions" does not exist.
../../base/test/histogram_tester.cc(174): error: Value of: actual_count
  Actual: 0
Expected: expected_count
Which is: 1
Histogram "DataUse.TrafficSize.User.Downstream.Foreground.NotCellular" does not have the right total number of samples (1). It has (0).
[  FAILED  ] DataUseMeasurementTest.UserNotUserTest (2 ms)


The test only fails on this one bot, which kind of suggests that this might maybe be an LLD issue?
 

Comment 1 by thakis@chromium.org, Nov 23 2016

Cc: kundaji@chromium.org rajendrant@chromium.org
rajendrant, does this ring a bell? (If not, don't worry too much, might be a toolchain bug, and it's on an experimental bot)

Comment 2 by thakis@chromium.org, Nov 28 2016

Cc: h...@chromium.org
hans: I wonder if this is due to LTO?

Comment 3 by h...@chromium.org, Nov 28 2016

That bot doesn't do LTO builds (it's not setting is_official_build), so it must be something else
Sorry. I missed this bug.
I do not see any possible issue.

Comment 5 by thakis@chromium.org, Dec 12 2016

Repros in a local release component build, but not in a debug component build. Probably some ICF thing similar to  bug 635943 ?

Comment 6 by thakis@chromium.org, Dec 12 2016

Cc: ruiu@google.com r...@chromium.org
Here's the problem. DataUseMeasurementTest calls SetUserData() on a request either with key UserRequestUserDAtaForTesting::kUserDataKey or with data_use_measurement::DataUseUserDataKey::kUserDataKey. If the former key is used, that request is considered a "user request", else it's considered a "service request".

The first constant is defined like so:

class UserRequestUserDataForTesting : public base::SupportsUserData::Data,
                                      public URLRequestClassifier {
 public:
  static const void* const kUserDataKey;
...
};

// static
const void* const UserRequestUserDataForTesting::kUserDataKey =
    &UserRequestUserDataForTesting::kUserDataKey;



The second constant:

class DataUseUserData : public base::SupportsUserData::Data {
 public:
...
  static const void* const kUserDataKey;
};

// static
const void* const DataUseUserData::kUserDataKey =
    &DataUseUserData::kUserDataKey;

(https://cs.chromium.org/chromium/src/components/data_use_measurement/core/data_use_user_data.cc?sq=package:chromium&dr=CSs&rcl=1481559468&l=37)


It looks like lld ICFs these two kUserDataKeys together. Changing the first kUserDataKeyDefinition to

const int kRandom = 42;
const void* const UserRequestUserDataForTesting::kUserDataKey = &kRandom;

makes the test pass.



Merging these feels a bit aggressive to me, and bugs like this are probably difficult to diagnose for people who haven't seen this type of bug before. Should I just land the change I described above? Do we feel good with people having to debug something like this every now and then in the future?

Comment 7 by ruiu@google.com, Dec 12 2016

I think from the point of view of ICF, doing this makes sense, but I guess that most people expect that ICF merges only functions, so we probably should only functions.

Comment 8 by thakis@chromium.org, Dec 12 2016

Owner: thakis@chromium.org
Status: Started (was: Untriaged)
https://codereview.chromium.org/2565173005/

Comment 9 by r...@chromium.org, Dec 12 2016

This is the second time I've seen LLD's ICF of readonly data break user code, so I think we need to power it down. There's a reason link.exe doesn't do this.
Do we have any numbers on how much ICF'ing ro data saves?
Project Member

Comment 11 by bugdroid1@chromium.org, Dec 13 2016

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

commit 501fb6dbe391965bd11219475fcb1980491312f4
Author: thakis <thakis@chromium.org>
Date: Tue Dec 13 01:23:35 2016

Make DataUseMeasurementTest.UserNotUserTest pass with lld/win.

BUG= 668207 
TBR=rnk

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

[modify] https://crrev.com/501fb6dbe391965bd11219475fcb1980491312f4/components/data_use_measurement/core/data_use_measurement_unittest.cc

Sign in to add a comment