Skip to content
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

Crash when displaying emoji #2724

Closed
zb140 opened this issue Sep 11, 2019 · 3 comments · Fixed by #2791
Closed

Crash when displaying emoji #2724

zb140 opened this issue Sep 11, 2019 · 3 comments · Fixed by #2791
Assignees
Labels
Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Product-Conhost For issues in the Console codebase Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. Severity-Crash Crashes are real bad news.

Comments

@zb140
Copy link

zb140 commented Sep 11, 2019

Starting after I updated to the latest master today, I'm getting a crash when displaying at least some emoji. Commit bac69f7 is the most recent one I was able to find that definitely works. I tried bisecting to narrow it down further but ran into a bunch of build issues and gave up.

Running in a debugger I get this exception:

Unhandled exception at 0x00007FFF994F4B29 in WindowsTerminal.exe: Microsoft C++ exception: wil::ResultException at memory location 0x0000006A998FDE10.

The particular result being complained about is this: E_INVALIDARG One or more arguments are invalid..
The call stack seems to point to this line as being the problem:

THROW_IF_FAILED(pEngine->PaintBufferLine({ clusters.data(), clusters.size() }, screenPoint, false));
(Technically it points to the next line, but I think that's just the debugger being funny).

This is 100% reproducible for me on both of the systems I've tried it on. I'm happy to help dig up more info if needed.

Environment

Windows build number: [run `[Environment]::OSVersion` for powershell, or `ver` for cmd]
10.0.18965.0 
I happen to be filing this from a system with a fairly recent Insider build, but this also happens on the latest non-Insider build.

Windows Terminal version (if applicable):
Latest from master

Any other software?
Powershell 6.2.2 (not sure if this matters)

Steps to reproduce

In Powershell:

PS> echo "$([char]0x2714)"

Expected behavior

Should print a ✔️

Actual behavior

The terminal crashes.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Sep 11, 2019
@jbolton-corvalgroup
Copy link

jbolton-corvalgroup commented Sep 11, 2019

I cannot get a crash using PowerShell 5.1.18362.145, maybe it's a PowerShell core/6+ bug, not terminal ?

Tested on windows10.

bash, (specifically git-bash from github desktop in WindowsTerminal

$ python -c 'print(chr(0x2714))'

cmd.exe in WindowsTerminal

C:\Users\john>python -c "print(chr(0x2714))"

powershell 5 (non-core) from WindowsTerminal

PS C:\Users\john> [char]0x2714

Because the above is in code fences, the character looks different. in the terminal it's: ✔

@zb140
Copy link
Author

zb140 commented Sep 11, 2019

Whatever's going on on my systems doesn't seem to be related to Powershell. I've just now tried it in Powershell 5, in cmd.exe, in Git's bash, and even after sshing to a Linux host, and all of them crash in exactly the same way.

Which commit of Terminal are you using? I'm seeing these crashes in 2ac2497 on both of the systems I've tried it on. I see there are new commits this morning but I haven't tried them yet.

@j4james
Copy link
Collaborator

j4james commented Sep 14, 2019

I can reproduce this too. And if you look at the debug output log from within the debugger, you can trace the source of the E_INVALIDARG to this line:

RETURN_HR_IF_NULL(E_INVALIDARG, glyphRunDescription);

But from what I can make out, the glyphRunDescription parameter is not actually required. It's documented as optional for the ID2D1DeviceContext::DrawGlyphRun method, which is where it's ultimately being used.

The glyphRunDescription is ignored when rendering, but can be useful for printing and serialization of rendering commands, such as to an XPS or SVG file

So I suspect that NULL check is probably a mistake. It was only recently added in commit 30e8e7f, and removing that line certainly fixes the problem for me.

cc @miniksa

@DHowett-MSFT DHowett-MSFT added Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Issue-Bug It either shouldn't be doing this or needs an investigation. Severity-Crash Crashes are real bad news. Product-Conhost For issues in the Console codebase and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Sep 16, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Sep 16, 2019
@miniksa miniksa self-assigned this Sep 17, 2019
@ghost ghost added the In-PR This issue has a related PR label Sep 17, 2019
@ghost ghost added Needs-Tag-Fix Doesn't match tag requirements Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Sep 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Product-Conhost For issues in the Console codebase Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. Severity-Crash Crashes are real bad news.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants