New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WPF apps crash if they display text with too many combining marks #244

Open
0xd4d opened this Issue Jan 8, 2019 · 5 comments

Comments

Projects
None yet
5 participants
@0xd4d
Copy link

0xd4d commented Jan 8, 2019

  • .NET Core Version: 3.0.100-preview-010024

  • Windows version: (winver) win 10

  • Does the bug reproduce also in WPF for .NET Framework 4.8?: yes

    Problem description:

If there are too many combining marks or other special chars on one line and you try to show this text in a WPF textbox or WPF text editor, the application crashes.

Actual behavior:

Crash

Expected behavior:

The extra special chars are either ignored or a .NET exception is thrown.

Minimal repro:

Paste this text in a WPF textbox or a WPF text editor (it's new string ('\u0483', 550))

҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃҃

Here's code that generates it, don't try to display it in the VS C# REPL, it will crash VS:

File.WriteAllLines(@"c:\some\dir\a.txt", new[] {new string ('\u0483', 550) })
@vatsan-madhavan

This comment has been minimized.

Copy link
Member

vatsan-madhavan commented Jan 8, 2019

@miguep, would you mind taking a look?

@miguep

This comment has been minimized.

Copy link
Collaborator

miguep commented Jan 8, 2019

I'll give it a look

@lindexi

This comment has been minimized.

Copy link
Contributor

lindexi commented Jan 15, 2019

The demo

<Grid>
    <TextBox x:Name="Txt"></TextBox>
</Grid>

    public MainWindow()
    {
        InitializeComponent();
        Txt.Text = new string('\u0483', 550);
    }
@be5invis

This comment has been minimized.

Copy link

be5invis commented Jan 15, 2019

image
Doesn't look like a DWRITE issue.

@lindexi

This comment has been minimized.

Copy link
Contributor

lindexi commented Jan 17, 2019

One good news is it can not break the UWP application. See Microsoft/microsoft-ui-xaml#194

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment