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 on Linux while rendering some chars #404

Closed
seqizz opened this issue Dec 28, 2020 · 3 comments
Closed

Crash on Linux while rendering some chars #404

seqizz opened this issue Dec 28, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@seqizz
Copy link
Sponsor

seqizz commented Dec 28, 2020

Describe the bug

I gave this char inside a command: 

After that, raising the history search crashed wezterm. It is "mute" symbol from Ionicons, not sure if it means anything, but it was saying "unicode F3A2"

Environment (please complete the following information):

  • OS: X11 Linux
  • Version: UNKNOWN (one of the latest master commits)

Configuration

Might be related:

    font = wezterm.font_with_fallback({"Fira Code", "Inconsolata", "Ionicons"}),
    font_size = 14.0,
    font_antialias = 'Subpixel',
    dpi = 96.0,
    harfbuzz_features = {"ss03", "ss08"},

Additional context

Backtrace:

 2020-12-28T08:42:28.663Z INFO  wezterm_gui::gui::termwindow > OpenGL initialized! Mesa Intel(R) HD Graphics 530 (SKL GT2) OpenGL ES 3.2 Mesa 20.1.10 is_context_loss_possible=false
thread 'main' panicked at 'capacity overflow', src/liballoc/raw_vec.rs:580:5
stack backtrace:
   0:     0x55938b9eeba3 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h8e44e3bad104136e
   1:     0x55938ba2d60d - core::fmt::write::he8cb6d64ed166147
   2:     0x55938ba08dd7 - std::io::Write::write_fmt::hf25ce96005919ce6
   3:     0x55938b9ff740 - std::panicking::default_hook::{{closure}}::hf8bcda2c877e2dcc
   4:     0x55938b9ff454 - std::panicking::default_hook::h0602fc6a3744f2c1
   5:     0x55938b9ffd8c - std::panicking::rust_panic_with_hook::h7b83b0fe7900eb7a
   6:     0x55938b9ff96b - rust_begin_unwind
   7:     0x55938ba2d2f1 - core::panicking::panic_fmt::h61e03e91a1a8868a
   8:     0x55938ba2d23d - core::panicking::panic::h2f38f7f03997361e
   9:     0x55938ba29b7a - alloc::raw_vec::capacity_overflow::hb1e1327b6c7c98c1
  10:     0x55938afdb057 - alloc::raw_vec::RawVec<T,A>::allocate_in::{{closure}}::hde4cbe5a23418d61
  11:     0x55938afda6d0 - window::bitmaps::Image::resize::h300531e4785db3db
  12:     0x55938afda901 - window::bitmaps::Image::scale_by::h917e1695385d4b67
  13:     0x55938ad111e5 - wezterm_gui::gui::glyphcache::GlyphCache<T>::cached_glyph::h6767d1d80ca99b3b
  14:     0x55938acc39a5 - wezterm_gui::gui::termwindow::TermWindow::render_screen_line_opengl::h9436d58972e8cc69
  15:     0x55938acb8788 - <wezterm_gui::gui::termwindow::TermWindow as window::WindowCallbacks>::paint_opengl::h35a8d9565b3f1ddf
  16:     0x55938afe8d76 - window::os::x11::window::XWindowInner::paint::h29d77d2d99b3de5a
  17:     0x55938afc3421 - <window::os::x11::connection::XConnection as window::connection::ConnectionOps>::run_message_loop::h399905a1a8155fda
  18:     0x55938acaabf3 - wezterm_gui::run::hfa1ce59ec8062680
  19:     0x55938aca85f7 - wezterm_gui::main::he736695ee6a1356a
  20:     0x55938ac72fa3 - std::rt::lang_start::{{closure}}::h3f5d5a16a71b5f9b
  21:     0x55938ba00117 - std::rt::lang_start_internal::h7d1b27a1580794aa
  22:     0x55938acabaf2 - main
  23:     0x7f920b751c7d - __libc_start_main
  24:     0x55938ac3f0ea - _start
  25:                0x0 - <unknown>
@seqizz seqizz added the bug Something isn't working label Dec 28, 2020
wez added a commit that referenced this issue Dec 28, 2020
If a font doesn't have any latin glyphs then we'd compute 0 as the
average width.  Later, during rendering, we'd compute an `inf` scaling
factor and then subsequently fail to allocate texture space.

This commit takes the average width from a "random" selection of glyphs
(whatever the first few glyphs in the font may be) to avoid that
situation.

refs: #404
@wez
Copy link
Owner

wez commented Dec 28, 2020

The root cause of this is that the ionicons font doesn't have any latin glyphs. I've pushed a commit that considers non-latin glyphs when computing the cell metrics.

@seqizz
Copy link
Sponsor Author

seqizz commented Dec 28, 2020

That was it. Thanks for the fast response 🚀

@seqizz seqizz closed this as completed Dec 28, 2020
@github-actions
Copy link

github-actions bot commented Feb 4, 2023

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants