Bug 100268 - MathML tests trigger font cache assertions in debug bots
Summary: MathML tests trigger font cache assertions in debug bots
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dave Barton
URL: http://test-results.appspot.com/dashb...
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-24 10:46 PDT by Levi Weintraub
Modified: 2012-10-24 16:50 PDT (History)
10 users (show)

See Also:


Attachments
Patch (3.31 KB, patch)
2012-10-24 15:26 PDT, Dave Barton
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Levi Weintraub 2012-10-24 10:46:31 PDT
Same sort of backtrace on both:

STDERR: ASSERTION FAILED: m_purgePreventCount
STDERR: /Volumes/data/b/build/slave/webkit-mac-latest-dbg/build/src/third_party/WebKit/Source/WebCore/WebCore.gyp/../platform/graphics/FontCache.cpp(317) : PassRefPtr<WebCore::SimpleFontData> WebCore::FontCache::getCachedFontData(const WebCore::FontPlatformData *, WebCore::FontCache::ShouldRetain)
STDERR: 1   0x12b11cb9 WebCore::FontCache::getCachedFontData(WebCore::FontPlatformData const*, WebCore::FontCache::ShouldRetain)
STDERR: 2   0x12c3c6d9 WebCore::FontCache::getFontDataForCharacters(WebCore::Font const&, unsigned short const*, int)
STDERR: 3   0x12b2f3de WebCore::Font::glyphDataAndPageForCharacter(int, bool, WebCore::FontDataVariant) const
STDERR: 4   0x12b323b3 WebCore::Font::glyphDataForCharacter(int, bool, WebCore::FontDataVariant) const
STDERR: 5   0x13f087a6 WebCore::RenderMathMLOperator::glyphHeightForCharacter(unsigned short)
STDERR: 6   0x13f08b53 WebCore::RenderMathMLOperator::updateFromElement()
STDERR: 7   0x13f08620 WebCore::RenderMathMLOperator::styleDidChange(WebCore::StyleDifference, WebCore::RenderStyle const*)
STDERR: 8   0x13e14f48 WebCore::RenderObject::setStyle(WTF::PassRefPtr<WebCore::RenderStyle>)
STDERR: 9   0x13e1456c WebCore::RenderObject::setAnimatableStyle(WTF::PassRefPtr<WebCore::RenderStyle>)
STDERR: 10  0x124d33e7 WebCore::Node::setRenderStyle(WTF::PassRefPtr<WebCore::RenderStyle>)
STDERR: 11  0x1245e685 WebCore::Element::recalcStyle(WebCore::Node::StyleChange)
STDERR: 12  0x1245eb08 WebCore::Element::recalcStyle(WebCore::Node::StyleChange)
STDERR: 13  0x1245eb08 WebCore::Element::recalcStyle(WebCore::Node::StyleChange)
STDERR: 14  0x1245eb08 WebCore::Element::recalcStyle(WebCore::Node::StyleChange)
STDERR: 15  0x1245eb08 WebCore::Element::recalcStyle(WebCore::Node::StyleChange)
STDERR: 16  0x1245eb08 WebCore::Element::recalcStyle(WebCore::Node::StyleChange)
STDERR: 17  0x12396a1c WebCore::Document::recalcStyle(WebCore::Node::StyleChange)
STDERR: 18  0x12392e67 WebCore::Document::styleResolverChanged(WebCore::StyleResolverUpdateFlag)
STDERR: 19  0x13b36cf9 WebCore::XMLDocumentParser::end()
STDERR: 20  0x13b36e3d WebCore::XMLDocumentParser::finish()
STDERR: 21  0x1386a4bd WebCore::DocumentWriter::end()
STDERR: 22  0x13844c0c WebCore::DocumentLoader::finishedLoading()
STDERR: 23  0x138ab56b WebCore::MainResourceLoader::didFinishLoading(double)
STDERR: 24  0x138cfe4f WebCore::ResourceLoader::didFinishLoading(WebCore::ResourceHandle*, double)
STDERR: 25  0x12ce35aa WebCore::ResourceHandleInternal::didFinishLoading(WebKit::WebURLLoader*, double)
STDERR: 26  0x1c64ddfe webkit_glue::WebURLLoaderImpl::Context::OnCompletedRequest(int, bool, std::string const&, base::TimeTicks const&)
STDERR: 27  0x1108a3ad (anonymous namespace)::RequestProxy::NotifyCompletedRequest(int, std::string const&, base::TimeTicks const&)
STDERR: 28  0x1108abc7 base::internal::RunnableAdapter<void ((anonymous namespace)::RequestProxy::*)(int, std::string const&, base::TimeTicks const&)>::Run((anonymous namespace)::RequestProxy*, int const&, std::string const&, base::TimeTicks const&)
STDERR: 29  0x1108aac6 base::internal::InvokeHelper<false, void, base::internal::RunnableAdapter<void ((anonymous namespace)::RequestProxy::*)(int, std::string const&, base::TimeTicks const&)>, void ()((anonymous namespace)::RequestProxy* const&, int const&, std::string const&, base::TimeTicks const&)>::MakeItSo(base::internal::RunnableAdapter<void ((anonymous namespace)::RequestProxy::*)(int, std::string const&, base::TimeTicks const&)>, (anonymous namespace)::RequestProxy* const&, int const&, std::string const&, base::TimeTicks const&)
STDERR: 30  0x1108aa05 base::internal::Invoker<4, base::internal::BindState<base::internal::RunnableAdapter<void ((anonymous namespace)::RequestProxy::*)(int, std::string const&, base::TimeTicks const&)>, void ()((anonymous namespace)::RequestProxy*, int, std::string const&, base::TimeTicks const&), void ()((anonymous namespace)::RequestProxy*, int, std::string, base::TimeTicks)>, void ()((anonymous namespace)::RequestProxy*, int, std::string const&, base::TimeTicks const&)>::Run(base::internal::BindStateBase*)
Comment 1 Dave Barton 2012-10-24 11:03:39 PDT
Levi, can you tell which revision caused this? When did it start? (Is it often enough to tell?)
Comment 2 Philip Rogers 2012-10-24 11:14:20 PDT
(In reply to comment #1)
> Levi, can you tell which revision caused this? When did it start? (Is it often enough to tell?)

Dave,
Sometimes this is noisy, but it might help in tracking this down: http://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=mathml%2Fpresentation%2Fmo-stretch.html
Comment 3 Dave Barton 2012-10-24 11:48:17 PDT
Thanks to pdr and leviw. I see the flaky dashboard in Chrome now. Is there a way I can look at the stacktraces like Levi posted in comment 0?
Comment 4 Levi Weintraub 2012-10-24 11:55:12 PDT
(In reply to comment #3)
> Thanks to pdr and leviw. I see the flaky dashboard in Chrome now. Is there a way I can look at the stacktraces like Levi posted in comment 0?

Click on "Show results" when on that page :)
Comment 5 Dave Barton 2012-10-24 13:57:15 PDT
Those are the two tests with stretched () [] and integral sign at *various sizes*. The assertion failures only occur on Snow Leopard (10.6), where there are no STIX fonts on the bots. There are other fonts that provide the needed extender glyphs though. Actually, I see now that style-changed.html and subsup.xhtml and mo.xhtml have crashed also, though less often. These have stretched parens also, though sometimes at just one size.

As Levi says, the backtraces are all similar. In the most recent failures, Levi's 17 Document::recalcStyle got called [via WebCore::Document::updateStyleIfNeeded()] inside Document::styleRecalcTimerFired in the 3 rarer crashes, and inside Document::finishedParsing() for mo-stretch.html, and as in comment 0 for row.xhtml.

I believe the fix for this is to add a FontCachePurgePreventer to RenderMathMLOperator::glyphHeightForCharacter. I will submit a patch for this, but really need a font or at least WebKit expert to review it. Thanks in advance!
Comment 6 Dave Barton 2012-10-24 14:01:12 PDT
Would it be better to put the FontCachePurgePreventer in RenderMathMLOperator::glyphHeightForCharacter's caller? Is it possible we're going to trigger a lot of slow purges, and should worry about minimizing that?
Comment 7 Philip Rogers 2012-10-24 14:03:41 PDT
(In reply to comment #6)
> Would it be better to put the FontCachePurgePreventer in RenderMathMLOperator::glyphHeightForCharacter's caller? Is it possible we're going to trigger a lot of slow purges, and should worry about minimizing that?

+schenney
Schenney and Eseidel recently did some work on FontCachePurgePreventer.
Comment 8 Eric Seidel (no email) 2012-10-24 14:30:09 PDT
schenney is your man.
Comment 10 Dave Barton 2012-10-24 15:26:20 PDT
Created attachment 170485 [details]
Patch
Comment 11 Eric Seidel (no email) 2012-10-24 16:33:38 PDT
Comment on attachment 170485 [details]
Patch

LGTM.
Comment 12 Dave Barton 2012-10-24 16:45:31 PDT
Thanks, Eric. Apparently schenney is in an airplane. [Seems kind of extreme just to avoid reviewing one of my patches. :) ]
Comment 13 WebKit Review Bot 2012-10-24 16:50:06 PDT
Comment on attachment 170485 [details]
Patch

Clearing flags on attachment: 170485

Committed r132424: <http://trac.webkit.org/changeset/132424>
Comment 14 WebKit Review Bot 2012-10-24 16:50:12 PDT
All reviewed patches have been landed.  Closing bug.