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 after font size change #10149

Closed
1 task done
Oleksii-LnxUsr opened this issue Apr 4, 2024 · 6 comments · Fixed by #10314
Closed
1 task done

Crash after font size change #10149

Oleksii-LnxUsr opened this issue Apr 4, 2024 · 6 comments · Fixed by #10314
Labels
defect [core label] font Font feedback for readability, size, style, etc panic / crash [core label] setting Feedback for preferences, configuration, etc

Comments

@Oleksii-LnxUsr
Copy link

Oleksii-LnxUsr commented Apr 4, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

After installing the new Zed code editor, I opened the configuration to customize it according to my preferences. While changing the settings, I accidentally set the font size to 13000. Subsequently, the code editor crashed and no longer launches.

Environment

Apple silicon M2, macOS Sonoma 14.4

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

Zed.log

@Oleksii-LnxUsr Oleksii-LnxUsr added admin read Pending admin review defect [core label] panic / crash [core label] triage Maintainer needs to classify the issue labels Apr 4, 2024
@Moshyfawn
Copy link
Contributor

Interestingly enough, my instance doesn't crash and displays the font size I specified 🤭.

As a temporary solution, you can use another program to update .config/zed/settings.json to include a "valid" font size.

@Moshyfawn Moshyfawn added setting Feedback for preferences, configuration, etc font Font feedback for readability, size, style, etc and removed triage Maintainer needs to classify the issue labels Apr 4, 2024
@osiewicz
Copy link
Contributor

osiewicz commented Apr 4, 2024

I cannot repro it when setting buffer_font_size; however, it does crash when I set ui_font_size to 13k. Which setting are we talking about here?

When I run my Nightly, I get the following error:

[MTLTextureDescriptorInternal validateWithDevice:]:1357: failed assertion `Texture Descriptor Validation
MTLTextureDescriptor has width (26000) greater than the maximum allowed size of 16384.
MTLTextureDescriptor has height (26000) greater than the maximum allowed size of 16384.

Width and height are a double of ui_font_size; maybe that's a clue? Is it as simple as clamping the ui_font_size at 8192?

@Moshyfawn
Copy link
Contributor

I cannot repro it when setting buffer_font_size; however, it does crash when I set ui_font_size to 13k. Which setting are we talking about here?

Neither crash my Nightly Zed instance.

@Moshyfawn Moshyfawn added the needs info / awaiting response Issue that needs more information from the user label Apr 4, 2024
@JosephTLyons JosephTLyons removed the admin read Pending admin review label Apr 4, 2024
@Oleksii-LnxUsr
Copy link
Author

2024-04-05.03.05.05.mov

this is what it looks like

@osiewicz
Copy link
Contributor

osiewicz commented Apr 8, 2024

Could you share that crash report that pops up?

@Oleksii-LnxUsr
Copy link
Author

Oleksii-LnxUsr commented Apr 8, 2024

Could you share that crash report that pops up?

crashreport.txt

osiewicz added a commit that referenced this issue Apr 9, 2024
Fixed #10149
A user had Zed crash due to invalid font size in settings. It turned out the width/height of glyphs does not pass validation in Metal texture initialization with a large enough font size.

All modern Macs have a max texture width/height of 16kB (barring Apple A8, used by iPhone 6 back in 2014, which uses 8kB). This commit clamps texture size at 16kB. Note that while it fixes Zed crash, using a font size that hits the limit is still pretty unusable - the users will still have a pretty unusable editor, but at least it won't crash for them.
osiewicz added a commit that referenced this issue Apr 9, 2024
Fixed #10149
A user had Zed crash due to invalid font size in settings. It turned out
the width/height of glyphs does not pass validation in Metal texture
initialization with a large enough font size.

All modern Macs have a max texture width/height of 16kB (barring Apple
A8, used by iPhone 6 back in 2014, which uses 8kB). This commit clamps
texture size at 16kB. Note that while it fixes Zed crash, using a font
size that hits the limit is still pretty unusable - the users will still
have a pretty unusable editor, but at least it won't crash for them.



Release Notes:

- Fixed crashes with huge `buffer_font_size` values.
@JosephTLyons JosephTLyons removed the needs info / awaiting response Issue that needs more information from the user label Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect [core label] font Font feedback for readability, size, style, etc panic / crash [core label] setting Feedback for preferences, configuration, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants