locked
System.Windows.Media.FontFamily crash (.NET 3.5 SP1) (System.ExecutionEngineException) RRS feed

  • مناقشة عامة

  • Hi folks,

    Just had a long afternoon debugging a potential bug in WPF (.NET 3.5 SP1 rev. 3.5.30729.4926).

    It seems System.Windows.Media.FontFamily.get_FirstFontFamily() doesn't like so much when fonts are missing on your device. Our device is a Windows Embedded Standard 7 with only the Western Fonts package. When I copied all the fonts we have to Windows 7 Ultimate into the device's Fonts directory, the issue was solved. 

    It started with a System.Windows.UIElement.Measure() call which crashed into a System.ExecutionEngineException. 

    After some debugging (call stack is below), I realized System.Windows.Media.FontFamily.get_FirstFontFamily crashed the whole CLR because in my opinion it was not finding any of the fallback fonts (Truetype ?).

    I guess this would require a fix sometime :-).

     

    Romain

    Call Stack

    0:011> !CLRStack

    OS Thread Id: 0x5d4 (11)

    ESP       EIP     

    0705cf9c 75db194b [HelperMethodFrame_1OBJ: 0705cf9c] System.Environment.FailFast(System.String)

    0705cff8 6c2b68b9 MS.Internal.Invariant.FailFast(System.String, System.String)

    0705d000 6c37e751 MS.Internal.Invariant.Assert(Boolean)

    0705d008 6bf17f9a System.Windows.Media.FontFamily.get_FirstFontFamily()

    0705d030 6b739118 System.Windows.Media.FontFamily.get_LineSpacing()

    0705d038 6689f3be MS.Internal.Text.DynamicPropertyReader.GetLineHeightValue(System.Windows.DependencyObject)

    0705d060 6689f248 MS.Internal.Documents.FlowDocumentFormatter.ComputePageMargin()

    0705d09c 6689f057 MS.Internal.Documents.FlowDocumentFormatter.Format(System.Windows.Size)

    0705d120 6689eef5 MS.Internal.Documents.FlowDocumentView.MeasureOverride(System.Windows.Size)

    0705d180 66817b90 System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

    0705d37c 6b6eeec6 System.Windows.UIElement.Measure(System.Windows.Size)

    0705d41c 66851e6d MS.Internal.Helper.MeasureElementWithSingleChild(System.Windows.UIElement, System.Windows.Size)

    0705d440 6687018f System.Windows.Controls.ScrollContentPresenter.MeasureOverride(System.Windows.Size)

    0705d4b0 66817b90 System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

    0705d6a8 6b6eeec6 System.Windows.UIElement.Measure(System.Windows.Size)

    0705d748 6684bba6 System.Windows.Controls.Grid.MeasureCell(Int32, Boolean)

    0705d784 6684b629 System.Windows.Controls.Grid.MeasureCellsGroup(Int32, System.Windows.Size, Boolean, Boolean)

    0705d820 6684a8df System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size)

    0705d8d8 66817b90 System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

    0705dad4 6b6eeec6 System.Windows.UIElement.Measure(System.Windows.Size)

    0705db74 6686fa48 System.Windows.Controls.ScrollViewer.MeasureOverride(System.Windows.Size)

    0705dc28 66817b90 System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

    0705de20 6b6eeec6 System.Windows.UIElement.Measure(System.Windows.Size)

    0705dec0 66812531 System.Windows.Controls.Border.MeasureOverride(System.Windows.Size)

    0705df88 66817b90 System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

    0705e180 6b6eeec6 System.Windows.UIElement.Measure(System.Windows.Size)

    0705e220 6684bba6 System.Windows.Controls.Grid.MeasureCell(Int32, Boolean)

    0705e25c 6684b629 System.Windows.Controls.Grid.MeasureCellsGroup(Int32, System.Windows.Size, Boolean, Boolean)

    0705e2f8 6684a8df System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size)

    0705e3b0 66817b90 System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

    0705e5a8 6b6eeec6 System.Windows.UIElement.Measure(System.Windows.Size)

    0705e648 6682704b System.Windows.Controls.Control.MeasureOverride(System.Windows.Size)

    0705e680 66817b90 System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

    0705e878 6b6eeec6 System.Windows.UIElement.Measure(System.Windows.Size)

    0705e918 04a43bb5 Aimago.EmbeddedLDI.TechnicalServices.SnapshotFileConverter.Convert(System.DateTime, System.String, System.Windows.Documents.FlowDocument)

    0705ea88 04a43277 Aimago.EmbeddedLDI.TechnicalServices.FileSystemManager.CopyAllSnapshots(System.Collections.Generic.IEnumerable`1<System.DateTime>, Aimago.EmbeddedLDI.BusinessLogic.INavigator)

    0705ec0c 04a42943 Aimago.EmbeddedLDI.BusinessLogic.UserInterfaceNavigatorController+<>c__DisplayClass4.<CopyAllSnapshots>b__0()

    0705ec5c 70646df6 System.Threading.ThreadHelper.ThreadStart_Context(System.Object)

    0705ec68 70665731 System.Threading.ExecutionContext.runTryCode(System.Object)

    0705f098 71881b6c [HelperMethodFrame_PROTECTOBJ: 0705f098] System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object)

    0705f100 70665627 System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)

    0705f11c 70650255 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)

    0705f134 70646d74 System.Threading.ThreadHelper.ThreadStart()

    0705f35c 71881b6c [GCFrame: 0705f35c] 

     

     

    27/ذو القعدة/1431 03:57 م

جميع الردود

  • I ran into the same problem.  I was able to resolve it by adding the following fonts to my system:

    • Marlette – This is the font used for the minimize, maximize and close buttons on your window borders.
    • Arial (TrueType)
    • Times New Roman (TrueType)
    • Courier New (TrueType)

    I also specified a FontFamily for my DocumentViewer control:

    docViewer.FontFamily = new System.Windows.Media.FontFamily("Arial");
    

    24/ربيع الثاني/1434 12:50 م