From 72f3b67c66518b14a7bb1950469adf52925f5700 Mon Sep 17 00:00:00 2001 From: Jonathan Kew Date: Fri, 26 Jun 2020 21:25:25 +0000 Subject: [PATCH] Bug 1648356 - Don't crash the parent process we fail to share font-list blocks while launching a child; the content process will safely handle this by requesting blocks as needed. r=jwatt Differential Revision: https://phabricator.services.mozilla.com/D81338 --- gfx/thebes/SharedFontList.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gfx/thebes/SharedFontList.cpp b/gfx/thebes/SharedFontList.cpp index 06d9937134db..9ba6a0d7a608 100644 --- a/gfx/thebes/SharedFontList.cpp +++ b/gfx/thebes/SharedFontList.cpp @@ -615,7 +615,12 @@ void FontList::ShareBlocksToProcess(nsTArray* aBlocks, base::SharedMemoryHandle* handle = aBlocks->AppendElement(base::SharedMemory::NULLHandle()); if (!shmem->ShareToProcess(aPid, handle)) { - MOZ_CRASH("failed to share block"); + // If something went wrong here, we just bail out; the child will need to + // request the blocks as needed, at some performance cost. (Although in + // practice this may mean resources are so constrained the child process + // isn't really going to work at all. But that's not our problem here.) + aBlocks->Clear(); + return; } } }