wez / wezterm

A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust
https://wezfurlong.org/wezterm/
Other
17.2k stars 777 forks source link

Wezterm crashes when drawing high-res images #3713

Closed AnonymouX47 closed 1 year ago

AnonymouX47 commented 1 year ago

What Operating System(s) are you seeing this problem on?

Linux X11

Which Wayland compositor or X11 Window manager(s) are you using?

Kwin

WezTerm version

20230510-062945-6d8e2666

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

When drawing high-resolution images using any of the supported protocols (sixel, iterm2, kitty), the terminal emulator crashes immediately.

To Reproduce

Sample image: 927026.png

The image is successfully drawn when the size is smaller e.g with chafa -s x10 ... (spans 10 lines). I don't know what exactly the image resolution (or data size) threshold is.

NOTE: I did not use wezterm imgcat or kitten icat for the sake and consistency and because wezterm imgcat always transmits image data to the terminal as it is in the file, no resizing, compression, etc. Hence, Wezterm always crashes when using wezterm imgcat. This brings us back to https://github.com/wez/wezterm/issues/3264.

Configuration

no config

Expected Behavior

The image should be drawn, as it was before (tested and works as expected in the latest stable release 20230408-112425-69ae8472).

Logs

14:15:54.554  ERROR  wgpu::backend::direct > Handling wgpu errors as fatal by default
14:15:54.567  ERROR  env_bootstrap         > panic at /home/anonymoux47/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.16.0/src/backend/direct.rs:3019:5 - !?
   0: env_bootstrap::register_panic_hook::{{closure}}
   1: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/alloc/src/boxed.rs:2001:9
      std::panicking::rust_panic_with_hook
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:696:13
   2: std::panicking::begin_panic_handler::{{closure}}
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:583:13
   3: std::sys_common::backtrace::__rust_end_short_backtrace
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:150:18
   4: rust_begin_unwind
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:579:5
   5: core::panicking::panic_fmt
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:64:14
   6: core::ops::function::Fn::call
   7: <wgpu::backend::direct::Context as wgpu::context::Context>::device_create_texture
   8: <T as wgpu::context::DynContext>::device_create_texture
   9: wgpu::Device::create_texture
  10: wezterm_gui::termwindow::webgpu::WebGpuTexture::new
  11: wezterm_gui::renderstate::RenderContext::allocate_texture_atlas
  12: wezterm_gui::glyphcache::GlyphCache::new_gl
  13: wezterm_gui::renderstate::RenderState::recreate_texture_atlas
  14: wezterm_gui::termwindow::render::paint::<impl wezterm_gui::termwindow::TermWindow>::paint_impl
  15: wezterm_gui::termwindow::TermWindow::dispatch_window_event
  16: wezterm_gui::termwindow::TermWindow::new_window::{{closure}}::{{closure}}
  17: window::WindowEventSender::dispatch
  18: window::os::x11::window::XWindowInner::dispatch_pending_events
  19: window::os::x11::connection::XConnection::with_window_inner::{{closure}}
  20: async_task::raw::RawTask<F,T,S,M>::run
  21: window::spawn::SpawnQueue::run
  22: <window::os::x11::connection::XConnection as window::connection::ConnectionOps>::run_message_loop
  23: wezterm_gui::run_terminal_gui
  24: wezterm_gui::main
  25: std::sys_common::backtrace::__rust_begin_short_backtrace
  26: std::rt::lang_start::{{closure}}
  27: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/ops/function.rs:287:13
      std::panicking::try::do_call
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:487:40
      std::panicking::try
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:451:19
      std::panic::catch_unwind
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panic.rs:140:14
      std::rt::lang_start_internal::{{closure}}
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/rt.rs:148:48
      std::panicking::try::do_call
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:487:40
      std::panicking::try
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:451:19
      std::panic::catch_unwind
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panic.rs:140:14
      std::rt::lang_start_internal
             at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/rt.rs:148:20
  28: main
  29: <unknown>
  30: __libc_start_main
  31: _start

thread 'main' panicked at 'wgpu error: Validation Error

Caused by:
    In Device::create_texture
      note: label = `Texture Atlas`
    Dimension X value 4096 exceeds the limit of 2048

', /home/anonymoux47/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.16.0/src/backend/direct.rs:3019:5
stack backtrace:
   0:     0x55e24003ceba - std::backtrace_rs::backtrace::libunwind::trace::hccaf8ee1ec8dd788
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x55e24003ceba - std::backtrace_rs::backtrace::trace_unsynchronized::h91792397c535cc11
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x55e24003ceba - std::sys_common::backtrace::_print_fmt::h3e56b30f0697a101
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x55e24003ceba - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h690ca840ebc2b204
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x55e24006a36e - core::fmt::write::h3955d106d82382d6
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/fmt/mod.rs:1232:17
   5:     0x55e240037005 - std::io::Write::write_fmt::h8b48d830d1ebca97
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/io/mod.rs:1684:15
   6:     0x55e24003cc85 - std::sys_common::backtrace::_print::hd6a8a70d45f33183
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x55e24003cc85 - std::sys_common::backtrace::print::h5381fb255015050a
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x55e24003e9af - std::panicking::default_hook::{{closure}}::h6c23e0057757ae83
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:271:22
   9:     0x55e24003e6eb - std::panicking::default_hook::h60bdc268de287167
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:290:9
  10:     0x55e23e7927c8 - env_bootstrap::register_panic_hook::{{closure}}::hacbe0aaba95e6db0
  11:     0x55e24003f0dd - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hd33b8bfd0256e426
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/alloc/src/boxed.rs:2001:9
  12:     0x55e24003f0dd - std::panicking::rust_panic_with_hook::h3cf541b13cb93ee2
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:696:13
  13:     0x55e24003ee59 - std::panicking::begin_panic_handler::{{closure}}::hf1137d8c87fcc7fb
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:583:13
  14:     0x55e24003d326 - std::sys_common::backtrace::__rust_end_short_backtrace::h768c790caee4dd92
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:150:18
  15:     0x55e24003eb62 - rust_begin_unwind
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:579:5
  16:     0x55e23e2cd0f3 - core::panicking::panic_fmt::h7fce8e04d6d7e3e9
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:64:14
  17:     0x55e23ea7a64d - core::ops::function::Fn::call::h2c65deaf300df93b
  18:     0x55e23ea8b1ca - <wgpu::backend::direct::Context as wgpu::context::Context>::device_create_texture::h5efb1ba30de237c5
  19:     0x55e23ea93c6e - <T as wgpu::context::DynContext>::device_create_texture::h86346a73386142ef
  20:     0x55e23e9ec1bf - wgpu::Device::create_texture::h587307b14e54d60c
  21:     0x55e23e3ebc7d - wezterm_gui::termwindow::webgpu::WebGpuTexture::new::h9d7676254d300c38
  22:     0x55e23e64ba1b - wezterm_gui::renderstate::RenderContext::allocate_texture_atlas::h235426a78134aa1f
  23:     0x55e23e51ab07 - wezterm_gui::glyphcache::GlyphCache::new_gl::h2e8dd2439e21aa8c
  24:     0x55e23e64f2dc - wezterm_gui::renderstate::RenderState::recreate_texture_atlas::h0fb6971d4f3c29a0
  25:     0x55e23e5d7108 - wezterm_gui::termwindow::render::paint::<impl wezterm_gui::termwindow::TermWindow>::paint_impl::hf26cf907e8e3060a
  26:     0x55e23e5f0c66 - wezterm_gui::termwindow::TermWindow::dispatch_window_event::hf1c96734f1b9e7a3
  27:     0x55e23e430a9d - wezterm_gui::termwindow::TermWindow::new_window::{{closure}}::{{closure}}::h359a31c2558ba862
  28:     0x55e23f21fa38 - window::WindowEventSender::dispatch::h589bbb910ab98210
  29:     0x55e23f150cc5 - window::os::x11::window::XWindowInner::dispatch_pending_events::hbcec4e8f768d219f
  30:     0x55e23f2e7e6f - window::os::x11::connection::XConnection::with_window_inner::{{closure}}::hae330ff0b1450cad
  31:     0x55e23f2b7af5 - async_task::raw::RawTask<F,T,S,M>::run::h8529e69e5ad3a41a
  32:     0x55e23f27b560 - window::spawn::SpawnQueue::run::ha569c7b11717b72e
  33:     0x55e23f1f674b - <window::os::x11::connection::XConnection as window::connection::ConnectionOps>::run_message_loop::h07a1fd49648302e7
  34:     0x55e23e487622 - wezterm_gui::run_terminal_gui::ha8e1a9f651c5ebca
  35:     0x55e23e488838 - wezterm_gui::main::hc2483fcaa353600e
  36:     0x55e23e407fd3 - std::sys_common::backtrace::__rust_begin_short_backtrace::h156fcbca1392142d
  37:     0x55e23e441be9 - std::rt::lang_start::{{closure}}::h2c3d5f8724c0fa23
  38:     0x55e2400300ec - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h2cf02391f1c3eede
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/ops/function.rs:287:13
  39:     0x55e2400300ec - std::panicking::try::do_call::ha8ff8846a651f8b3
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:487:40
  40:     0x55e2400300ec - std::panicking::try::h2c16db96979d34f8
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:451:19
  41:     0x55e2400300ec - std::panic::catch_unwind::h02ea84c0efc8adb0
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panic.rs:140:14
  42:     0x55e2400300ec - std::rt::lang_start_internal::{{closure}}::he3b6d5592da9555b
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/rt.rs:148:48
  43:     0x55e2400300ec - std::panicking::try::do_call::hd8ce117a14bb0fea
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:487:40
  44:     0x55e2400300ec - std::panicking::try::hed1c3695a5011fe7
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:451:19
  45:     0x55e2400300ec - std::panic::catch_unwind::h01a43f8970d7d176
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panic.rs:140:14
  46:     0x55e2400300ec - std::rt::lang_start_internal::hbface30c2a50df85
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/rt.rs:148:20
  47:     0x55e23e492225 - main
  48:     0x7f5b7683c790 - <unknown>
  49:     0x7f5b7683c84a - __libc_start_main
  50:     0x55e23e2cd785 - _start
  51:                0x0 - <unknown>

Anything else?

I understand this only happens in the nightly release but I though it was worth reporting since I stumbled upon it while re-testing for some other bugs I had discovered a while back.

wez commented 1 year ago

This should be resolved now in main.

It typically takes about an hour before commits are available as nightly builds for all platforms. Linux builds are the fastest to build and are often available within about 20 minutes. Windows and macOS builds take a bit longer.

Please take a few moments to try out the fix and let me know how that works out. You can find the nightly downloads for your system in the wezterm installation docs.

If you prefer to use packages provided by your distribution or package manager of choice and don't want to replace that with a nightly download, keep in mind that you can download portable packages (eg: a .dmg file on macOS, a .zip file on Windows and an .AppImage file on Linux) that can be run without permanently installing or replacing an existing package, and can then simply be deleted once you no longer need them.

If you are eager and can build from source then you may be able to try this out more quickly.

AnonymouX47 commented 1 year ago

Version 20230513-073621-bdb173f1 still panics with the following traceback:

``` 16:17:42.989 ERROR wgpu::backend::direct > Handling wgpu errors as fatal by default 16:17:43.002 ERROR env_bootstrap > panic at /home/anonymoux47/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.16.0/src/backend/direct.rs:3019:5 - !? 0: env_bootstrap::register_panic_hook::{{closure}} 1: as core::ops::function::Fn>::call at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/alloc/src/boxed.rs:2001:9 std::panicking::rust_panic_with_hook at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:696:13 2: std::panicking::begin_panic_handler::{{closure}} at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:583:13 3: std::sys_common::backtrace::__rust_end_short_backtrace at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:150:18 4: rust_begin_unwind at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:579:5 5: core::panicking::panic_fmt at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:64:14 6: core::ops::function::Fn::call 7: ::device_create_texture 8: ::device_create_texture 9: wgpu::Device::create_texture 10: wezterm_gui::termwindow::webgpu::WebGpuTexture::new 11: wezterm_gui::renderstate::RenderContext::allocate_texture_atlas 12: wezterm_gui::glyphcache::GlyphCache::new_gl 13: wezterm_gui::renderstate::RenderState::recreate_texture_atlas 14: wezterm_gui::termwindow::render::paint::::paint_impl 15: wezterm_gui::termwindow::TermWindow::dispatch_window_event 16: wezterm_gui::termwindow::TermWindow::new_window::{{closure}}::{{closure}} 17: window::WindowEventSender::dispatch 18: window::os::x11::window::XWindowInner::dispatch_pending_events 19: window::os::x11::connection::XConnection::with_window_inner::{{closure}} 20: async_task::raw::RawTask::run 21: window::spawn::SpawnQueue::run 22: ::run_message_loop 23: wezterm_gui::run_terminal_gui 24: wezterm_gui::main 25: std::sys_common::backtrace::__rust_begin_short_backtrace 26: std::rt::lang_start::{{closure}} 27: core::ops::function::impls:: for &F>::call_once at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/ops/function.rs:287:13 std::panicking::try::do_call at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:487:40 std::panicking::try at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:451:19 std::panic::catch_unwind at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panic.rs:140:14 std::rt::lang_start_internal::{{closure}} at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/rt.rs:148:48 std::panicking::try::do_call at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:487:40 std::panicking::try at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:451:19 std::panic::catch_unwind at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panic.rs:140:14 std::rt::lang_start_internal at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/rt.rs:148:20 28: main 29: 30: __libc_start_main 31: _start thread 'main' panicked at 'wgpu error: Validation Error Caused by: In Device::create_texture note: label = `Texture Atlas` Dimension X value 4096 exceeds the limit of 2048 ', /home/anonymoux47/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.16.0/src/backend/direct.rs:3019:5 stack backtrace: 0: 0x55a72df35eba - std::backtrace_rs::backtrace::libunwind::trace::hccaf8ee1ec8dd788 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5 1: 0x55a72df35eba - std::backtrace_rs::backtrace::trace_unsynchronized::h91792397c535cc11 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 2: 0x55a72df35eba - std::sys_common::backtrace::_print_fmt::h3e56b30f0697a101 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:65:5 3: 0x55a72df35eba - ::fmt::h690ca840ebc2b204 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:44:22 4: 0x55a72df6336e - core::fmt::write::h3955d106d82382d6 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/fmt/mod.rs:1232:17 5: 0x55a72df30005 - std::io::Write::write_fmt::h8b48d830d1ebca97 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/io/mod.rs:1684:15 6: 0x55a72df35c85 - std::sys_common::backtrace::_print::hd6a8a70d45f33183 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:47:5 7: 0x55a72df35c85 - std::sys_common::backtrace::print::h5381fb255015050a at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:34:9 8: 0x55a72df379af - std::panicking::default_hook::{{closure}}::h6c23e0057757ae83 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:271:22 9: 0x55a72df376eb - std::panicking::default_hook::h60bdc268de287167 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:290:9 10: 0x55a72c68b7c8 - env_bootstrap::register_panic_hook::{{closure}}::hacbe0aaba95e6db0 11: 0x55a72df380dd - as core::ops::function::Fn>::call::hd33b8bfd0256e426 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/alloc/src/boxed.rs:2001:9 12: 0x55a72df380dd - std::panicking::rust_panic_with_hook::h3cf541b13cb93ee2 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:696:13 13: 0x55a72df37e59 - std::panicking::begin_panic_handler::{{closure}}::hf1137d8c87fcc7fb at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:583:13 14: 0x55a72df36326 - std::sys_common::backtrace::__rust_end_short_backtrace::h768c790caee4dd92 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:150:18 15: 0x55a72df37b62 - rust_begin_unwind at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:579:5 16: 0x55a72c1c60f3 - core::panicking::panic_fmt::h7fce8e04d6d7e3e9 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:64:14 17: 0x55a72c97364d - core::ops::function::Fn::call::h2c65deaf300df93b 18: 0x55a72c9841ca - ::device_create_texture::h5efb1ba30de237c5 19: 0x55a72c98cc6e - ::device_create_texture::h86346a73386142ef 20: 0x55a72c8e51bf - wgpu::Device::create_texture::h587307b14e54d60c 21: 0x55a72c2e4c7d - wezterm_gui::termwindow::webgpu::WebGpuTexture::new::h9d7676254d300c38 22: 0x55a72c544a1b - wezterm_gui::renderstate::RenderContext::allocate_texture_atlas::h235426a78134aa1f 23: 0x55a72c413b07 - wezterm_gui::glyphcache::GlyphCache::new_gl::h2e8dd2439e21aa8c 24: 0x55a72c5482dc - wezterm_gui::renderstate::RenderState::recreate_texture_atlas::h0fb6971d4f3c29a0 25: 0x55a72c4d0108 - wezterm_gui::termwindow::render::paint::::paint_impl::hf26cf907e8e3060a 26: 0x55a72c4e9c66 - wezterm_gui::termwindow::TermWindow::dispatch_window_event::hf1c96734f1b9e7a3 27: 0x55a72c329a9d - wezterm_gui::termwindow::TermWindow::new_window::{{closure}}::{{closure}}::h359a31c2558ba862 28: 0x55a72d118a38 - window::WindowEventSender::dispatch::h589bbb910ab98210 29: 0x55a72d049cc5 - window::os::x11::window::XWindowInner::dispatch_pending_events::hbcec4e8f768d219f 30: 0x55a72d1e0e6f - window::os::x11::connection::XConnection::with_window_inner::{{closure}}::hae330ff0b1450cad 31: 0x55a72d1b0af5 - async_task::raw::RawTask::run::h8529e69e5ad3a41a 32: 0x55a72d174560 - window::spawn::SpawnQueue::run::ha569c7b11717b72e 33: 0x55a72d0ef74b - ::run_message_loop::h07a1fd49648302e7 34: 0x55a72c380622 - wezterm_gui::run_terminal_gui::ha8e1a9f651c5ebca 35: 0x55a72c381838 - wezterm_gui::main::hc2483fcaa353600e 36: 0x55a72c300fd3 - std::sys_common::backtrace::__rust_begin_short_backtrace::h156fcbca1392142d 37: 0x55a72c33abe9 - std::rt::lang_start::{{closure}}::h2c3d5f8724c0fa23 38: 0x55a72df290ec - core::ops::function::impls:: for &F>::call_once::h2cf02391f1c3eede at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/ops/function.rs:287:13 39: 0x55a72df290ec - std::panicking::try::do_call::ha8ff8846a651f8b3 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:487:40 40: 0x55a72df290ec - std::panicking::try::h2c16db96979d34f8 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:451:19 41: 0x55a72df290ec - std::panic::catch_unwind::h02ea84c0efc8adb0 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panic.rs:140:14 42: 0x55a72df290ec - std::rt::lang_start_internal::{{closure}}::he3b6d5592da9555b at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/rt.rs:148:48 43: 0x55a72df290ec - std::panicking::try::do_call::hd8ce117a14bb0fea at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:487:40 44: 0x55a72df290ec - std::panicking::try::hed1c3695a5011fe7 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:451:19 45: 0x55a72df290ec - std::panic::catch_unwind::h01a43f8970d7d176 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panic.rs:140:14 46: 0x55a72df290ec - std::rt::lang_start_internal::hbface30c2a50df85 at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/rt.rs:148:20 47: 0x55a72c38b225 - main 48: 0x7f983b03c790 - 49: 0x7f983b03c84a - __libc_start_main 50: 0x55a72c1c6785 - _start 51: 0x0 - ```
wez commented 1 year ago

Are you certain you are actually running that build? Run wezterm --version to confirm

AnonymouX47 commented 1 year ago

Oh, sorry... I just ran

RUST_BACKTRACE=full cargo run --release --bin wezterm -- -n start

after I pulled (which actually reported the latest version with --version).

I ran cargo build --release again and now I get the following INFO log:

16:29:27.344  INFO   wezterm_gui::termwindow::render::paint > Not enough texture space (texture dimensions 4096x4096 exceeed the max dimension 2048 supported by your GPU); will retry render with images disabled

One problem though, is that the same log gets reported every time I scroll or switch away from and back to the window, even though the image was transmitted only once.

By the way, what's the cause of this?... Images this large weren't a problem before.

wez commented 1 year ago

The behavior could also happen in previous releases if you explicitly set front_end="WebGPU". The OpenGL front end already had similar logic to handle this same case when using front_end="OpenGL", which was the default in previous releases.

The issue is that the image is too large to fit in a single texture, so when combined with the images from the glyphs you want to display we're out of luck.

The way this is "handled" safely in wezterm is to try again but without trying to use any of the texture space for attached images. The error condition will trigger each time we try to render the display, and be resolved in the same way until you clear the display of any image cells.

AnonymouX47 commented 1 year ago

Oh, I see.


From the reference for front_end:

Does

The functionality described in this section requires a nightly build of wezterm.

mean the front_end config only applies in nightly builds?

If not, does

The default is "WebGpu". In earlier versions it was "OpenGL".

apply only to nightly builds?

_To be clear, "WebGPU" doesn't seem to be the default on the latest non-nightly release but I just want to be sure that won't change anytime soon... cos it'll be quite surprising to normal users when images just suddenly don't appear :)_

github-actions[bot] commented 1 year ago

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.