AuraInit Cannot Always Access Font Files in Startup |
||||||||
Issue descriptionSimilar to the lack of access to the Directory mojom it appears that we do not always have Fonts if shutdown is occurring on remote services, while others are starting. Exhibited in mash_browser_tests #0 0x0000037c1f7c base::debug::StackTrace::StackTrace() #1 0x0000037dab21 logging::LogMessage::~LogMessage() #2 0x000004a62eb5 gfx::(anonymous namespace)::CreateSkTypeface() #3 0x000004a62b58 gfx::PlatformFontLinux::PlatformFontLinux() #4 0x000004a63eab gfx::PlatformFont::CreateDefault() #5 0x000004a565de gfx::Font::Font() #6 0x0000063d03e5 views::AuraInit::AuraInit() #7 0x000002c735ef _ZN4base10MakeUniqueIN5views8AuraInitEJPN15service_manager9ConnectorERKNS3_8IdentityERA22_KcRA26_S9_DnNS2_4ModeEEEENS_8internal16MakeUniqueResultIT_E6ScalarEDpOT0_ #8 0x000002c73424 ash::mus::WindowManagerApplication::OnStart() #9 0x00000420ddd6 service_manager::ServiceContext::OnStart() #10 0x000004ea82c5 service_manager::mojom::ServiceStubDispatch::AcceptWithResponder() #11 0x00000420e586 service_manager::mojom::ServiceStub<>::AcceptWithResponder() #12 0x000004dd199d mojo::InterfaceEndpointClient::HandleValidatedMessage() #13 0x000004dd1666 mojo::FilterChain::Accept() #14 0x000004dd2b65 mojo::InterfaceEndpointClient::HandleIncomingMessage() #15 0x000004dd9c6c mojo::internal::MultiplexRouter::ProcessIncomingMessage() #16 0x000004dd945f mojo::internal::MultiplexRouter::Accept() #17 0x000004dd1666 mojo::FilterChain::Accept() #18 0x000004dcfc09 mojo::Connector::ReadSingleMessage() #19 0x000004dd0421 mojo::Connector::ReadAllAvailableMessages() #20 0x000004dd02d9 mojo::Connector::OnHandleReadyInternal() #21 0x000004de7829 mojo::SimpleWatcher::OnHandleReady() #22 0x00000270f22f _ZN4base8internal7InvokerINS0_9BindStateIMN7content25ServiceWorkerProviderHostEFviN5blink21WebServiceWorkerStateEEJNS_7WeakPtrIS4_EEiS6_EEEFvvEE7RunImplIRKS8_RKSt5tupleIJSA_iS6_EEJLm0ELm1ELm2EEEEvOT_OT0_NS_13IndexSequenceIJXspT1_EEEE #23 0x0000006b28b9 _ZNO4base8CallbackIFvvELNS_8internal8CopyModeE1ELNS2_10RepeatModeE1EE3RunEv #24 0x000003873d50 base::debug::TaskAnnotator::RunTask() #25 0x0000037e28b9 base::MessageLoop::RunTask() #26 0x0000037e2b6b base::MessageLoop::DeferOrRunPendingTask() #27 0x0000037e2f77 base::MessageLoop::DoWork() #28 0x0000037e5559 base::MessagePumpLibevent::Run() #29 0x0000037e24eb base::MessageLoop::Run() #30 0x00000380cf2a base::RunLoop::Run() #31 0x0000037b2b32 (anonymous namespace)::StartEmbeddedService() #32 0x0000037b336d _ZN4base8internal7InvokerINS0_9BindStateIPFvN4mojo16InterfaceRequestIN15service_manager5mojom7ServiceEEEEJEEES9_E3RunEPNS0_13BindStateBaseEOS8_ #33 0x0000021997eb service_manager::RunStandaloneService() #34 0x0000037b27da RunMashBrowserTests() #35 0x0000037b25d7 main #36 0x7fac00e99f45 __libc_start_main #37 0x00000062360e <unknown>
,
Jul 11 2017
This appears to have uncovered a similar issue but with ash::Shell::Init > [0710/191201.205955:FATAL:platform_font_linux.cc(272)] Check failed: success. Could not find any font: Roboto, sans > #0 0x00000380dbac base::debug::StackTrace::StackTrace() > #1 0x000003826481 logging::LogMessage::~LogMessage() > #2 0x000004abb1a7 gfx::PlatformFontLinux::InitFromDetails() > #3 0x000004abaeea gfx::PlatformFontLinux::PlatformFontLinux() > #4 0x000004abbf9b gfx::PlatformFont::CreateFromNameAndSize() > #5 0x000004aae583 gfx::Font::Font() > #6 0x000004ab2837 gfx::FontListImpl::GetFonts() > #7 0x000004ab23b1 gfx::FontListImpl::GetHeight() > #8 0x000004ab15dd gfx::FontList::GetHeight() > #9 0x0000047384a7 views::Label::GetTextSize() > #10 0x00000473837a views::Label::CalculatePreferredSize() > #11 0x00000472bce5 views::LabelButton::Layout() > #12 0x0000047371ef views::Label::ResetLayout() > #13 0x00000472a397 views::LabelButton::LabelButton() > #14 0x00000472e40a views::MdTextButton::MdTextButton() > #15 0x00000472d89f views::MdTextButton::Create() > #16 0x0000063f6d0f ash::LogoutButtonTray::LogoutButtonTray() > #17 0x00000635c11e ash::StatusAreaWidget::CreateTrayViews() > #18 0x00000633910c ash::ShelfWidget::CreateStatusAreaWidget() > #19 0x000006329cfa ash::Shelf::CreateShelfWidget() > #20 0x0000063244e9 ash::RootWindowController::InitLayoutManagers() > #21 0x00000632206e ash::RootWindowController::Init() > #22 0x0000063065ba ash::WindowTreeHostManager::InitHosts() > #23 0x00000633b0cc ash::Shell::Init() > #24 0x000006339d89 ash::Shell::CreateInstance() > #25 0x000002cbbc9e ash::mus::WindowManager::CreateShell() > #26 0x000002cbbfbe ash::mus::WindowManager::OnWmConnected() > #27 0x0000020d68f4 ui::mojom::WindowManagerStubDispatch::Accept() > #28 0x000004e2b0f8 mojo::InterfaceEndpointClient::HandleValidatedMessage() > #29 0x000004e2ad96 mojo::FilterChain::Accept() > #30 0x000004e2c295 mojo::InterfaceEndpointClient::HandleIncomingMessage() > #31 0x000004e3339c mojo::internal::MultiplexRouter::ProcessIncomingMessage() > #32 0x000004e32b8f mojo::internal::MultiplexRouter::Accept() > #33 0x000004e2ad96 mojo::FilterChain::Accept() > #34 0x000004e29339 mojo::Connector::ReadSingleMessage() > #35 0x000004e29b51 mojo::Connector::ReadAllAvailableMessages() > #36 0x000004e29a09 mojo::Connector::OnHandleReadyInternal() > #37 0x000004e40f59 mojo::SimpleWatcher::OnHandleReady() > #38 0x00000274d07f _ZN4base8internal7InvokerINS0_9BindStateIMN7content25ServiceWorkerProviderHostEFviN5blink21WebServiceWorkerStateEEJNS_7WeakPtrIS4_EEiS6_EEEFvvEE7RunImplIRKS8_RKSt5tupleIJSA_iS6_EEJLm0ELm1ELm2EEEEvOT_OT0_NS_13IndexSequenceIJXspT1_EEEE > #39 0x0000006b62d9 _ZNO4base8CallbackIFvvELNS_8internal8CopyModeE1ELNS2_10RepeatModeE1EE3RunEv > #40 0x0000038bee70 base::debug::TaskAnnotator::RunTask() > #41 0x00000382e219 base::MessageLoop::RunTask() > #42 0x00000382e4cb base::MessageLoop::DeferOrRunPendingTask() > #43 0x00000382e8d7 base::MessageLoop::DoWork() > #44 0x000003830eb9 base::MessagePumpLibevent::Run() > #45 0x00000382de4b base::MessageLoop::Run() > #46 0x000003858bca base::RunLoop::Run() > #47 0x0000037fe8e2 (anonymous namespace)::StartEmbeddedService() > #48 0x0000037ff11d _ZN4base8internal7InvokerINS0_9BindStateIPFvN4mojo16InterfaceRequestIN15service_manager5mojom7ServiceEEEEJEEES9_E3RunEPNS0_13BindStateBaseEOS8_ > #49 0x0000021cf61b service_manager::RunStandaloneService() > #50 0x0000037fe50e RunMashBrowserTests() > #51 0x0000037fe367 main > #52 0x7f8750469f45 __libc_start_main > #53 0x00000062634e <unknown>
,
Jul 11 2017
The following set of gfx_unittests failed twice on recent runs of Linux ChromiumOS Tests: gfx_unittests gfx_unittests Run on OS: 'Ubuntu-14.04' failures: RenderTextHarfBuzzTest.HarfBuzz_FontListFallback/HarfBuzz FontRenderParamsTest.SubstituteFamily FontRenderParamsTest.MissingFamily FontTest.LoadArial FontRenderParamsTest.Size FontTest.LoadArialBold FontRenderParamsTest.UseBitmaps FontRenderParamsTest.Style FontRenderParamsTest.Default FontListTest.Fonts_GetHeight_GetBaseline RenderTextTest.StringSizeRespectsFontListMetrics/HarfBuzz PlatformFontLinuxTest.DefaultFont FontTest.GetActualFontNameForTesting https://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%28dbg%29%281%29/builds/28061 https://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%28dbg%29%281%29/builds/28067 All failures seem to revolve around font loading. The first failure was seen about 15 minutes after https://chromium-review.googlesource.com/#/c/565031/ landed, so suspecting this CL. Let me know if these failures aren't related, and I'll file a separate bug.
,
Jul 11 2017
The same failures just appeared in the release builder: https://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%281%29/builds/41435
,
Jul 11 2017
Also note that the dump in Comment #2 is appearing frequently as exceptions in these two builders: https://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%281%29 https://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Ozone%20Tests%20%281%29
,
Jul 11 2017
,
Jul 11 2017
So PlatformFontLinux treats the lack of fonts as a fatal error. FontLoader tries to load fonts via a synchronous mojom call. The remote service manager can close while this call is in process. Leading to the peer closing, before onConnectionError arrives. This failure is actually reported as a success, but without the font. See issue 735051 for tracking the general issue that we succeed at sync calls even when the peer is closed and they fail. Collapsing down the stack we try to use the result of the synchronous call, even though we are about to subsequently shutdown our ServiceContext once the error arrives. However throughout Ash there is a wide number of ways in which PlatformFontLinux is accessed. I'm going to look into having a clean way to handle this error state, as having each check and try to close the ServiceContext doesn't scale. Afterwards I'll look into FontLoader to see if there are ways we can be detect this failure, or try to reconnect.
,
Jul 12 2017
There are two main paths which cause this: FontListImpl::Derive which derives new fonts based on currently loaded ones. Unfortunately PlatformFontLinux uses FontLoader to try to load each of these fonts from scratch, before using skia to create a new SkTypeface. In the future we should try to see if we can just derive with the already loaded information FontFallbackLinux::GetFallbackFonts which attempts to generate a new Font with a given font family. This doesn't try to fallback to the default if it is available. To address the race condition we are changing the lack of font resources from being fatal. Now instead the PlatformFontLinux will fallback to the default font, and log the error.
,
Jul 13 2017
Issue 739824 has been merged into this issue.
,
Jul 13 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/591e1f86fd0649fefa60cbcb056edcfa43cebc4e commit 591e1f86fd0649fefa60cbcb056edcfa43cebc4e Author: Jonathan <jonross@chromium.org> Date: Thu Jul 13 23:32:48 2017 Have PlatformFontLinux Fallback to default It is possible to font loading to fail. Such as when the peer closes during a synchronous mojo call to load a font. Currently this is treated as a fatal error, which leads to flaky tests. This change updates PlatformFontLinux to instead fallback to providing the default font in these cases. While logging the error. TEST=mash_browser_tests Bug: 738441 Change-Id: I2717a0fdf561be82e6d393863a0cfd13b19ae480 Reviewed-on: https://chromium-review.googlesource.com/568789 Reviewed-by: Dan Erat <derat@chromium.org> Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org> Commit-Queue: Jonathan Ross <jonross@chromium.org> Cr-Commit-Position: refs/heads/master@{#486533} [modify] https://crrev.com/591e1f86fd0649fefa60cbcb056edcfa43cebc4e/ui/gfx/platform_font_linux.cc
,
Jul 17 2017
These crashes are fixed. I've filed issue 744671 to track my thoughts on the dangers of using the current FontLoader, along with how broad the entry points are.
,
Feb 26 2018
|
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by bugdroid1@chromium.org
, Jul 11 2017