Add guards or tests against using base::FeatureList in the wrong order |
|||||
Issue descriptionThis bug is for work to prevent a crash like issue 736251 from happening in production again. There are some proposals on that issue in comments 32-37.
,
Jun 26 2017
,
Jun 26 2017
,
Jun 26 2017
It looks like the other problem here was this only triggered in official builds. Unofficial builds never create a VariationsService. https://cs.chromium.org/chromium/src/components/variations/service/variations_service.cc?rcl=86716087cc70f251aad2111ec6d86711239c44ab&l=487 That's probably why I never noticed when testing locally. (I just tried the patch again on a non-clean profile and it was just fine.)
,
Jun 26 2017
Telemetry bots do official builds but didn't catch this. which suggests that official build is necessary but not sufficient.
,
Jun 26 2017
Right, the other half is that it needs to be on a non-clean profile. I was just confused why I didn't notice testing locally and wanted to find out why.
,
Jul 7 2017
re: comment 4, I'm not sure the presence of VariationsService is relevant. The problem would be hit if: 1. Someone first does a base::FeatureList::IsEnabled() query 2. Then, base::FeatureList::SetInstance() is called registering the instance. (2) is done in ChromeBrowserMainParts::SetupFieldTrials() regardless of whether there's a VariationsService. So I think the main factor was what contributes to (1) happening so early in this specific case? Presumably something in the profile?
,
Jul 7 2017
The factor for (1) happening so early was precisely the presence of VariationsService. :-P It calls into //crypto to verify a signature, but only on official builds and only if an existing profile. Hence why I didn't notice this locally (unofficial build) and why the bots didn't notice (apparently we have no test coverage of official build + existing profile?). That //crypto is allowed to depend on //base but secretly can't use part of it is very confusing layering-wise. Thus the dilemma.
,
Jul 7 2017
Ah, I see! Thanks, that's the piece I was missing. It is certainly a dilemma. Variations service calls into crypto to validate variations seeds we receive from the server. Even if we enable it for tests, tests should be hermetic and shouldn't be downloading stuff from servers. Hmm. We could make unofficial builds still start VS but bake in a dummy empty seed, so that the codepaths are exercised.
,
Jul 7 2017
The dummy seed could be part of a browser test that populates the existing profile with it, so we wouldn't have to necessarily ship it to end users. (Though starting Chromium locally then wouldn't exercise it.)
,
Sep 1 2017
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by primiano@chromium.org
, Jun 26 2017