Bug 66328

Summary: ASSERT in fast/css/custom-font-xheight.html
Product: WebKit Reporter: Tony Chang <tony>
Component: WebCore Misc.Assignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: joepeck, mitz, msaboff, steveblock
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
[PATCH] Add a FontCachePurgePreventer and a Comment mitz: review+

Description Tony Chang 2011-08-16 14:07:36 PDT
When running fast/css/custom-font-xheight.html on a debug build of chromium linux, we hit the following assert:

ASSERTION FAILED: m_purgePreventCount
WebKit/Source/WebCore/platform/graphics/FontCache.cpp(280) : WebCore::SimpleFontData* WebCore::FontCache::getCachedFontData(const WebCore::FontPlatformData*, WebCore::FontCache::ShouldRetain)
Comment 1 Tony Chang 2011-08-16 14:09:14 PDT
I suspect this is due to http://trac.webkit.org/changeset/93140
Comment 2 Joseph Pecoraro 2011-08-16 14:36:50 PDT
That is a good sign, this code was broken before so we need to add a
another FontCachePurgePreventer somewhere now. I'm surprised I didn't
encounter this assert when I ran tests. Do you have the backtrace?
Comment 3 Tony Chang 2011-08-16 15:01:00 PDT
ASSERTION FAILED: m_purgePreventCount
third_party/WebKit/Source/WebCore/platform/graphics/FontCache.cpp(280) : WebCore::SimpleFontData* WebCore::FontCache::getCachedFontData(const WebCore::FontPlatformData*, WebCore::FontCache::ShouldRetain)
[12604:12604:7278047199282:ERROR:process_util_posix.cc(134)] Received signal 11
	base::debug::StackTrace::StackTrace() [0x8b8df2]
	base::(anonymous namespace)::StackDumpSignalHandler() [0x8810a9]
	0x7faae929bc20
	WebCore::FontCache::getCachedFontData() [0xfe8f69]
	WebCore::FontCache::getLastResortFallbackFont() [0x1026f0c]
	WebCore::FontCache::getNonRetainedLastResortFallbackFont() [0xfe927c]
	WebCore::CSSFontFaceSource::getFontData() [0x168214b]
	WebCore::CSSFontFace::getFontData() [0x167e7f9]
	WebCore::CSSSegmentedFontFace::getFontData() [0x15d833b]
	WebCore::CSSFontSelector::getFontData() [0x15ba8ee]
	WebCore::FontCache::getFontData() [0xfe9a96]
	WebCore::FontFallbackList::fontDataAt() [0xff58e3]
	WebCore::FontFallbackList::primaryFontData() [0x4d97c2]
	WebCore::FontFallbackList::primarySimpleFontData() [0x4d976d]
	WebCore::Font::primaryFont() [0x4d988d]
	WebCore::Font::fontMetrics() [0x4d980e]
	WebCore::RenderStyle::fontMetrics() [0x11f18ea]
	WebCore::CSSPrimitiveValue::computeLengthDouble() [0x11ef440]
	WebCore::CSSPrimitiveValue::computeLength<>() [0x11ef1d7]
	WebCore::ApplyPropertyLength<>::applyValue() [0x15ef077]
	WebCore::CSSStyleApplyProperty::applyValue() [0x122ea59]
	WebCore::CSSStyleSelector::applyProperty() [0x1213f21]
	WebCore::CSSStyleSelector::applyDeclarations<>() [0x12344ab]
	WebCore::CSSStyleSelector::styleForElement() [0x120bd97]
	WebCore::Node::styleForRenderer() [0xe42925]
	WebCore::NodeRendererFactory::createRendererAndStyle() [0xe5b04b]
	WebCore::NodeRendererFactory::createRendererIfNeeded() [0xe5b250]
	WebCore::Node::createRendererIfNeeded() [0xe428a5]
	WebCore::Element::attach() [0xe1621d]
	WebCore::HTMLConstructionSite::attach<>() [0xf9f040]
	WebCore::HTMLConstructionSite::attachToCurrent() [0xf9d64c]
	WebCore::HTMLConstructionSite::insertHTMLElement() [0xf9daf4]
	WebCore::HTMLTreeBuilder::processStartTagForInBody() [0xf68c48]
	WebCore::HTMLTreeBuilder::processStartTag() [0xf6b2fe]
	WebCore::HTMLTreeBuilder::processToken() [0xf671e1]
	WebCore::HTMLTreeBuilder::constructTreeFromAtomicToken() [0xf6708e]
	WebCore::HTMLTreeBuilder::constructTreeFromToken() [0xf66fe5]
	WebCore::HTMLDocumentParser::pumpTokenizer() [0xf4fc4a]
	WebCore::HTMLDocumentParser::pumpTokenizerIfPossible() [0xf4f668]
	WebCore::HTMLDocumentParser::append() [0xf501cc]
	WebCore::DecodedDataDocumentParser::appendBytes() [0x2177c48]
	WebCore::DocumentWriter::addData() [0x138b518]
	WebCore::DocumentLoader::commitData() [0x137c93d]
	WebKit::WebFrameImpl::commitDocumentData() [0x484d3a]
	WebKit::FrameLoaderClientImpl::committedLoad() [0x4dd06b]
	WebCore::DocumentLoader::commitLoad() [0x137c804]
	WebCore::DocumentLoader::receivedData() [0x137c9f8]
	WebCore::MainResourceLoader::addData() [0x13af777]
	WebCore::ResourceLoader::didReceiveData() [0x13c3011]
	WebCore::MainResourceLoader::didReceiveData() [0x13b0bc0]
	WebCore::ResourceLoader::didReceiveData() [0x13c3928]
	WebCore::ResourceHandleInternal::didReceiveData() [0x4f0d6e]
	webkit_glue::WebURLLoaderImpl::Context::OnReceivedData() [0x19b18b0]
	(anonymous namespace)::RequestProxy::NotifyReceivedData() [0x1a7255b]
	DispatchToMethod<>() [0x1a77f6b]
	RunnableMethod<>::Run() [0x1a77444]
	base::subtle::TaskClosureAdapter::Run() [0x89a39b]
	base::internal::Invoker1<>::DoInvoke() [0x86401c]
	base::Callback<>::Run() [0x862ded]
	MessageLoop::RunTask() [0x8609b5]
	MessageLoop::DeferOrRunPendingTask() [0x860abd]
	MessageLoop::DoWork() [0x8612b5]
Comment 4 Tony Chang 2011-08-16 15:01:34 PDT
Looks like chromium mac debug hit this as well.  It's probably all chromium dbg builds that hit this assert.
Comment 5 Joseph Pecoraro 2011-08-16 15:25:35 PDT
Yah, this was clearly my fault. I ran the test and saw the crash and ignored it
because it was failing for me before I made my change. I'm compiling a fix now.
Sorry about that!
Comment 6 Joseph Pecoraro 2011-08-16 15:40:40 PDT
Created attachment 104104 [details]
[PATCH] Add a FontCachePurgePreventer and a Comment
Comment 7 Joseph Pecoraro 2011-08-16 15:47:10 PDT
Comment on attachment 104104 [details]
[PATCH] Add a FontCachePurgePreventer and a Comment

I'll land manually since it looks like chromium test expectations were updated before I could get the fix out.
Comment 8 Joseph Pecoraro 2011-08-16 15:59:04 PDT
Unskipped the test and landed the fix in: r93171
<http://trac.webkit.org/changeset/93171>
Comment 9 Steve Block 2011-08-17 10:48:38 PDT
*** Bug 66375 has been marked as a duplicate of this bug. ***