In mus+ash, when ash is run in a separate process from chrome, it doesn't get a DiscardableMemoryAllocator instance. This ends up causing a crash in skia land (when trying to show a notification, for example). A sample stack trace:
[17424:17599:0407/104432:672142166511:FATAL:discardable_memory_allocator.cc(30)] Check failed: g_allocator.
#0 0x7f9ef76d6e1e base::debug::StackTrace::StackTrace()
#1 0x7f9ef772ca1c logging::LogMessage::~LogMessage()
#2 0x7f9ef772fc3d base::DiscardableMemoryAllocator::GetInstance()
#3 0x7f9ef25de2d4 SkDiscardableMemory::Create()
#4 0x7f9ef2794e1d SkResourceCache::newCachedData()
#5 0x7f9ef2795a30 SkResourceCache::NewCachedData()
#6 0x7f9ef2880172 copy_mask_to_cacheddata()
#7 0x7f9ef287d728 add_cached_rects()
#8 0x7f9ef287d3c4 SkBlurMaskFilterImpl::filterRectsToNine()
#9 0x7f9ef2700a00 SkMaskFilter::filterPath()
#10 0x7f9ef2697cb0 SkDraw::drawPath()
#11 0x7f9ef26241e3 SkDraw::drawPath()
#12 0x7f9ef2696946 SkDraw::drawRect()
#13 0x7f9ef2624181 SkDraw::drawRect()
#14 0x7f9ef2623449 SkBitmapDevice::drawRect()
#15 0x7f9ef266bba1 SkCanvas::onDrawRect()
#16 0x7f9ef266a6e5 SkCanvas::drawRect()
#17 0x7f9ef27714c9 SkRecords::Draw::draw<>()
#18 0x7f9ef271323d SkRecords::Draw::operator()<>()
#19 0x7f9ef2713aa2 SkMiniPicture<>::playback()
#20 0x7f9ef2670c10 SkCanvas::drawPicture()
#21 0x7f9ef3162d74 SkCanvas::drawPicture()
#22 0x7f9ef31665ff cc::DrawingDisplayItem::Raster()
#23 0x7f9ef3160e1c cc::DisplayItemList::Raster()
#24 0x7f9ef316a346 cc::RasterSource::RasterCommon()
#25 0x7f9ef3169a30 cc::RasterSource::PlaybackToCanvas()
#26 0x7f9ef31af017 cc::TileTaskWorkerPool::PlaybackToMemory()
#27 0x7f9ef31b0d24 cc::(anonymous namespace)::RasterBufferImpl::Playback()
#28 0x7f9ef3250f29 cc::(anonymous namespace)::RasterTaskImpl::RunOnWorkerThread()
#29 0x7f9ef318ce77 cc::SingleThreadTaskGraphRunner::RunTaskWithLockAcquired()
#30 0x7f9ef318cbe8 cc::SingleThreadTaskGraphRunner::Run()
#31 0x7f9ef78511c3 base::DelegateSimpleThread::Run()
#32 0x7f9ef7850fb1 base::SimpleThread::ThreadMain()
#33 0x7f9ef784275a base::(anonymous namespace)::ThreadFunc()
#34 0x7f9ef58c9182 start_thread
#35 0x7f9ef55f647d clone
Currently for chrome browser, there's a HostDiscardableSharedMemoryManager, and for chrome-renderers, there's a corresponding ChildDiscardableSharedMemoryManager. It should be possible to move this code into a separate components (e.g. //components/discardable_memory, or perhaps even //services/discardable_memory?), so that mus-apps can use ChildDiscardableSharedMemoryManager through the mus client-lib, and communicate to HostDiscardableSharedMemoryManager living in mus-ws.
go/discardable-memory provides a good overview of how the discardable memory system works.
Comment 1 by jamescook@chromium.org
, Oct 11 2016