NightLightController Accessing Prefs Before Initialization |
|||||
Issue descriptionWhen running the mash_browser_tests suite I am seeing errors that the NightLightController is attempting to get preference values before prefs::PrefStoreClientMixin has been initialized. This can be reproduced by running running the test MultiProfileFileManagerBrowserTest.BasicDownloads locally. [0524/135257.166033:FATAL:pref_store_client_mixin.cc(46)] Check failed: initialized_. #0 0x7fc4df31a1bb base::debug::StackTrace::StackTrace() #1 0x7fc4df318efc base::debug::StackTrace::StackTrace() #2 0x7fc4df384757 logging::LogMessage::~LogMessage() #3 0x7fc4cfc908de prefs::PrefStoreClientMixin<>::GetValue() #4 0x7fc4dfaa704a PrefValueStore::GetValueFromStore() #5 0x7fc4dfaa6a21 PrefValueStore::GetValueFromStoreWithType() #6 0x7fc4dfaa69ac PrefValueStore::GetValue() #7 0x7fc4dfa983a8 PrefService::GetPreferenceValue() #8 0x7fc4dfa97ebc PrefService::GetBoolean() #9 0x7fc4cfa7f5ef ash::NightLightController::GetEnabled() #10 0x7fc4cfa7fa19 ash::NightLightController::Refresh() #11 0x7fc4cfa7f9e6 ash::NightLightController::InitFromUserPrefs() #12 0x7fc4cfa7f9a8 ash::NightLightController::OnActiveUserSessionChanged() #13 0x7fc4cf97c27c ash::SessionController::SetUserSessionOrder() #14 0x7fc4ce51fe40 ash::mojom::SessionControllerStubDispatch::Accept() #15 0x7fc4cf97ff83 ash::mojom::SessionControllerStub<>::Accept() #16 0x7fc4dab95312 mojo::InterfaceEndpointClient::HandleValidatedMessage() #17 0x7fc4dab94cd1 mojo::InterfaceEndpointClient::HandleIncomingMessageThunk::Accept() #18 0x7fc4dab92bd0 mojo::FilterChain::Accept() #19 0x7fc4dab96b4f mojo::InterfaceEndpointClient::HandleIncomingMessage() #20 0x7fc4dabab2ec mojo::internal::MultiplexRouter::ProcessIncomingMessage() #21 0x7fc4dabaab74 mojo::internal::MultiplexRouter::Accept() #22 0x7fc4dab92bd0 mojo::FilterChain::Accept() #23 0x7fc4dab879d2 mojo::Connector::ReadSingleMessage() #24 0x7fc4dab8854e mojo::Connector::ReadAllAvailableMessages() #25 0x7fc4dab8839e mojo::Connector::OnHandleReadyInternal() #26 0x7fc4dab8829b mojo::Connector::OnWatcherHandleReady() #27 0x7fc4dab8b1dc _ZN4base8internal13FunctorTraitsIMN4mojo9ConnectorEFvjEvE6InvokeIPS3_JjEEEvS5_OT_DpOT0_ #28 0x7fc4dab8b0e6 _ZN4base8internal12InvokeHelperILb0EvE8MakeItSoIRKMN4mojo9ConnectorEFvjEJPS5_jEEEvOT_DpOT0_ #29 0x7fc4dab8b077 _ZN4base8internal7InvokerINS0_9BindStateIMN4mojo9ConnectorEFvjEJNS0_17UnretainedWrapperIS4_EEEEEFvjEE7RunImplIRKS6_RKSt5tupleIJS8_EEJLm0EEEEvOT_OT0_NS_13IndexSequenceIJXspT1_EEEEOj #30 0x7fc4dab8af7c _ZN4base8internal7InvokerINS0_9BindStateIMN4mojo9ConnectorEFvjEJNS0_17UnretainedWrapperIS4_EEEEEFvjEE3RunEPNS0_13BindStateBaseEOj #31 0x7fc4dfa30b81 _ZNKR4base8CallbackIFvjELNS_8internal8CopyModeE1ELNS2_10RepeatModeE1EE3RunEj #32 0x7fc4dfa2ffd1 mojo::SimpleWatcher::OnHandleReady() #33 0x7fc4dfa31573 _ZN4base8internal13FunctorTraitsIMN4mojo13SimpleWatcherEFvijEvE6InvokeIRKNS_7WeakPtrIS3_EEJRKiRKjEEEvS5_OT_DpOT0_ #34 0x7fc4dfa313c4 _ZN4base8internal12InvokeHelperILb1EvE8MakeItSoIRKMN4mojo13SimpleWatcherEFvijERKNS_7WeakPtrIS5_EEJRKiRKjEEEvOT_OT0_DpOT1_ #35 0x7fc4dfa31324 _ZN4base8internal7InvokerINS0_9BindStateIMN4mojo13SimpleWatcherEFvijEJNS_7WeakPtrIS4_EEijEEEFvvEE7RunImplIRKS6_RKSt5tupleIJS8_ijEEJLm0ELm1ELm2EEEEvOT_OT0_NS_13IndexSequenceIJXspT1_EEEE #36 0x7fc4dfa311cc _ZN4base8internal7InvokerINS0_9BindStateIMN4mojo13SimpleWatcherEFvijEJNS_7WeakPtrIS4_EEijEEEFvvEE3RunEPNS0_13BindStateBaseE #37 0x7fc4df2d95fe _ZNO4base8CallbackIFvvELNS_8internal8CopyModeE0ELNS2_10RepeatModeE0EE3RunEv #38 0x7fc4df31f6b1 base::debug::TaskAnnotator::RunTask() #39 0x7fc4df3a947e base::MessageLoop::RunTask() #40 0x7fc4df3a96e7 base::MessageLoop::DeferOrRunPendingTask() #41 0x7fc4df3a993d base::MessageLoop::DoWork() #42 0x7fc4df3bb86c base::MessagePumpLibevent::Run() #43 0x7fc4df3a8f53 base::MessageLoop::Run() #44 0x7fc4df447767 base::RunLoop::Run() #45 0x000003dbd1eb (anonymous namespace)::StartEmbeddedService() #46 0x0000029e4c37 _ZN4base8internal13FunctorTraitsIPFvN4mojo16InterfaceRequestIN3arc5mojom23VideoAcceleratorServiceEEEEvE6InvokeIJS7_EEEvS9_DpOT_ #47 0x000003dbf718 _ZN4base8internal12InvokeHelperILb0EvE8MakeItSoIRKPFvN4mojo16InterfaceRequestIN15service_manager5mojom7ServiceEEEEJS9_EEEvOT_DpOT0_ #48 0x000003dbf6d6 _ZN4base8internal7InvokerINS0_9BindStateIPFvN4mojo16InterfaceRequestIN15service_manager5mojom7ServiceEEEEJEEES9_E7RunImplIRKSA_RKSt5tupleIJEEJEEEvOT_OT0_NS_13IndexSequenceIJXspT1_EEEEOS8_ #49 0x000003dbf63c _ZN4base8internal7InvokerINS0_9BindStateIPFvN4mojo16InterfaceRequestIN15service_manager5mojom7ServiceEEEEJEEES9_E3RunEPNS0_13BindStateBaseEOS8_ #50 0x000000a3bfd5 _ZNKR4base8CallbackIFv13scoped_refptrINS_16RefCountedMemoryEEELNS_8internal8CopyModeE1ELNS5_10RepeatModeE1EE3RunES3_ #51 0x000003ab3063 service_manager::RunStandaloneService() #52 0x000003dbcf22 RunMashBrowserTests() #53 0x000003dbcd3d main #54 0x7fc4c4785f45 __libc_start_main #55 0x000000842e94 <unknown>
,
May 24 2017
You cannot be guaranteed that preferences are ready until PrefStoreClientMixin::OnInitializationCompleted has been called via mojo. It doesn't appear that the PrefValueStore further exposes this to clients though.
,
May 24 2017
OnActiveUserSessionChanged is only guaranteed to be called that the user profile is fully loaded in the browser process. It is not correlated to how the user profile is mapped to ash side. Shell::OnPrefServiceInitialized is called when PrefService is connected but not the underlying stores. The crash we hit is that we are trying to access pref value in a store before the store is connected and initialized as jonross@ mentioned. +sammc, thoughts? how could we figure out when it is safe for ash to touch a pref?
,
May 24 2017
,
Sep 12 2017
James, I remember this was fixed by one of your recent changes, correct?
,
Sep 12 2017
Yes, it uses OnActiveUserPrefServiceChanged() now.
,
Feb 26 2018
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by afakhry@chromium.org
, May 24 2017