microsoft / Win2D

Win2D is an easy-to-use Windows Runtime API for immediate mode 2D graphics rendering with GPU acceleration. It is available to C#, C++ and VB developers writing apps for the Windows Universal Platform (UWP). It utilizes the power of Direct2D, and integrates seamlessly with XAML and CoreWindow.
http://microsoft.github.io/Win2D
Other
1.78k stars 284 forks source link

Crash in Dwrite.dll on invoke CanvasFontSet.GetSystemFontSet() when particular Fonts are installed (e.g. Roboto) #863

Open beyond-danube opened 2 years ago

beyond-danube commented 2 years ago

UPD. Steps to reproduce:

  1. Download Roboto Fonts from https://fonts.google.com/specimen/Roboto
  2. Install all downloads fonts via drag-n-drop TTF files on Fonts folder in Control Panel
  3. Invoke CanvasFontSet.GetSystemFontSet() (all good at this point)
  4. Restart machine
  5. Invoke CanvasFontSet.GetSystemFontSet() again - SEH exception happens here

Exception occurs on some machines, no root cause discovered at the moment.

Exception message on call from C# code:

Exception thrown at 0x00007FF99E52770E (DWrite.dll) in FluentTerminal.App.exe: 0xC0000005: Access violation reading location 0x00000284F6901FE8.

I am not familiar with native C++ code, so did not manage to reproduce the issue native code directly, however it's clearly reproducible on my environment when making a call from C# application.

OS version is 10.0.19043

Please feel free to reach me out in terms of any additional info on reproducing, like WinDbg logs or any other.

juan- commented 2 years ago

Hi, @beyond-danube! Thanks for bringing this to our attention. We need more info to understand the scenario. Is this a WinAppSDK application?

beyond-danube commented 2 years ago

Hi @juan-, yep WinAppSDK UWP app. I have created a small demo that has nothing except button that call this method to demonstrate an issue (clearly reproduced on my end). https://github.com/beyond-danube/win2d-fonts-issue-demo

Use case is building a list of fonts to use it somewhere in app, see mentioned comments.

Exact OS version and sample project should be enough to reproduced. I will not be able to provide more details in the nearest future, too busy with this and that due to the war in my country 🇺🇦