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

Issue 834509 link

Starred by 1 user

Issue metadata

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



Sign in to add a comment

HIDDetectionView::CheckIsScreenRequired in browser_tests triggers DCHECK

Project Member Reported by steve...@chromium.org, Apr 18 2018

Issue description

Repro:

1. in args.gn set dcheck_always_on = true or is_debug = true
2. Run browser_tests --gtest_filter=CaptivePortalWindowTest.Show

Crash (with dcheck_always_on = true is_debug = false):

[169297:169387:0418/162013.049115:FATAL:ref_counted.h(83)] Check failed: CalledOnValidSequence(). 
#0 0x7f5cef9d58fc base::debug::StackTrace::StackTrace()
#1 0x7f5cef9fbdcb logging::LogMessage::~LogMessage()
#2 0x7f5cefdbfca0 base::subtle::RefCountedBase::Release()
#3 0x7f5cefdc25af _ZZN4base24SequenceLocalStorageSlotI13scoped_refptrIN4mojo18SyncHandleRegistryEENSt3__114default_deleteIS4_EEE3SetES4_ENUlPvE_8__invokeES9_
#4 0x7f5cefa7fbc0 base::internal::SequenceLocalStorageMap::~SequenceLocalStorageMap()
#5 0x7f5cefa70132 base::internal::Sequence::~Sequence()
#6 0x7f5cefa68a5e base::internal::(anonymous namespace)::SchedulerWorkerDelegate::OnMainExit()
#7 0x7f5cefa6a26b base::internal::SchedulerWorker::Thread::ThreadMain()
#8 0x7f5cefa7f03f base::(anonymous namespace)::ThreadFunc()
#9 0x7f5cefb5a494 start_thread
#10 0x7f5ce2162a8f clone


This can also be reproduced with any browser test that specifies chromeos::switches::kForceLoginManagerInTests. Even if the test does nothing it will crash.

The cause is the following code in wizard_controller.cc:

oobe_ui_->GetHIDDetectionView()->CheckIsScreenRequired(on_check);

https://cs.chromium.org/chromium/src/chrome/browser/chromeos/login/wizard_controller.cc?type=cs&q=CheckIsScreenRequired&sq=package:chromium&l=1244

I suspect it has to do with a mojo call to device::mojom::InputDeviceManagerPtr::GetDevices:

https://cs.chromium.org/chromium/src/chrome/browser/chromeos/login/screens/hid_detection_screen.cc?type=cs&sq=package:chromium&l=129

A workaround is to include the following in SetUpCommandLine:
command_line->AppendSwitch(chromeos::switches::kDisableHIDDetectionOnOOBE);


 
I'm surprised we do not run with dcheck_always_on=true on bots.
Cc: jdufault@chromium.org
Owner: alemate@chromium.org
We do, but for whatever reason we ignore FATAL crashes as long as the test passes. Check the browser_tests stdout from a recent run and search for FATAL:

https://ci.chromium.org/buildbot/chromium.chromiumos/linux-chromeos-dbg/5271

That said, I don't see this particular output in the stdout, but can reproduce it locally. May be due to a slightly different GN config?

Cc: xiy...@chromium.org
+xiyuan, I have seen this sort of shutdown crash in browser_tests --enable-features=Mash before. We have several tests disabled for it:

https://cs.chromium.org/chromium/src/testing/buildbot/filters/mash.browser_tests.filter?q=mash.browser_tests&sq=package:chromium&l=177

Maybe they all use ForceLoginManagerInTests.

How did you figure out that CheckIsScreenRequired() was the cause?

Rather painfully I'm afraid:
1. I made the test trivial (commented out all code) and confirmed the crash still occurred.
2. I started commenting out other code which is how I found setting the flag to be the trigger. I then started commenting out code that the flag enabled until I identified CheckIsScreenRequired() as the cause.

Components: Tests
This may be the same issue as bug 869272.

Sign in to add a comment