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

Panic when resizing window with checkbox #2002

Closed
2 tasks done
B0ney opened this issue Aug 4, 2023 · 1 comment · Fixed by #2059
Closed
2 tasks done

Panic when resizing window with checkbox #2002

B0ney opened this issue Aug 4, 2023 · 1 comment · Fixed by #2059
Labels
bug Something isn't working

Comments

@B0ney
Copy link
Contributor

B0ney commented Aug 4, 2023

Is there an existing issue for this?

  • I have searched the existing issues.

Is this issue related to iced?

  • My hardware is compatible and my graphics drivers are up-to-date.

What happened?

After upgrading my code to 0.10.0, I noticed that resizing the window caused the program to panic:

thread 'main' panicked at 'assertion failed: `(left != right)`
  left: `0.0`,
 right: `0.0`: line height cannot be 0', C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cosmic-text-0.9.0\src\buffer.rs:344:9

After a bit of digging, I was able to create a simple example to replicate the issue:

use iced::widget::{column, container, checkbox};
use iced::{Element, Sandbox};

pub fn main() -> iced::Result {
    Example::run(iced::Settings {
        window: iced::window::Settings {
            size: (500, 500),
            resizable: true,
            decorations: true,
            ..iced::window::Settings::default()
        },
        ..Default::default()
    })
}

struct Example;

#[derive(Debug, Clone, Copy)]
enum Message {
    Ignore
}

impl Sandbox for Example {
    type Message = Message;

    fn new() -> Self {
        Example
    }

    fn title(&self) -> String {
        String::from("Crash the program by resizing the window height to 0")
    }

    fn update(&mut self, message: Message) {
        match message {
            Message::Ignore => (),
        }
    }

    fn view(&self) -> Element<Message> {
        let content = column![
            checkbox(
                "",
                true, // needed to trigger
                |_| Message::Ignore
            )
        ]
        .padding(1); // needed to trigger

        container(content).into()
    }
}

To trigger the crash, resize the window height to be as small as it can.

Observations:

  • The checkbox needs to be in a column with padding set to at least 1.
  • Only crashes when the checkbox is ticked. So it seems that only the "tick" component has a key role.
  • This appears to be caused by cosmic text.

What is the expected behavior?

The window not crashing.

Version

crates.io release

Operating System

Windows

Do you have any log output?

thread 'main' panicked at 'assertion failed: `(left != right)`
  left: `0.0`,
 right: `0.0`: line height cannot be 0', C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cosmic-text-0.9.0\src\buffer.rs:344:9

stack backtrace:
   0:     0x7ff766c3e45c - std::sys_common::backtrace::_print::impl$0::fmt
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\std\src\sys_common\backtrace.rs:44
   1:     0x7ff766c50d1b - core::fmt::rt::Argument::fmt
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\core\src\fmt\rt.rs:138
   2:     0x7ff766c50d1b - core::fmt::write
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\core\src\fmt\mod.rs:1094
   3:     0x7ff766c3a869 - std::io::Write::write_fmt<std::sys::windows::stdio::Stderr>
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\std\src\io\mod.rs:1713
   4:     0x7ff766c3e20b - std::sys_common::backtrace::_print
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\std\src\sys_common\backtrace.rs:47
   5:     0x7ff766c3e20b - std::sys_common::backtrace::print
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\std\src\sys_common\backtrace.rs:34
   6:     0x7ff766c40a19 - std::panicking::default_hook::closure$1
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\std\src\panicking.rs:269
   7:     0x7ff766c406cf - std::panicking::default_hook
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\std\src\panicking.rs:288
   8:     0x7ff766c40f1e - std::panicking::rust_panic_with_hook
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\std\src\panicking.rs:705
   9:     0x7ff766c40e0d - std::panicking::begin_panic_handler::closure$0
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\std\src\panicking.rs:597
  10:     0x7ff766c3edd9 - std::sys_common::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::closure_env$0,never$>
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\std\src\sys_common\backtrace.rs:151
  11:     0x7ff766c40b10 - std::panicking::begin_panic_handler
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\std\src\panicking.rs:593
  12:     0x7ff7678404d5 - core::panicking::panic_fmt
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\core\src\panicking.rs:67
  13:     0x7ff767840a48 - core::fmt::Arguments::new_v1
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\core\src\fmt\mod.rs:311
  14:     0x7ff767840a48 - core::panicking::assert_failed_inner
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\core\src\panicking.rs:268
  15:     0x7ff766bab2b7 - core::panicking::assert_failed<f32,f32>
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\core\src\panicking.rs:228
  16:     0x7ff766cb5ee2 - cosmic_text::buffer::Buffer::new_empty
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cosmic-text-0.9.0\src\buffer.rs:344
  17:     0x7ff766cb5f38 - cosmic_text::buffer::Buffer::new
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cosmic-text-0.9.0\src\buffer.rs:362
  18:     0x7ff766862c50 - iced_wgpu::text::Cache::allocate
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\iced_wgpu-0.11.0\src\text.rs:410
  19:     0x7ff766861ba2 - iced_wgpu::text::impl$0::prepare::closure$0
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\iced_wgpu-0.11.0\src\text.rs:90
  20:     0x7ff766c796cf - core::iter::adapters::map::map_fold::closure$0<ref$<iced_wgpu::layer::text::Text>,u64,tuple$<>,iced_wgpu::text::impl$0::prepare::closure_env$0,core::iter::traits::iterator::Iterator::for_each::call::closure_env$0<u64,alloc::vec::impl$20::extend_trusted::c
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\core\src\iter\adapters\map.rs:84
  21:     0x7ff766c7f48f - core::iter::traits::iterator::Iterator::fold<core::slice::iter::Iter<iced_wgpu::layer::text::Text>,tuple$<>,core::iter::adapters::map::map_fold::closure_env$0<ref$<iced_wgpu::layer::text::Text>,u64,tuple$<>,iced_wgpu::text::impl$0::prepare::closure_env$0,
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\core\src\iter\traits\iterator.rs:2481
  22:     0x7ff766c78fe0 - core::iter::adapters::map::impl$2::fold<u64,core::slice::iter::Iter<iced_wgpu::layer::text::Text>,iced_wgpu::text::impl$0::prepare::closure_env$0,tuple$<>,core::iter::traits::iterator::Iterator::for_each::call::closure_env$0<u64,alloc::vec::impl$20::exten
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\core\src\iter\adapters\map.rs:124
  23:     0x7ff766c7945d - core::iter::traits::iterator::Iterator::for_each<core::iter::adapters::map::Map<core::slice::iter::Iter<iced_wgpu::layer::text::Text>,iced_wgpu::text::impl$0::prepare::closure_env$0>,alloc::vec::impl$20::extend_trusted::closure_env$0<u64,alloc::alloc::Glo
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\core\src\iter\traits\iterator.rs:856
  24:     0x7ff766863afb - alloc::vec::Vec<u64,alloc::alloc::Global>::extend_trusted<u64,alloc::alloc::Global,core::iter::adapters::map::Map<core::slice::iter::Iter<iced_wgpu::layer::text::Text>,iced_wgpu::text::impl$0::prepare::closure_env$0> >
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\alloc\src\vec\mod.rs:2843
  25:     0x7ff76686579e - alloc::vec::spec_extend::impl$1::spec_extend<u64,core::iter::adapters::map::Map<core::slice::iter::Iter<iced_wgpu::layer::text::Text>,iced_wgpu::text::impl$0::prepare::closure_env$0>,alloc::alloc::Global>
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\alloc\src\vec\spec_extend.rs:26
  26:     0x7ff7668634b4 - alloc::vec::spec_from_iter_nested::impl$1::from_iter<u64,core::iter::adapters::map::Map<core::slice::iter::Iter<iced_wgpu::layer::text::Text>,iced_wgpu::text::impl$0::prepare::closure_env$0> >
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\alloc\src\vec\spec_from_iter_nested.rs:62
  27:     0x7ff7668657e1 - alloc::vec::spec_from_iter::impl$0::from_iter<u64,core::iter::adapters::map::Map<core::slice::iter::Iter<iced_wgpu::layer::text::Text>,iced_wgpu::text::impl$0::prepare::closure_env$0> >
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\alloc\src\vec\spec_from_iter.rs:33
  28:     0x7ff766865757 - alloc::vec::impl$15::from_iter<u64,core::iter::adapters::map::Map<core::slice::iter::Iter<iced_wgpu::layer::text::Text>,iced_wgpu::text::impl$0::prepare::closure_env$0> >      
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\alloc\src\vec\mod.rs:2711
  29:     0x7ff766c79361 - core::iter::traits::iterator::Iterator::collect<core::iter::adapters::map::Map<core::slice::iter::Iter<iced_wgpu::layer::text::Text>,iced_wgpu::text::impl$0::prepare::closure_env$0>,alloc::vec::Vec<u64,alloc::alloc::Global> >
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\core\src\iter\traits\iterator.rs:1895
  30:     0x7ff76686174e - iced_wgpu::text::Pipeline::prepare
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\iced_wgpu-0.11.0\src\text.rs:87
  31:     0x7ff76685c1c8 - iced_wgpu::backend::Backend::prepare
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\iced_wgpu-0.11.0\src\backend.rs:177
  32:     0x7ff7667fe5cf - iced_wgpu::backend::Backend::present<alloc::string::String>
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\iced_wgpu-0.11.0\src\backend.rs:92
  33:     0x7ff7667b1718 - iced_wgpu::window::compositor::present<enum2$<iced_style::theme::Theme>,alloc::string::String>
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\iced_wgpu-0.11.0\src\window\compositor.rs:176
  34:     0x7ff7667e3409 - iced_renderer::compositor::impl$0::present::closure$1<enum2$<iced_style::theme::Theme>,alloc::string::String>
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\iced_renderer-0.1.0\src\compositor.rs:124
  35:     0x7ff7667a3086 - iced_graphics::renderer::Renderer<iced_wgpu::backend::Backend,enum2$<iced_style::theme::Theme> >::with_primitives<iced_wgpu::backend::Backend,enum2$<iced_style::theme::Theme>,enum2$<core::result::Result<tuple$<>,iced_graphics::compositor::SurfaceError> >,
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\iced_graphics-0.9.0\src\renderer.rs:51
  36:     0x7ff7667e3232 - iced_renderer::compositor::impl$0::present<enum2$<iced_style::theme::Theme>,alloc::string::String>
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\iced_renderer-0.1.0\src\compositor.rs:123
  37:     0x7ff7667bc2f2 - iced_winit::application::run_instance::async_fn$0<iced::application::Instance<checkbox_crash::Example>,iced_futures::backend::null::Executor,enum2$<iced_renderer::compositor::Compositor<enum2$<iced_style::theme::Theme> > > >
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\iced_winit-0.10.0\src\application.rs:523
  38:     0x7ff7667bf196 - iced_winit::application::run::closure$1<iced::application::Instance<checkbox_crash::Example>,iced_futures::backend::null::Executor,enum2$<iced_renderer::compositor::Compositor<enum2$<iced_style::theme::Theme> > > >
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\iced_winit-0.10.0\src\application.rs:251
  39:     0x7ff766785197 - winit::platform_impl::platform::event_loop::impl$3::run_return::closure$0<enum2$<checkbox_crash::Message>,iced_winit::application::run::closure_env$1<iced::application::Instance<checkbox_crash::Example>,iced_futures::backend::null::Executor,enum2$<iced_re
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.6\src\platform_impl\windows\event_loop.rs:260
  40:     0x7ff7667ec0cf - alloc::boxed::impl$48::call_mut<tuple$<enum2$<winit::event::Event<enum2$<checkbox_crash::Message> > >,ref_mut$<enum2$<winit::event_loop::ControlFlow> > >,dyn$<core::ops::function::FnMut<tuple$<enum2$<winit::event::Event<enum2$<checkbox_crash::Message> > >
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\alloc\src\boxed.rs:1992
  41:     0x7ff766811172 - winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure$0<enum2$<checkbox_crash::Message> >
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.6\src\platform_impl\windows\event_loop\runner.rs:250
  42:     0x7ff7667e3f54 - core::panic::unwind_safe::impl$23::call_once<tuple$<>,winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<checkbox_crash::Message> > >
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\core\src\panic\unwind_safe.rs:271
  43:     0x7ff7667c02b9 - std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<checkbox_crash::Message> > >,tuple$<> >
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\std\src\panicking.rs:500
  44:     0x7ff7667c06a3 - std::panicking::try::do_catch<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::thread_event_target_callback::closure_env$0<enum2$<checkbox_crash::Message> > >,isize>
  45:     0x7ff7667bfe8a - std::panicking::try<tuple$<>,core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<checkbox_crash::Message> > > >
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\std\src\panicking.rs:464
  46:     0x7ff7667da329 - std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<checkbox_crash::Message> > >,tuple$<> >
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\std\src\panic.rs:142
  47:     0x7ff76680f144 - winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<checkbox_crash::Message> >::catch_unwind<enum2$<checkbox_crash::Message>,tuple$<>,winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.6\src\platform_impl\windows\event_loop\runner.rs:157
  48:     0x7ff766810f38 - winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<checkbox_crash::Message> >::call_event_handler<enum2$<checkbox_crash::Message> >
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.6\src\platform_impl\windows\event_loop\runner.rs:242
  49:     0x7ff76680eedd - winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<checkbox_crash::Message> >::send_event<enum2$<checkbox_crash::Message> >
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.6\src\platform_impl\windows\event_loop\runner.rs:215
  50:     0x7ff7667856d7 - winit::platform_impl::platform::event_loop::WindowData<enum2$<checkbox_crash::Message> >::send_event<enum2$<checkbox_crash::Message> >
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.6\src\platform_impl\windows\event_loop.rs:142
  51:     0x7ff76678def9 - winit::platform_impl::platform::event_loop::public_window_callback_inner::closure$0<enum2$<checkbox_crash::Message> >
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.6\src\platform_impl\windows\event_loop.rs:1125
  52:     0x7ff766797377 - core::ops::function::FnOnce::call_once<winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<enum2$<checkbox_crash::Message> >,tuple$<> >     
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\core\src\ops\function.rs:250
  53:     0x7ff7667e3fe1 - core::panic::unwind_safe::impl$23::call_once<isize,winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<enum2$<checkbox_crash::Message> > >  
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\core\src\panic\unwind_safe.rs:271
  54:     0x7ff7667c0142 - std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<enum2$<checkbox_crash::Message> > >,isize>
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\std\src\panicking.rs:500
  55:     0x7ff7667c06a3 - std::panicking::try::do_catch<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::thread_event_target_callback::closure_env$0<enum2$<checkbox_crash::Message> > >,isize>
  56:     0x7ff7667bfffb - std::panicking::try<isize,core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<enum2$<checkbox_crash::Message> > > >
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\std\src\panicking.rs:464
  57:     0x7ff7667da311 - std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<enum2$<checkbox_crash::Message> > >,isize>
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\std\src\panic.rs:142
  58:     0x7ff76680f4d5 - winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<checkbox_crash::Message> >::catch_unwind<enum2$<checkbox_crash::Message>,isize,winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<enum2$<checkb
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.6\src\platform_impl\windows\event_loop\runner.rs:157
  59:     0x7ff7667874bb - winit::platform_impl::platform::event_loop::public_window_callback_inner<enum2$<checkbox_crash::Message> >
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.6\src\platform_impl\windows\event_loop.rs:2320
  60:     0x7ff766785c29 - winit::platform_impl::platform::event_loop::public_window_callback<enum2$<checkbox_crash::Message> >
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.6\src\platform_impl\windows\event_loop.rs:994
  61:     0x7ff892118211 - DispatchMessageW
  62:     0x7ff892117a5b - CallWindowProcW
  63:     0x7ff850e91d74 - wglSwapBuffers
  64:     0x7ff892118211 - DispatchMessageW
  65:     0x7ff892117ecc - DispatchMessageW
  66:     0x7ff892122ffd - GetClassLongW
  67:     0x7ff893f32d94 - KiUserCallbackDispatcher
  68:     0x7ff891291554 - NtUserMessageCall
  69:     0x7ff892116625 - GetDlgCtrlID
  70:     0x7ff892116132 - GetDlgCtrlID
  71:     0x7ff88d6ef490 - Ordinal43
  72:     0x7ff88d6d3032 - GetThemeEnumValue
  73:     0x7ff88d6e6d9c - CloseThemeData
  74:     0x7ff88d6e5821 - CloseThemeData
  75:     0x7ff8921162b5 - GetDlgCtrlID
  76:     0x7ff76678c152 - winit::platform_impl::platform::event_loop::public_window_callback_inner::closure$0<enum2$<checkbox_crash::Message> >
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.6\src\platform_impl\windows\event_loop.rs:1428
  77:     0x7ff766797377 - core::ops::function::FnOnce::call_once<winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<enum2$<checkbox_crash::Message> >,tuple$<> >     
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\core\src\ops\function.rs:250
  78:     0x7ff7667e3fe1 - core::panic::unwind_safe::impl$23::call_once<isize,winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<enum2$<checkbox_crash::Message> > >  
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\core\src\panic\unwind_safe.rs:271
  79:     0x7ff7667c0142 - std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<enum2$<checkbox_crash::Message> > >,isize>
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\std\src\panicking.rs:500
  80:     0x7ff7667c06a3 - std::panicking::try::do_catch<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::thread_event_target_callback::closure_env$0<enum2$<checkbox_crash::Message> > >,isize>
  81:     0x7ff7667bfffb - std::panicking::try<isize,core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<enum2$<checkbox_crash::Message> > > >
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\std\src\panicking.rs:464
  82:     0x7ff7667da311 - std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<enum2$<checkbox_crash::Message> > >,isize>
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\std\src\panic.rs:142
  83:     0x7ff76680f4d5 - winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<checkbox_crash::Message> >::catch_unwind<enum2$<checkbox_crash::Message>,isize,winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<enum2$<checkb
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.6\src\platform_impl\windows\event_loop\runner.rs:157
  84:     0x7ff7667874bb - winit::platform_impl::platform::event_loop::public_window_callback_inner<enum2$<checkbox_crash::Message> >
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.6\src\platform_impl\windows\event_loop.rs:2320
  85:     0x7ff766785c29 - winit::platform_impl::platform::event_loop::public_window_callback<enum2$<checkbox_crash::Message> >
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.6\src\platform_impl\windows\event_loop.rs:994
  86:     0x7ff892118211 - DispatchMessageW
  87:     0x7ff892117a5b - CallWindowProcW
  88:     0x7ff850e91d74 - wglSwapBuffers
  89:     0x7ff892118211 - DispatchMessageW
  90:     0x7ff892117ecc - DispatchMessageW
  91:     0x7ff892122ffd - GetClassLongW
  92:     0x7ff893f32d94 - KiUserCallbackDispatcher
  93:     0x7ff891291554 - NtUserMessageCall
  94:     0x7ff892116625 - GetDlgCtrlID
  95:     0x7ff892116132 - GetDlgCtrlID
  96:     0x7ff88d6ef490 - Ordinal43
  97:     0x7ff88d6d30ca - GetThemeEnumValue
  98:     0x7ff88d6e6d9c - CloseThemeData
  99:     0x7ff88d6e5821 - CloseThemeData
 100:     0x7ff8921162b5 - GetDlgCtrlID
 101:     0x7ff76678e022 - winit::platform_impl::platform::event_loop::public_window_callback_inner::closure$0<enum2$<checkbox_crash::Message> >
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.6\src\platform_impl\windows\event_loop.rs:1088
 102:     0x7ff766797377 - core::ops::function::FnOnce::call_once<winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<enum2$<checkbox_crash::Message> >,tuple$<> >     
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\core\src\ops\function.rs:250
 103:     0x7ff7667e3fe1 - core::panic::unwind_safe::impl$23::call_once<isize,winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<enum2$<checkbox_crash::Message> > >  
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\core\src\panic\unwind_safe.rs:271
 104:     0x7ff7667c0142 - std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<enum2$<checkbox_crash::Message> > >,isize>
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\std\src\panicking.rs:500
 105:     0x7ff7667c06a3 - std::panicking::try::do_catch<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::thread_event_target_callback::closure_env$0<enum2$<checkbox_crash::Message> > >,isize>
 106:     0x7ff7667bfffb - std::panicking::try<isize,core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<enum2$<checkbox_crash::Message> > > >
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\std\src\panicking.rs:464
 107:     0x7ff7667da311 - std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<enum2$<checkbox_crash::Message> > >,isize>
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\std\src\panic.rs:142
 108:     0x7ff76680f4d5 - winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<checkbox_crash::Message> >::catch_unwind<enum2$<checkbox_crash::Message>,isize,winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<enum2$<checkb
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.6\src\platform_impl\windows\event_loop\runner.rs:157
 109:     0x7ff7667874bb - winit::platform_impl::platform::event_loop::public_window_callback_inner<enum2$<checkbox_crash::Message> >
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.6\src\platform_impl\windows\event_loop.rs:2320
 110:     0x7ff766785c29 - winit::platform_impl::platform::event_loop::public_window_callback<enum2$<checkbox_crash::Message> >
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.6\src\platform_impl\windows\event_loop.rs:994
 111:     0x7ff892118211 - DispatchMessageW
 112:     0x7ff892117a5b - CallWindowProcW
 113:     0x7ff850e91d74 - wglSwapBuffers
 114:     0x7ff892118211 - DispatchMessageW
 115:     0x7ff892117cd1 - DispatchMessageW
 116:     0x7ff766784f26 - winit::platform_impl::platform::event_loop::EventLoop<enum2$<checkbox_crash::Message> >::run_return<enum2$<checkbox_crash::Message>,iced_winit::application::run::closure_env$1<iced::application::Instance<checkbox_crash::Example>,iced_futures::backend::nul
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.6\src\platform_impl\windows\event_loop.rs:282
 117:     0x7ff7667f763e - winit::platform::run_return::impl$0::run_return<enum2$<checkbox_crash::Message>,iced_winit::application::run::closure_env$1<iced::application::Instance<checkbox_crash::Example>,iced_futures::backend::null::Executor,enum2$<iced_renderer::compositor::Compos
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.28.6\src\platform\run_return.rs:51
 118:     0x7ff7667933a5 - iced_winit::application::platform::run<enum2$<checkbox_crash::Message>,iced_winit::application::run::closure_env$1<iced::application::Instance<checkbox_crash::Example>,iced_futures::backend::null::Executor,enum2$<iced_renderer::compositor::Compositor<enum
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\iced_winit-0.10.0\src\application.rs:909
 119:     0x7ff7667be8d1 - iced_winit::application::run<iced::application::Instance<checkbox_crash::Example>,iced_futures::backend::null::Executor,enum2$<iced_renderer::compositor::Compositor<enum2$<iced_style::theme::Theme> > > >
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\iced_winit-0.10.0\src\application.rs:226
 120:     0x7ff7668120b0 - iced::application::Application::run<checkbox_crash::Example>
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\iced-0.10.0\src\application.rs:208
 121:     0x7ff7668122f1 - iced::sandbox::Sandbox::run<checkbox_crash::Example>
                               at C:\Users\boney\.cargo\registry\src\index.crates.io-6f17d22bba15001f\iced-0.10.0\src\sandbox.rs:153
 122:     0x7ff766793089 - checkbox_crash::main
                               at C:\Users\boney\CODE\MY_STUFF\bug_report\checkbox_crash\src\main.rs:5
 123:     0x7ff766797893 - core::ops::function::FnOnce::call_once<enum2$<core::result::Result<tuple$<>,enum2$<iced::error::Error> > > (*)(),tuple$<> >
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\core\src\ops\function.rs:250
 124:     0x7ff766781ffd - std::sys_common::backtrace::__rust_begin_short_backtrace<enum2$<core::result::Result<tuple$<>,enum2$<iced::error::Error> > > (*)(),enum2$<core::result::Result<tuple$<>,enum2$<iced::error::Error> > > >
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\std\src\sys_common\backtrace.rs:135
 125:     0x7ff7667eacc6 - std::rt::lang_start::closure$0<enum2$<core::result::Result<tuple$<>,enum2$<iced::error::Error> > > >
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\std\src\rt.rs:166
 126:     0x7ff766c36cb8 - std::rt::lang_start_internal::closure$2
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\std\src\rt.rs:148
 127:     0x7ff766c36cb8 - std::panicking::try::do_call
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\std\src\panicking.rs:500
 128:     0x7ff766c36cb8 - std::panicking::try
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\std\src\panicking.rs:464
 129:     0x7ff766c36cb8 - std::panic::catch_unwind
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\std\src\panic.rs:142
 130:     0x7ff766c36cb8 - std::rt::lang_start_internal
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library\std\src\rt.rs:148
 131:     0x7ff7667eac9a - std::rt::lang_start<enum2$<core::result::Result<tuple$<>,enum2$<iced::error::Error> > > >
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225\library\std\src\rt.rs:165
 132:     0x7ff766793369 - main
 133:     0x7ff76783ec80 - invoke_main
                               at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
 134:     0x7ff76783ec80 - __scrt_common_main_seh
                               at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
 135:     0x7ff891fe26ad - BaseThreadInitThunk
 136:     0x7ff893eeaa68 - RtlUserThreadStart
@B0ney B0ney added the bug Something isn't working label Aug 4, 2023
joshuamegnauth54 added a commit to joshuamegnauth54/iced that referenced this issue Aug 31, 2023
Fixes issue iced-rs#2002.
iced-rs#2002

The gist of the problem is that `LineHeight::to_absolute` in conjunction
with other widgets may inadvertently return `0.0`. This triggers a panic in `cosmic_text`.

The original issue has a minimal example.
@joshuamegnauth54
Copy link
Contributor

I think that I fixed this issue. I'm opening a PR for it now.

hecrj added a commit that referenced this issue Sep 7, 2023
…neheight

[issue #2002] Ensure that absolute `LineHeight` is always > 0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants