slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
17.55k stars 601 forks source link

Out of memory crash when scrolling more than 16777216 results in ListView #3778

Closed qarmin closed 9 months ago

qarmin commented 1 year ago

1.3.0 - 081e7fe456c8034fbbda94cd5a651022ff11c9c6

https://github.com/slint-ui/slint/assets/41945903/36443267-6bd6-4888-93f4-daac1404b8f8

#0  _int_malloc (av=av@entry=0x7ffff7df6c80 <main_arena>, bytes=bytes@entry=144) at ./malloc/malloc.c:4368
#1  0x00007ffff7c9f9bd in __GI___libc_malloc (bytes=144) at ./malloc/malloc.c:3305
#2  0x00005555557171ca in i_slint_core::properties::properties_animations::<impl i_slint_core::properties::Property<T>>::set_animated_binding::hfd8fdd50faaf8d5f ()
#3  0x00005555556895ec in czkawka_slint::slint_generatedMainWindow::InnerComponent_rectangle_59::new::h1798ce4559a29ec7 ()
#4  0x00005555556f8773 in i_slint_core::model::Repeater<C>::ensure_updated_listview::h2814e4a612119211 ()
#5  0x000055555568f6d8 in <czkawka_slint::slint_generatedMainWindow::InnerComponent_rectangle_46 as i_slint_core::item_tree::ItemTree_vtable_mod::ItemTree>::visit_children_item::visit_dynamic::h92352eda78526479 ()
#6  0x0000555555732aa0 in i_slint_core::item_tree::visit_item_tree::{{closure}}::h1e4ad1e77726529f ()
#7  0x0000555555731e36 in i_slint_core::item_tree::visit_item_tree::hb1d477f552d8ddea ()
#8  0x000055555568f5bf in <czkawka_slint::slint_generatedMainWindow::InnerComponent_rectangle_46 as i_slint_core::item_tree::ItemTree_vtable_mod::ItemTree>::visit_children_item::h5cd224a97fbbcdf6 ()
#9  0x00005555556c976d in <czkawka_slint::slint_generatedMainWindow::InnerComponent_rectangle_46 as const_field_offset::PinnedDrop>::drop::VT::visit_children_item::h70848b06167dce14 ()
#10 0x0000555555bae32f in i_slint_core::item_tree::<impl i_slint_core::item_tree::ItemVisitor_vtable_mod::ItemVisitor for T>::visit_item::h233a3c569620f5c6 ()
#11 0x0000555555732b09 in i_slint_core::item_tree::visit_item_tree::{{closure}}::h1e4ad1e77726529f ()
#12 0x0000555555731e36 in i_slint_core::item_tree::visit_item_tree::hb1d477f552d8ddea ()
#13 0x000055555568f5bf in <czkawka_slint::slint_generatedMainWindow::InnerComponent_rectangle_46 as i_slint_core::item_tree::ItemTree_vtable_mod::ItemTree>::visit_children_item::h5cd224a97fbbcdf6 ()
#14 0x00005555556c976d in <czkawka_slint::slint_generatedMainWindow::InnerComponent_rectangle_46 as const_field_offset::PinnedDrop>::drop::VT::visit_children_item::h70848b06167dce14 ()
#15 0x0000555555bae32f in i_slint_core::item_tree::<impl i_slint_core::item_tree::ItemVisitor_vtable_mod::ItemVisitor for T>::visit_item::h233a3c569620f5c6 ()
#16 0x0000555555732b09 in i_slint_core::item_tree::visit_item_tree::{{closure}}::h1e4ad1e77726529f ()
#17 0x0000555555731e36 in i_slint_core::item_tree::visit_item_tree::hb1d477f552d8ddea ()
#18 0x000055555568f5bf in <czkawka_slint::slint_generatedMainWindow::InnerComponent_rectangle_46 as i_slint_core::item_tree::ItemTree_vtable_mod::ItemTree>::visit_children_item::h5cd224a97fbbcdf6 ()
#19 0x00005555556c976d in <czkawka_slint::slint_generatedMainWindow::InnerComponent_rectangle_46 as const_field_offset::PinnedDrop>::drop::VT::visit_children_item::h70848b06167dce14 ()
#20 0x0000555555bae32f in i_slint_core::item_tree::<impl i_slint_core::item_tree::ItemVisitor_vtable_mod::ItemVisitor for T>::visit_item::h233a3c569620f5c6 ()
#21 0x0000555555732b09 in i_slint_core::item_tree::visit_item_tree::{{closure}}::h1e4ad1e77726529f ()
#22 0x0000555555731e36 in i_slint_core::item_tree::visit_item_tree::hb1d477f552d8ddea ()
#23 0x000055555568f5bf in <czkawka_slint::slint_generatedMainWindow::InnerComponent_rectangle_46 as i_slint_core::item_tree::ItemTree_vtable_mod::ItemTree>::visit_children_item::h5cd224a97fbbcdf6 ()
#24 0x00005555556c976d in <czkawka_slint::slint_generatedMainWindow::InnerComponent_rectangle_46 as const_field_offset::PinnedDrop>::drop::VT::visit_children_item::h70848b06167dce14 ()
#25 0x0000555555bae32f in i_slint_core::item_tree::<impl i_slint_core::item_tree::ItemVisitor_vtable_mod::ItemVisitor for T>::visit_item::h233a3c569620f5c6 ()
#26 0x0000555555732b09 in i_slint_core::item_tree::visit_item_tree::{{closure}}::h1e4ad1e77726529f ()
#27 0x0000555555731e61 in i_slint_core::item_tree::visit_item_tree::hb1d477f552d8ddea ()
#28 0x000055555568f5bf in <czkawka_slint::slint_generatedMainWindow::InnerComponent_rectangle_46 as i_slint_core::item_tree::ItemTree_vtable_mod::ItemTree>::visit_children_item::h5cd224a97fbbcdf6 ()
#29 0x0000555555704721 in i_slint_core::model::Repeater<C>::visit::h10ed4cec63f56eb9 ()
--Type <RET> for more, q to quit, c to continue without paging--c
#30 0x00005555556bc6bb in <czkawka_slint::slint_generatedMainWindow::InnerMainWindow as i_slint_core::item_tree::ItemTree_vtable_mod::ItemTree>::visit_children_item::visit_dynamic::h7ab898bd4132a529 ()
#31 0x0000555555733020 in i_slint_core::item_tree::visit_item_tree::{{closure}}::h64aa6278311158ef ()
#32 0x0000555555731496 in i_slint_core::item_tree::visit_item_tree::h62b70e51e951cd86 ()
#33 0x00005555556bc4bf in <czkawka_slint::slint_generatedMainWindow::InnerMainWindow as i_slint_core::item_tree::ItemTree_vtable_mod::ItemTree>::visit_children_item::hc4033561bd812afc ()
#34 0x00005555556c30ad in <czkawka_slint::slint_generatedMainWindow::InnerMainWindow as const_field_offset::PinnedDrop>::drop::VT::visit_children_item::hb79e4f8cf1615cfc ()
#35 0x0000555555bae32f in i_slint_core::item_tree::<impl i_slint_core::item_tree::ItemVisitor_vtable_mod::ItemVisitor for T>::visit_item::h233a3c569620f5c6 ()
#36 0x0000555555733089 in i_slint_core::item_tree::visit_item_tree::{{closure}}::h64aa6278311158ef ()
#37 0x0000555555731496 in i_slint_core::item_tree::visit_item_tree::h62b70e51e951cd86 ()
#38 0x00005555556bc4bf in <czkawka_slint::slint_generatedMainWindow::InnerMainWindow as i_slint_core::item_tree::ItemTree_vtable_mod::ItemTree>::visit_children_item::hc4033561bd812afc ()
#39 0x00005555556c30ad in <czkawka_slint::slint_generatedMainWindow::InnerMainWindow as const_field_offset::PinnedDrop>::drop::VT::visit_children_item::hb79e4f8cf1615cfc ()
#40 0x0000555555bae32f in i_slint_core::item_tree::<impl i_slint_core::item_tree::ItemVisitor_vtable_mod::ItemVisitor for T>::visit_item::h233a3c569620f5c6 ()
#41 0x0000555555733089 in i_slint_core::item_tree::visit_item_tree::{{closure}}::h64aa6278311158ef ()
#42 0x0000555555731496 in i_slint_core::item_tree::visit_item_tree::h62b70e51e951cd86 ()
#43 0x00005555556bc4bf in <czkawka_slint::slint_generatedMainWindow::InnerMainWindow as i_slint_core::item_tree::ItemTree_vtable_mod::ItemTree>::visit_children_item::hc4033561bd812afc ()
#44 0x00005555556c30ad in <czkawka_slint::slint_generatedMainWindow::InnerMainWindow as const_field_offset::PinnedDrop>::drop::VT::visit_children_item::hb79e4f8cf1615cfc ()
#45 0x0000555555bae32f in i_slint_core::item_tree::<impl i_slint_core::item_tree::ItemVisitor_vtable_mod::ItemVisitor for T>::visit_item::h233a3c569620f5c6 ()
#46 0x0000555555733089 in i_slint_core::item_tree::visit_item_tree::{{closure}}::h64aa6278311158ef ()
#47 0x0000555555731496 in i_slint_core::item_tree::visit_item_tree::h62b70e51e951cd86 ()
#48 0x00005555556bc4bf in <czkawka_slint::slint_generatedMainWindow::InnerMainWindow as i_slint_core::item_tree::ItemTree_vtable_mod::ItemTree>::visit_children_item::hc4033561bd812afc ()
#49 0x00005555556c30ad in <czkawka_slint::slint_generatedMainWindow::InnerMainWindow as const_field_offset::PinnedDrop>::drop::VT::visit_children_item::hb79e4f8cf1615cfc ()
#50 0x0000555555bae32f in i_slint_core::item_tree::<impl i_slint_core::item_tree::ItemVisitor_vtable_mod::ItemVisitor for T>::visit_item::h233a3c569620f5c6 ()
#51 0x0000555555733089 in i_slint_core::item_tree::visit_item_tree::{{closure}}::h64aa6278311158ef ()
#52 0x00005555557314c1 in i_slint_core::item_tree::visit_item_tree::h62b70e51e951cd86 ()
#53 0x00005555556bc4bf in <czkawka_slint::slint_generatedMainWindow::InnerMainWindow as i_slint_core::item_tree::ItemTree_vtable_mod::ItemTree>::visit_children_item::hc4033561bd812afc ()
#54 0x00005555556c30ad in <czkawka_slint::slint_generatedMainWindow::InnerMainWindow as const_field_offset::PinnedDrop>::drop::VT::visit_children_item::hb79e4f8cf1615cfc ()
#55 0x0000555555bac0f0 in i_slint_core::item_rendering::render_component_items::hd46f3430277138ea ()
#56 0x000055555589b065 in i_slint_renderer_femtovg::FemtoVGRenderer::internal_render_with_post_callback::{{closure}}::h6c934c5cc378fd40 ()
#57 0x0000555555898677 in i_slint_core::properties::PropertyTracker<DirtyHandler>::evaluate_as_dependency_root::h0369c522027b6d6a ()
#58 0x00005555558b2b57 in i_slint_renderer_femtovg::FemtoVGRenderer::internal_render_with_post_callback::h5559a9166413795f ()
#59 0x00005555558b277b in i_slint_renderer_femtovg::FemtoVGRenderer::render::h03848c388e6ea00f ()
#60 0x00005555557ca46a in <i_slint_backend_winit::renderer::femtovg::GlutinFemtoVGRenderer as i_slint_backend_winit::renderer::WinitCompatibleRenderer>::render::h39dbbe9868c932ff ()
#61 0x0000555555847120 in core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut::h545558a2b92a6914 ()
#62 0x00005555557df7e2 in winit::platform_impl::platform::x11::EventLoop<T>::run_on_demand::h105096c6fd47a934 ()
#63 0x0000555555853d81 in i_slint_backend_winit::event_loop::run::ha287a006a76ac1fb ()
#64 0x00005555557caa29 in <i_slint_backend_winit::Backend as i_slint_core::platform::Platform>::run_event_loop::h1ff406ea4eb172df ()
#65 0x00005555557bb323 in i_slint_core::with_platform::h550310f2bffbd73d ()
#66 0x00005555557bab19 in slint::run_event_loop::hd7318008f3480ff5 ()
#67 0x00005555556c2f90 in <czkawka_slint::slint_generatedMainWindow::MainWindow as i_slint_core::api::ComponentHandle>::run::hfb3cf3add2904269 ()
#68 0x00005555557457dd in czkawka_slint::main::h1e7111b9e67aa517 ()
#69 0x0000555555737cb3 in std::sys_common::backtrace::__rust_begin_short_backtrace::h835480884c2f4a94 ()
#70 0x0000555555766899 in std::rt::lang_start::{{closure}}::h84cf442cec9e99da ()
#71 0x0000555555eca0ab in core::ops::function::impls::{impl#2}::call_once<(), (dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe)> ()
    at library/core/src/ops/function.rs:284
#72 std::panicking::try::do_call<&(dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe), i32> () at library/std/src/panicking.rs:502
#73 std::panicking::try<i32, &(dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe)> () at library/std/src/panicking.rs:466
#74 std::panic::catch_unwind<&(dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe), i32> () at library/std/src/panic.rs:142
#75 std::rt::lang_start_internal::{closure#2} () at library/std/src/rt.rs:148
#76 std::panicking::try::do_call<std::rt::lang_start_internal::{closure_env#2}, isize> () at library/std/src/panicking.rs:502
#77 std::panicking::try<isize, std::rt::lang_start_internal::{closure_env#2}> () at library/std/src/panicking.rs:466
#78 std::panic::catch_unwind<std::rt::lang_start_internal::{closure_env#2}, isize> () at library/std/src/panic.rs:142
#79 std::rt::lang_start_internal () at library/std/src/rt.rs:148
#80 0x0000555555745fa5 in main ()
ogoffart commented 1 year ago

I think it's the same underlying cause as https://github.com/slint-ui/slint/issues/3700 My theory is that it ends in an infinite loop of allocating items because of this f32 precision issue.

ogoffart commented 9 months ago

Closing as duplicate of #3700