Closed Bug 1689379 Opened 5 years ago Closed 5 years ago

Crash in [@ shutdownhang | (anonymous namespace)::TrueTypeFontMetricsBuilder::GetBlackBox]

Categories

(Core :: Graphics: Text, defect)

x86
Windows 7
defect

Tracking

()

RESOLVED FIXED
91 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox84 --- unaffected
firefox85 --- disabled
firefox86 --- disabled
firefox87 --- disabled
firefox88 --- disabled
firefox89 --- wontfix
firefox90 --- fixed
firefox91 --- fixed

People

(Reporter: aryx, Assigned: jfkthame)

References

(Regression)

Details

(Keywords: crash, regression, topcrash)

Crash Data

Attachments

(1 file)

All crashes on Windows 7, 90% with x86. More frequent with 86.0b, 85.0b4 was an outlier for that branch with 30 affected installations.

Crash report: https://crash-stats.mozilla.org/report/index/9864abed-1ce5-4277-8634-f9d630210128

MOZ_CRASH Reason: MOZ_CRASH(Shutdown hanging before starting any known phase.)

Top 10 frames of crashing thread:

0 dwrite.dll struct `anonymous namespace'::FontMetricsBuilder::BoundingBox __thiscall `anonymous namespace'::TrueTypeFontMetricsBuilder::GetBlackBox 
1 dwrite.dll virtual struct DesignGlyphMetrics __thiscall `anonymous namespace'::TrueTypeFontMetricsBuilder::GetGlyphMetrics 
2 dwrite.dll void const* __thiscall FontFaceRegionBuilder::Impl::WriteRegionInternal const 
3 dwrite.dll void const* __thiscall FontFaceRegionBuilder::Impl::WriteRegion const 
4 dwrite.dll virtual unsigned int __thiscall FontFaceElement::AddToCacheImpl 
5 dwrite.dll void __thiscall CacheWriter::AddElement 
6 dwrite.dll void __thiscall ClientSideCacheContext::ClientLookup 
7 dwrite.dll virtual void __thiscall ClientSideCacheContext::InitializeElementImpl 
8 dwrite.dll __thiscall DWriteFontFace::DWriteFontFace 
9 dwrite.dll static class ComPtr<class DWriteFontFace> __stdcall DWriteFontFace::CreateFromKey 
Severity: -- → S3

This is showing up in the Beta topcrash list too. Any idea what might be going on here, Jonathan?

This was showing up in beta before, now with 89 it's made it to release. Presumably due to bug 1694174.

Has Regression Range: --- → yes
Keywords: topcrash

It seems like what must be happening is that some time-consuming font calls (DirectWrite APIs can block for a long time if it needs to rebuild its caches etc) are happening while we're trying to shut down. Some of these cases involve the "idle-time" cmap-loader runnable, so it may help if we make it observe will-shutdown notifications and cancel itself. We can also bail out of other potentially-expensive calls like InitializeFamily that may get sent to the parent by a content process right when we've decided to shut down; at that stage there's no real point to completing the requested task anyhow.

I don't think this will necessarily eliminate such crashes entirely, but with luck it should make them less likely. All we can really do, I think, is try pushing such a patch out and see what crash-stats shows...

Flags: needinfo?(jfkthame)
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1397c1d8bde3 Try to reduce the chance of an apparent shutdown hang by bailing out of potentially-expensive font-list calls if the app is shutting down. r=lsalzman
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch

Comment on attachment 9225000 [details]
Bug 1689379 - Try to reduce the chance of an apparent shutdown hang by bailing out of potentially-expensive font-list calls if the app is shutting down. r=lsalzman

Beta/Release Uplift Approval Request

  • User impact if declined: Occasional shutdown crash (killed by the hang detector) on Windows.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Patch simply bails out of potentially-slow DirectWrite operations if we're in the process of shutting down anyhow; should have no impact during normal use.

(Crash rate on Nightly is too low to reliably show if/how much the patch will help; we won't really see the impact until Beta.)

  • String changes made/needed:
Attachment #9225000 - Flags: approval-mozilla-beta?

Comment on attachment 9225000 [details]
Bug 1689379 - Try to reduce the chance of an apparent shutdown hang by bailing out of potentially-expensive font-list calls if the app is shutting down. r=lsalzman

approved for 90.0b5

Attachment #9225000 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Jonathan, should we have another bug for the remaining hangs?

Flags: needinfo?(jfkthame)

Yes, that'd probably be good - though I'm not sure how much more we'll be able to do for now, if (as I suspect) the main issue is that sometimes a DirectWrite call that we make ends up blocking for a really long time. But it'd be good to have a bug on file, and take another look at what's left.

Flags: needinfo?(jfkthame)
See Also: → 1719421
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: