microsoft / cascadia-code

This is a fun, new monospaced font that includes programming ligatures and is designed to enhance the modern look and feel of the Windows Terminal.
Other
25.7k stars 803 forks source link

VS Enterprise 2019 stops responding after insta #319

Open MatrixArchitect opened 4 years ago

MatrixArchitect commented 4 years ago

Environment

Cascadia Code version number: 2007.01
Application (with version) used to display text: VS Enterprise 2019 16.6.3
OS platform and version: Windows Server 2016 1607 Build 14393.3750 running in a VM
Screen resolution (i.e. 220dpi): Windows 10 Host @ 3840x2160 (VM can't change resolution)

Any other software?
A number of plug-ins. Plugs with their own spot on the Extensions menu:
PostSharp
SuperCharger
Let me know if you want a full list of all plug ins

This is a bare bones dev VM. No other tools other than LinqPad, Chrome, IE and Office 2016

Steps to reproduce

Installed Cascadia TTF fonts for the first time. Changed Editor fonts to Cascadia in VS 2019 Enterprise. Ligatures won't work. So restarted. And then VS would become unresponsive as soon as first code file was loaded in an editor in a solution. VS would be responsive until a solution was opened and a text file was loaded into the editor. I noticed the not equal ligature work in the editor though it was not responsive. Multiple restarts didn't resolve the issue. Finally, restarting VS without opening a solution, and changing the font back to default Consolas font resolved the issue.

Expected behavior

Visual Studio should not be unresponsive and continue to operate as it did with default Consolas font.

Actual behavior

Visual Studio become unresponsive. No amount of restarts fixes the issue.

Let me know if you need any further information.

aaronbell commented 4 years ago

Strange. I have installed the Cascadia fonts in Visual Studio Enterprise as well and had no such issues.

Are you able to locate error reports from the Event Viewer or elsewise that can explain what might be causing the issue. Also is the font enumerating properly in the font menu (can you see all the weights)?

@DHowett do you know if Windows Server has issues with variable fonts?

DHowett commented 4 years ago

Not to my knowledge! @matrixarchitect can you share a dump (generated in task manager) of devenv.exe? My e-mail address is in my github profile.

You might need to explicitly use the 32-bit task manager to get a 32-bit dump because devenv is a 32-bit process :smile:

MatrixArchitect commented 4 years ago

Thanks for responding @aaronbell.

I only see font sizes up to 24 points. See attachment.

FontSize

I have also attached what I see in the Event Viewer. It's referring me to Security and Maintenance in control panel. Not clear though exactly what it wants me to look at.

EventViewer Sys Sec2 Sys Sec

Let me know if there's any other information I can collect for you.

MatrixArchitect commented 4 years ago

Thanks @DHowett

The dump file's too big. Even compressed it's like 337 MB.

Here's a one drive link to it

https://1drv.ms/u/s!Ai6zAEN6QgIqgXnBfSW0slTJrvt5?e=v3O2mj

I also sent you a link via One Drive.

VS crashed as soon as I changed the font back to Cascadia.

DHowett commented 4 years ago

Thanks! I can't promise any action on this bug over the long holiday weekend, but I'll see that the right folks look at this.

MatrixArchitect commented 4 years ago

No worries. Thank you. Take your time. Happy 4th. Enjoy the long weekend.

aaronbell commented 4 years ago

Sorry! I don't think I explained what I meant—are you seeing all the different weights of Cascadia Code? As in Cascadia Code ExtraLight, SemiLight, Light, SemiBold, Bold? Or just the one "Cascadia Code"?

MatrixArchitect commented 4 years ago

I only see Cascadia Code. I installed all 4 ttf fonts.

fonts

I installed the font by right clicking on it in windows explorer and selecting install from the context menu (instead of double clicking the font and clicking install in the window that pops up). I hope that doesn't make a difference.

MatrixArchitect commented 4 years ago

Ok I uninstalled and reinstalled the fonts by double clicking the font and then clicking install in the window that opens up. Doesn't look like it helped. I also looked at it in %windir%\fonts. It appears that fonts for which you see different weights have a multi-folder icons. Cascadia has a single folder icon.

FontFamily
aaronbell commented 4 years ago

Hm. I haven’t looked at the dump you provided (not that I’d be able to tell anything from it anyway) but looking at the images you provided it appears that your system does not support variable fonts.

I’d expect that the font should still work, though, and shouldn’t be causing crashes. You’d just only have access to the Regular weight (and it appears to be to case, per the fonts folder image).

Alternatively, there could be a font cache problem. Is this the first time you’ve installed Cascadia Code on this VM? Or did you have a version installed previously? Windows doesn’t handle uninstalling and reinstalling fonts as well as I’d like, so that could be a source of problems if there’s a cache issue and Windows is confused between the old and new version of the font.

MatrixArchitect commented 4 years ago

This was the first time I installed them. I never had these fonts before.

I followed the instruction on the home page of the fonts and only installed the true type fonts TTF.

Installation

You mentioned variable fonts. I'm not an expert on fonts, so I did a quick search and it appears that variable fonts are open type fonts OTF. Should I have installed the OTF fonts as well? Should I have installed all of them? (TTF, OTF and WOFF2?)

aaronbell commented 4 years ago

You followed the instructions correctly—variable fonts can be both OTF and TTF (modernly both are the same backend with slightly different 'flavors'). Basically a variable font is a single font file that contains multiple styles, such as weight, width, etc. For the purposes of Windows devices we provide a TTF variable font.

Basically, it sounds like your system just doesn't understand what a variable font is, and that may be somehow related to VS crashing. What's confusing is that in my experience, systems that can't deal with variable fonts just see them as Regular weights, so I'm not sure why VS is crashing, but I'm sure the dump will provide more info on that.

Anyway, it seems to me that we should definitely provide static TTF instances of Cascadia Code, eh @DHowett? Need to figure out how to set up ttfautohint.

MatrixArchitect commented 4 years ago

Thanks for the explanation. You may be on to something. There are OS differences. When I double-click on the TTF file on the host Windows 10 machine I see a Next and Previous buttons in the font window that cycle through the font faces. Window Title shows that the file was recognized as TrueType

Windows10FontWindow

I don't see these Next and Previous buttons on Windows Server 2016 VM. Neither does it mention the font face after the font name as in Windows 10. Window Title show this file was recognized as OpenType (I installed TTF on both systems).

Windows2016FontWindow

In Windows 2016, the fonts were installed in %windir%\fonts folder. In Windows 10, they're installed somewhere else. I don't see them in %windir%\fonts folder. But I do see the font installed in Settings>Personalization>Fonts with all 6 font faces.

It's a bummer. I was really looking forward to all those ligatures.

aaronbell commented 4 years ago

Yeah, looks like Windows Server 2016 does not have support for the format. Sorry for the trouble! I'd still expect the fonts to work, at least at a minimal level, but hopefully when folks are back next week they can figure out what's going on with the dump.

For now, I'd suggest installing the previous release of Cascadia Code which is not a variable font, and should work without any trouble. You won't have access to the full range of weights, but you'll get the ligatures!

MatrixArchitect commented 4 years ago

Cool thanks @aaronbell. V2005.15 works without a hiccup. My 2¢: 2007.01 needs to be made safe enough so it falls back gracefully to 2005.15 behavior on systems that don't support variable fonts. Happy 4th.

MatrixArchitect commented 4 years ago

Ok I spoke too soon. With 2007.01 VS would become unresponsive as soon as I would change the font to Cascadia. That didn't happen with 2005.15. The ligatures worked after I changed the font to Cascadia. I got excited. But now VS becomes unresponsive on restart and project load. Thanks for everything. Have a great weekend and we'll pick up this thread next week. I have a new dump file ready should it be needed.

aaronbell commented 4 years ago

A bit of background for you: Variable fonts are basically like a standard font file, but have additional little bits added in that say, "when you move along axis ZZZ, change the position of point 15 by (x,y)". If a computer doesn't understand the variable font bits, it should just read it as a standard font file with no variation. That's why you didn't see the "Next>" button when you installed it.

However, there is something else amiss. If the 2005.15 version of the font (which has been out in the wild for over a month and a half with no similar reported issues) is also causing your VS install to be unresponsive, I start to suspect that it might be something on your end 😦. Hopefully the dump files can shed some light on this.

MatrixArchitect commented 4 years ago

Re: something wrong on my environment. It's quite possible. However, I am usually up to date on patches, both OS and VS.

I am old fashioned and I still develop on a server in a VM to keep my host OS clean of any development tools. I just don't want to subject the host OS to a lot of a installations and uninstallations which is fairly common in dev environments. If something goes wrong, I just roll back to the previous version of VHDX or worst case, trash the VHDX and restore from backup. I can be up and running again in case of a DR in less than 30 mins. I don't have that luxury if I put all my tools on the host VS which would take a lot longer to rebuild. And on top of that, I have the flexibility of installing full server versions of IIS or SQL etc. should I need to, to say the least.

These days I rarely find developers using a server OS. Most people use Windows 10 and it's good enough for them. That could be another reason why no one else has whined. But I'll wait to see if the dump analysis reveals anything on my end. Would be good to know if it's on my end, because fixing it is would be in my control. :)

DHowett commented 4 years ago

So, I went ahead and jumped in with both feet ...

image

DHowett commented 4 years ago

Ha! Okay, it's triggered by displaying multiple styles in the buffer. I set comments to be Bold and it locked up the moment I finished introducing a comment.

The hang is somewhere in DirectWrite as it tries to AccumulateInterpolatedTupleDeltas.

aaronbell commented 4 years ago

@Dhowett, thanks for the investigation! From your description, it sounds like you were testing the Variable font? I was surprised that @MatrixArchitect also said that the older, non-variable version caused hangs as well. Or would this same hang spot be valid for that too?

DHowett commented 4 years ago

I believe the same code is involved in fake-bolding the font.

aaronbell commented 4 years ago

Ahh, OK. So it is an issue with the fake bold. That'd make sense. So if we provided a set of static TTFs, that should resolve things.

DHowett commented 4 years ago

I actually can't get this to reproduce w/ 2005.15. Hm.

MatrixArchitect commented 4 years ago

@DHowett Thank you for looking into it. For me the hang w/2005.15 happened on VS restart not on changing fonts. I was able to change fonts successfully. Was very happy. Wanted to see what happens when I restart VS. And I was happy no more. :)

I also have a dump file for 2005.15 if you want.

DHowett commented 4 years ago

That would be very helpful, as I wasn't able to break it even on relaunch. Thanks :smile:

MatrixArchitect commented 4 years ago

@DHowett Thank you again. Here's the link to dump for 2005.15. I've also sent you an email via OneDrive. https://1drv.ms/u/s!Ai6zAEN6QgIqgXsvptJMkDq77C9p?e=0juIWi

I can't claim I understood everything you guys said earlier about mixing fonts styles and their interactions. But I do wonder if it is worth pointing out that I am using a (mini ReSharper like) plugin called SuperCharger that selectively mucks around with font styles on keywords and code components etc. Could that be an issue? See screenshot.

SuperchargerFonts
DHowett commented 4 years ago

Interesting. That could be related.

Unfortunately, there was nothing interesting in the most recent dump you shared. Was VS stalled when you took it? It didn't seem like any of its 34 threads were doing anything particularly interesting. ☹️

MatrixArchitect commented 4 years ago

Yes it was stalled. It was stalled indeed.

If you like, I can try to reproduce it and take another dump and a screenshot saying "(Not Responding)" in the title bar. Would that help?

DHowett commented 4 years ago

No, no, I just had to make sure :smile: thanks for all the help so far. I’ve looped one a couple folks from the font rendering team on my side, because there shouldn’t be a way for a font to take down a process. I’m hoping the response is “here’s what’s wrong with your font” rather than “that’s a bug in Windows”!

MatrixArchitect commented 4 years ago

I also hope it's not a windows bug.

The way I see it, I am the one getting help. So thank you for that. I am just assisting in data collection to make this a better product for the entire dev community out there. I don't have skills in this area or I would have actually been contributing to the code base and creating pull requests. Let me know if there's anything else I can do to assist with the forensics.

aaronbell commented 4 years ago

@DHowett any word back?

Hoaas commented 4 years ago

Wow. Also experienced this bug. Took a few days of troubleshooting and Googling before I found this. After looking at ProcMon, I saw one of the last things VS did before freezing was reading the font files.

Guess it's time to upgrade the OS ...

ITSecMedia commented 3 years ago

I struggled 2 days with the bug in the latest release Cascadia Code 2009.22 (static TTF) until I tried a previous release. The current release (Cascadia Code 2009.22) is no good if you want to use the static TTF build with Intellij IDEA as the font variations doesn't get detected anymore. This one works -> CascadiaCode-2009.14

aaronbell commented 3 years ago

@DHowett Ping :) Any word on this one?

aaronbell commented 3 years ago

@DHowett Ping :)