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

Issue 866114 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

Fix ash_unittests crash on chromeos VMs (not linux-chromeos)

Project Member Reported by bpastene@chromium.org, Jul 20

Issue description

See the following build where I tried running ash_unittests in cros VMs:
https://ci.chromium.org/p/chromium/builders/luci.chromium.try/chromeos-amd64-generic-rel/50507

All tests crash with the following error:
https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8940455833145754624/+/steps/ash_unittests__with_patch_/0/logs/TrayKeyboardBrightnessTest.DetailedViewVisibilityChangesDuringTabletMode/0

ie: [13311:13311:0720/122944.199585:278067462:FATAL:statistics_provider.cc(318)] Check failed: load_statistics_started_.

Looks like some service isn't getting initialized properly in the test. Perhaps the fake provider should be used instead?
https://codesearch.chromium.org/chromium/src/chromeos/system/fake_statistics_provider.h?rcl=5c4bc1ff53af81b21ba55479c492e085cfd10ec2&l=20

FTR, this crash is avoided on linux-chromeos since the IsRunningOnVm() call quits early due to:
https://codesearch.chromium.org/chromium/src/chromeos/system/statistics_provider.cc?rcl=0d313e2262a7d677b569046ece3b9630517061b1&l=451
 
Cc: tnagel@chromium.org
Here's the complete stack:
[ RUN      ] PanelWindowResizerTest.DetachThenDragAcrossDisplays
[17450:17450:0720/123026.638586:320506464:FATAL:statistics_provider.cc(318)] Check failed: load_statistics_started_.
#0 0x5c659b8e23ec base::debug::StackTrace::StackTrace()
#1 0x5c659b8948b0 logging::LogMessage::~LogMessage()
#2 0x5c659c5c1ee0 chromeos::system::StatisticsProviderImpl::WaitForStatisticsLoaded()
#3 0x5c659c5c220e chromeos::system::StatisticsProviderImpl::GetMachineStatistic()
#4 0x5c659c5c288f chromeos::system::StatisticsProviderImpl::IsRunningOnVm()
#5 0x5c659c2d3387 display::DisplayManager::InitFromCommandLine()
#6 0x5c659b7399bc ash::Shell::InitializeDisplayManager()
#7 0x5c659b732f68 ash::Shell::Init()
#8 0x5c659b732886 ash::Shell::CreateInstance()
#9 0x5c659c5aa9d3 ash::AshTestHelper::CreateShell()
#10 0x5c659c5aa77f ash::AshTestHelper::SetUp()
#11 0x5c659c5a8a53 ash::AshTestBase::SetUp()
#12 0x5c659b0cc682 ash::PanelWindowResizerTest::SetUp()
#13 0x5c659b62762d testing::Test::Run()
#14 0x5c659b628360 testing::TestInfo::Run()
#15 0x5c659b6288c7 testing::TestCase::Run()
#16 0x5c659b633957 testing::internal::UnitTestImpl::RunAllTests()
#17 0x5c659b63346b testing::UnitTest::Run()
#18 0x5c659b9083fe base::TestSuite::Run()
#19 0x5c659b909db0 base::(anonymous namespace)::LaunchUnitTestsInternal()
#20 0x5c659b909c47 base::LaunchUnitTests()
#21 0x5c659afce2fa main
#22 0x7d2cf4c20736 __libc_start_main
#23 0x5c659ab09649 _start

My guess is ash needs a call to system::StatisticsProvider::GetInstance()->StartLoadingMachineStatistics();

+tnagel as he tnagel recently changed StatisticsProvider.
Cc: -tnagel@chromium.org
Unless that crash is related to my changes (which it doesn't look like) I won't be able to work on StatisticsProvider, sorry.
Components: -UI>Shell -Tests Test
Components: OS>Kernel>Display
Cc: -achuith@chromium.org
Owner: achuith@chromium.org
Status: Started (was: Untriaged)
This DCHECK is also failing, but I think it's because I have dcheck_always_on:

[2611/2686] IsLockScreenNotificationsEnabled/MessageCenterViewTest.SizeAfterRemove/0 (0 ms)
[3102:3112:0803/145824.224696:229743618:ERROR:kill_posix.cc(83)] Unable to terminate process group 8908: No such process (3)
Failed to get out-of-band test success data, dumping full stdio below:
[8908:8908:0803/145824.147566:229666488:FATAL:thread_task_runner_handle.cc(29)] Check failed: current. Error: This caller requires a single-threaded context (i.e. the current task needs to run from a SingleThreadTaskRunner).
#0 0x587bb6c9777c base::debug::StackTrace::StackTrace()
#1 0x587bb6c35a30 logging::LogMessage::~LogMessage()
#2 0x587bb6c76bbe base::ThreadTaskRunnerHandle::Get()
#3 0x587bb68397a4 ui::(anonymous namespace)::OzonePlatformGbm::InitializeGPU()
#4 0x587bb67ef30a ui::OzonePlatform::InitializeForGPU()
#5 0x587bb71e44b3 gl::(anonymous namespace)::InitializeOneOffHelper()
#6 0x587bb7c96fd7 ash::AshTestSuite::Initialize()
#7 0x587bb6cde4d3 base::TestSuite::Run()
#8 0x587bb6ce01df base::(anonymous namespace)::LaunchUnitTestsInternal()
#9 0x587bb6ce002e base::LaunchUnitTests()
#10 0x587bb61dfdee main
#11 0x7a7591f29736 __libc_start_main
#12 0x587bb5cf5b19 _start

Ah, that looks like bug 859246.

Try adding the gn arg "ozone_platform_headless = true" and rerunning the test w/ "--ozone-platform=headless"
Project Member

Comment 10 by bugdroid1@chromium.org, Sep 28

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

commit bd945756bd1a77e4a80afaa00342232765bdafb0
Author: Scott Violet <sky@chromium.org>
Date: Fri Sep 28 23:42:03 2018

ash: make AshTestHelper register FakeStatisticsProvider

This is necessary when running ash_unittests in chromeos vm as we hit some
DCHECKs otherwise (the real StatisticsProvider DCHECKs that it was initialized).

BUG=866114
TEST=test only change

Change-Id: I0ad82f28f266460a6c9dccc23e86566750aed8f4
Reviewed-on: https://chromium-review.googlesource.com/1252853
Reviewed-by: James Cook <jamescook@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595252}
[modify] https://crrev.com/bd945756bd1a77e4a80afaa00342232765bdafb0/ash/test/ash_test_helper.cc
[modify] https://crrev.com/bd945756bd1a77e4a80afaa00342232765bdafb0/ash/test/ash_test_helper.h

I believe I've fixed the StatisticsProvider issue this was originally against. Hopefully this is fixed now.
The statistics-provider crash is fixed and most tests now pass, but it looks like there's a small subset that segfault in display::GetDisplayPower():
https://ci.chromium.org/p/chromium/builders/luci.chromium.try/chromeos-amd64-generic-rel/99802

example stack trace:
https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8933830194062306544/+/steps/ash_unittests__with_patch_/0/logs/PowerEventObserverTest.EndWallpaperAnimationOnSuspendWhileLocked/0

Maybe some assumption about there being a physical display? Feel free to wontfix if the added benefit of running this suite on cros isn't worth fixing the crashes.
Cc: achuith@chromium.org
Owner: ----
Status: Untriaged (was: Started)
Not planning to work on this.

Sign in to add a comment