slint-ui / slint

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

UI hanging on Windows when multiple components are created #5338

Closed Justyna-JustCode closed 3 months ago

Justyna-JustCode commented 3 months ago

Windows 11 Slint 1.6 + Rust

When running our app on Windows (it seems to work just fine on Linux), the performance is poor when resizing the window. I tried to narrow the problem down, and came up with this example:

export component MainWindow inherits Window {
    preferred-width: 400px;
    preferred-height: 200px;

    property <int> created-count: 0;
    property <length> item-preferred-width: 150px;
    property <int> items-count: Math.floor(root.width / root.item-preferred-width);
    property <length> item-width: root.width / root.items-count;

    HorizontalLayout {
        width: 100%;

        for index in root.items-count: Rectangle {
            preferred-width: root.item-width;
            background: Colors.red.mix(Colors.green, index / root.items-count);

            init => { debug("Item {} created!", index); }

            VerticalBox {
                Text {
                    text: "Created index: \{root.created-count}";
                    init => { root.created-count += 1; }
                }

                // just to make the component "heavier"
                Button { text: "Click me!"; }
                CheckBox { text: "I'm \{self.checked ? "checked" : "unchecked"}"; }
            }
        }
    }

    // to determine when the UI is hanged
    Spinner { indeterminate: true; }
}

One issue is that the items are unnecessarily re-created when the width changes, even when the model (root.items-count) stays the same. This is most probably the same as #3953. However, this is not the only problem.

The main issue is that after changing the width of the window multiple times (click and move around for a while), the application gets hanged (after releasing the mouse). It seems that the hang duration is connected to how long we've been moving around and how "heavy" the component is. The funny thing is that the UI is actually updating during the resize (well... partially, e.g. the spinner is stopped), so it seems there's nothing to do by the app during the hang.

See the video:

https://github.com/slint-ui/slint/assets/21989150/6671c128-cefb-47ab-9439-c4fc7b98cb9e

EDIT: I forgot to mention that the video is captured on a debug build. A release build is slightly more performant, so you just need to move around longer 😉

I tried it both with FemtoVG and Skia-OpenGL renderers with no difference. Basically, performance on Windows is not great, to be honest 🙈

ogoffart commented 3 months ago

Thanks for filling a bug.

(I cannot reproduce the hanging on Linux/X11 with winit. So it is probably a problem specific to window.) Would you be able to use a debugger and get a stack trace while the process is hanging?

performance on Windows is not great, to be honest 🙈

Is that a debug or release build?

Justyna-JustCode commented 3 months ago

Would you be able to use a debugger and get a stack trace while the process is hanging?

Is this one fine?

TRACE ``` thread #1 frame #0: 0x00007ff728c1f19f tester_slint.exe`i_slint_core::items::AccessibleRole i_slint_core::item_tree::ItemTree_vtable_mod::ItemTreeTO::accessible_role(self=Pin > @ 0x0000000eb3339d00, _1=0) at item_tree.rs:42 frame #1: 0x00007ff728b58d80 tester_slint.exe`i_slint_core::items::AccessibleRole i_slint_core::item_tree::ItemRc::accessible_role(self=0x0000000eb333a708) at item_tree.rs:340 frame #2: 0x00007ff7288da94a tester_slint.exe`static struct accesskit::NodeBuilder i_slint_backend_winit::accesskit::AccessKitAdapter::build_node_without_children(self=0x0000014794928d00, item=0x0000000eb333a708, scale_factor=(__0 = 1)) at accesskit.rs:385 frame #3: 0x00007ff7288d90cc tester_slint.exe`struct accesskit::NodeBuilder i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure$0(struct i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure_env$0) at accesskit.rs:253 frame #4: 0x00007ff72885e5ec tester_slint.exe`struct accesskit::NodeBuilder i_slint_core::properties::CURRENT_BINDING::set(self=0x00007ff72923e390, t=enum2$ > > > > > @ 0x0000000eb333a3b8, f=0x0000000eb333a520, f=0x0000000eb333a520, f=0x0000000eb333a520, f=) at lib.rs:265 frame #5: 0x00007ff72885fc31 tester_slint.exe`struct accesskit::NodeBuilder i_slint_core::properties::PropertyTracker >::evaluate_as_dependency_root,accesskit::NodeBuilder,i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure_env$0>(self=Pin > > > @ 0x0000000eb333a498, f=0x0000000eb333a5a0, f=0x0000000eb333a5a0, f=0x0000000eb333a5a0, f=) at properties.rs:1467 frame #6: 0x00007ff7288614b4 tester_slint.exe`struct accesskit::NodeBuilder i_slint_core::properties::PropertyTracker >::evaluate,accesskit::NodeBuilder,i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure_env$0>(self=Pin > > > @ 0x0000000eb333a5c0, f=0x0000000eb333a7c0, f=0x0000000eb333a7c0, f=) at properties.rs:1451 frame #7: 0x00007ff7288d8834 tester_slint.exe`static struct accesskit::NodeId i_slint_backend_winit::accesskit::AccessKitAdapter::build_node_for_item_recursively(self=0x0000014794928d00, nodes=(10) vec![({...}, {...}), ({...}, {...}), ({...}, {...}), ...], scale_factor=(__0 = 1)) at accesskit.rs:253 frame #8: 0x00007ff7288d913d tester_slint.exe`static struct accesskit::NodeId i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure$1(struct i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure_env$1 *, struct i_slint_core::item_tree::ItemRc) at accesskit.rs:256 frame #9: 0x00007ff7288d0062 tester_slint.exe`struct accesskit::NodeId core::ops::function::impls::impl$4::call_once,i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure_env$1>(self=0x0000000eb333ae00) at function.rs:305 frame #10: 0x00007ff72889e509 tester_slint.exe`union enum2$ > core::iter::adapters::map::impl$2::next,i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure_env$1>(self=0x0000000eb333ade8) at map.rs:108 frame #11: 0x00007ff728871f3a tester_slint.exe`struct alloc::vec::Vec alloc::vec::spec_from_iter_nested::impl$0::from_iter,i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure_env$1> >(iterator=0x0000000eb333ade8, iterator=0x0000000eb333ade8, iterator=0x0000000eb333ade8) at spec_from_iter_nested.rs:26 frame #12: 0x00007ff72887d761 tester_slint.exe`struct alloc::vec::Vec alloc::vec::spec_from_iter::impl$0::from_iter,i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure_env$1> >(iterator=) at spec_from_iter.rs:33 frame #13: 0x00007ff72887d2c7 tester_slint.exe`struct alloc::vec::Vec alloc::vec::impl$14::from_iter,i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure_env$1> >(iter=) at mod.rs:2894 frame #14: 0x00007ff7288ad7c1 tester_slint.exe`struct alloc::vec::Vec core::iter::traits::iterator::Iterator::collect,i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure_env$1>,alloc::vec::Vec >(self=) at iterator.rs:2003 frame #15: 0x00007ff7288d88ab tester_slint.exe`static struct accesskit::NodeId i_slint_backend_winit::accesskit::AccessKitAdapter::build_node_for_item_recursively(self=0x0000014794928d00, nodes=(10) vec![({...}, {...}), ({...}, {...}), ({...}, {...}), ...], scale_factor=(__0 = 1)) at accesskit.rs:255 frame #16: 0x00007ff7288d913d tester_slint.exe`static struct accesskit::NodeId i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure$1(struct i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure_env$1 *, struct i_slint_core::item_tree::ItemRc) at accesskit.rs:256 frame #17: 0x00007ff7288d0062 tester_slint.exe`struct accesskit::NodeId core::ops::function::impls::impl$4::call_once,i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure_env$1>(self=0x0000000eb333b678) at function.rs:305 frame #18: 0x00007ff72889e509 tester_slint.exe`union enum2$ > core::iter::adapters::map::impl$2::next,i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure_env$1>(self=0x0000000eb333b660) at map.rs:108 frame #19: 0x00007ff72887b0b5 tester_slint.exe`void alloc::vec::Vec::extend_desugared,i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure_env$1> >(self=(8) vec![{...}, {...}, {...}, {...}, {...}, ...], iterator=0x0000000eb333b660, iterator=0x0000000eb333b660) at mod.rs:2988 frame #20: 0x00007ff72887d73e tester_slint.exe`void alloc::vec::spec_extend::impl$0::spec_extend,i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure_env$1>,alloc::alloc::Global>(self=(8) vec![{...}, {...}, {...}, {...}, {...}, ...], iter=) at spec_extend.rs:17 frame #21: 0x00007ff7288720bd tester_slint.exe`struct alloc::vec::Vec alloc::vec::spec_from_iter_nested::impl$0::from_iter,i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure_env$1> >(iterator=0x0000000eb333b788, iterator=0x0000000eb333b788, iterator=0x0000000eb333b788) at spec_from_iter_nested.rs:43 frame #22: 0x00007ff72887d761 tester_slint.exe`struct alloc::vec::Vec alloc::vec::spec_from_iter::impl$0::from_iter,i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure_env$1> >(iterator=) at spec_from_iter.rs:33 frame #23: 0x00007ff72887d2c7 tester_slint.exe`struct alloc::vec::Vec alloc::vec::impl$14::from_iter,i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure_env$1> >(iter=) at mod.rs:2894 frame #24: 0x00007ff7288ad7c1 tester_slint.exe`struct alloc::vec::Vec core::iter::traits::iterator::Iterator::collect,i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure_env$1>,alloc::vec::Vec >(self=) at iterator.rs:2003 frame #25: 0x00007ff7288d88ab tester_slint.exe`static struct accesskit::NodeId i_slint_backend_winit::accesskit::AccessKitAdapter::build_node_for_item_recursively(self=0x0000014794928d00, nodes=(10) vec![({...}, {...}), ({...}, {...}), ({...}, {...}), ...], scale_factor=(__0 = 1)) at accesskit.rs:255 frame #26: 0x00007ff7288d978b tester_slint.exe`struct accesskit::NodeId i_slint_backend_winit::accesskit::impl$0::build_new_tree::closure$0(struct i_slint_backend_winit::accesskit::impl$0::build_new_tree::closure_env$0) at accesskit.rs:298 frame #27: 0x00007ff72885dbc9 tester_slint.exe`struct accesskit::NodeId i_slint_core::properties::CURRENT_BINDING::set(self=0x00007ff72923e390, t=enum2$ > > > > > @ 0x0000000eb333bd98, f=0x0000000eb333be90, f=0x0000000eb333be90, f=0x0000000eb333be90, f=) at lib.rs:265 frame #28: 0x00007ff7288602cb tester_slint.exe`struct accesskit::NodeId i_slint_core::properties::PropertyTracker::evaluate_as_dependency_root(self=Pin > > @ 0x0000000eb333be80, f=0x0000000eb333c038, f=0x0000000eb333c038, f=0x0000000eb333c038, f=) at properties.rs:1467 frame #29: 0x00007ff7288d937b tester_slint.exe`static struct accesskit::TreeUpdate i_slint_backend_winit::accesskit::AccessKitAdapter::build_new_tree(self=0x0000014794928d00) at accesskit.rs:297 frame #30: 0x00007ff7288d755b tester_slint.exe`struct accesskit::TreeUpdate i_slint_backend_winit::accesskit::impl$0::register_item_tree::closure$0::closure$0(struct i_slint_backend_winit::accesskit::impl$0::register_item_tree::closure$0::closure_env$0) at accesskit.rs:160 frame #31: 0x00007ff7288c5ac0 tester_slint.exe`struct accesskit_windows::adapter::QueuedEvents accesskit_windows::subclass::impl$1::update_if_active::closure$0(adapter=0x000001479492d6b0) at subclass.rs:186 frame #32: 0x00007ff7288eae6e tester_slint.exe`union enum2$ > enum2$ > >::map,accesskit_windows::adapter::QueuedEvents,accesskit_windows::subclass::impl$1::update_if_active::closure_env$0 >(self=enum2$ > > @ 0x0000000eb333c2e0, f=closure_env$0 @ 0x0000000eb333c308) at option.rs:1073 frame #33: 0x00007ff7288c575d tester_slint.exe`union enum2$ > accesskit_windows::subclass::SubclassingAdapter::update_if_active(self=0x0000014794928d00, update_factory=closure_env$0 @ 0x0000000eb333c380) at subclass.rs:186 frame #34: 0x00007ff728900ef3 tester_slint.exe`void accesskit_winit::platform_impl::platform::Adapter::update_if_active(self=0x0000014794928d00, updater=closure_env$0 @ 0x0000000eb333c400) at windows.rs:43 frame #35: 0x00007ff7288f5fa3 tester_slint.exe`void accesskit_winit::Adapter::update_if_active(self=0x0000014794928d00, updater=closure_env$0 @ 0x0000000eb333c440) at lib.rs:140 frame #36: 0x00007ff7288d748d tester_slint.exe`void i_slint_backend_winit::accesskit::impl$0::register_item_tree::closure$0(struct i_slint_backend_winit::accesskit::impl$0::register_item_tree::closure_env$0) at accesskit.rs:160 frame #37: 0x00007ff728873711 tester_slint.exe`void core::ops::function::FnOnce::call_once >(=0x0000014796f49840, =) at function.rs:250 frame #38: 0x00007ff728b97000 tester_slint.exe`void alloc::boxed::impl$47::call_once,dyn$,assoc$ > > >,alloc::alloc::Global>(struct alloc::boxed::Box,assoc$ > > >,alloc::alloc::Global>) at boxed.rs:2020 frame #39: 0x00007ff728b7565a tester_slint.exe`bool i_slint_core::timers::impl$2::maybe_activate_timers::closure$1(timers={...}) at timers.rs:290 frame #40: 0x00007ff728bc17e1 tester_slint.exe`union enum2$ > std::thread::local::LocalKey >::try_with,i_slint_core::timers::impl$2::maybe_activate_timers::closure_env$1,bool>(self=0x00007ff72923d2a8, f=closure_env$1 @ 0x0000000eb333ca88) at local.rs:284 frame #41: 0x00007ff728bbfb33 tester_slint.exe`bool std::thread::local::LocalKey >::with,i_slint_core::timers::impl$2::maybe_activate_timers::closure_env$1,bool>(self=0x00007ff72923d2a8, f=closure_env$1 @ 0x0000000eb333caf0) at local.rs:260 frame #42: 0x00007ff728b74f9d tester_slint.exe`bool i_slint_core::timers::TimerList::maybe_activate_timers(now=(__0 = 20791)) at timers.rs:246 frame #43: 0x00007ff728b5f176 tester_slint.exe`void i_slint_core::platform::update_timers_and_animations() at platform.rs:223 frame #44: 0x00007ff7288955a9 tester_slint.exe`static void i_slint_backend_winit::event_loop::EventLoopState::process_event(self=0x0000000eb333f0e0, event=0x0000000eb333ce88, event=0x0000000eb333ce88, event=0x0000000eb333ce88, event=, event_loop_target=0x0000000eb333ec50) at event_loop.rs:476 frame #45: 0x00007ff728896e94 tester_slint.exe`static void i_slint_backend_winit::event_loop::impl$6::run::closure$2::closure$0(struct i_slint_backend_winit::event_loop::impl$6::run::closure$2::closure_env$0) at event_loop.rs:557 frame #46: 0x00007ff72889d857 tester_slint.exe`static void i_slint_backend_winit::event_loop::CURRENT_WINDOW_TARGET::set >(self=0x00007ff729208740, t=0x0000000eb333d088, f=0x0000000eb333d098, f=0x0000000eb333d098, f=0x0000000eb333d098, f=) at lib.rs:265 frame #47: 0x00007ff728896e1f tester_slint.exe`void i_slint_backend_winit::event_loop::impl$6::run::closure$2(event=, event_loop_target=0x0000000eb333ec50) at event_loop.rs:556 frame #48: 0x00007ff7288811d5 tester_slint.exe`void winit::platform_impl::platform::event_loop::impl$3::run_on_demand::closure$0,i_slint_backend_winit::event_loop::impl$6::run::closure_env$2>(event=) at event_loop.rs:236 frame #49: 0x00007ff7288f5cd8 tester_slint.exe`void alloc::boxed::impl$48::call_mut > > >,dyn$ > > >,assoc$ > > >,alloc::alloc::Global>(self=0x0000000eb333d398, args=({...})) at boxed.rs:2027 frame #50: 0x00007ff7288b08bc tester_slint.exe`void winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure$0 >(struct winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0 >) at runner.rs:250 frame #51: 0x00007ff7288cb954 tester_slint.exe`void core::panic::unwind_safe::impl$25::call_once,winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0 > >(self=, =) at unwind_safe.rs:272 frame #52: 0x00007ff72887edd4 tester_slint.exe`void std::panicking::try::do_call > >,tuple$<> >(data="\U0000001f") at panicking.rs:552 frame #53: 0x00007ff72888d883 tester_slint.exe frame #54: 0x00007ff72887e89a tester_slint.exe`union enum2$,alloc::boxed::Box,alloc::alloc::Global> > > std::panicking::try,core::panic::unwind_safe::AssertUnwindSafe > > >(f=) at panicking.rs:516 frame #55: 0x00007ff72890a639 tester_slint.exe`union enum2$,alloc::boxed::Box,alloc::alloc::Global> > > std::panic::catch_unwind > >,tuple$<> >(f=) at panic.rs:146 frame #56: 0x00007ff7288aea7f tester_slint.exe`union enum2$ > > winit::platform_impl::platform::event_loop::runner::EventLoopRunner >::catch_unwind,tuple$<>,winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0 > >(self=0x000001478f20d1c0, f=0x0000000eb333db58, f=0x0000000eb333db58, f=0x0000000eb333db58, f=0x0000000eb333db58, f=) at runner.rs:183 frame #57: 0x00007ff7288b07bb tester_slint.exe`void winit::platform_impl::platform::event_loop::runner::EventLoopRunner >::call_event_handler >(self=0x000001478f20d1c0, event=) at runner.rs:246 frame #58: 0x00007ff7288b030a tester_slint.exe`void winit::platform_impl::platform::event_loop::runner::EventLoopRunner >::call_new_events >(self=0x000001478f20d1c0, init=false) at runner.rs:368 frame #59: 0x00007ff7288b0005 tester_slint.exe`void winit::platform_impl::platform::event_loop::runner::EventLoopRunner >::move_state_to >(self=0x000001478f20d1c0, new_runner_state=HandlingMainEvents) at runner.rs:325 frame #60: 0x00007ff7288b0e37 tester_slint.exe`void winit::platform_impl::platform::event_loop::runner::EventLoopRunner >::wakeup >(self=0x000001478f20d1c0) at runner.rs:215 frame #61: 0x00007ff728881777 tester_slint.exe`void winit::platform_impl::platform::event_loop::EventLoop >::wait_and_dispatch_message >(self=0x0000000eb333ec40) at event_loop.rs:390 frame #62: 0x00007ff72888100b tester_slint.exe`union enum2$,enum2$ > > winit::platform_impl::platform::event_loop::EventLoop >::run_on_demand,i_slint_backend_winit::event_loop::impl$6::run::closure_env$2>(self=0x0000000eb333ec40) at event_loop.rs:241 frame #63: 0x00007ff72887e5e6 tester_slint.exe`union enum2$,enum2$ > > winit::platform::run_on_demand::impl$0::run_on_demand,i_slint_backend_winit::event_loop::impl$6::run::closure_env$2>(self=0x0000000eb333ec40) at run_on_demand.rs:80 frame #64: 0x00007ff72889642e tester_slint.exe`static union enum2$ > > i_slint_backend_winit::event_loop::EventLoopState::run(self=0x0000000eb333f0e0, self=0x0000000eb333f0e0, self=0x0000000eb333f0e0, self=0x0000000eb333f0e0, self=0x0000000eb333f0e0, self=0x0000000eb333f0e0, self=) at event_loop.rs:548 frame #65: 0x00007ff72889c77c tester_slint.exe`union enum2$,enum2$ > > i_slint_backend_winit::impl$1::run_event_loop(self=0x000001478f20ceb0) at lib.rs:258 frame #66: 0x00007ff7288561ca tester_slint.exe at lib.rs:235 frame #67: 0x00007ff7288550f5 tester_slint.exe`i_slint_core::context::with_platform::{{closure}} at context.rs:70 frame #68: 0x00007ff728855a3e tester_slint.exe`std::thread::local::LocalKey::try_with at local.rs:284 frame #69: 0x00007ff72885586d tester_slint.exe`std::thread::local::LocalKey::with at local.rs:260 frame #70: 0x00007ff728854c68 tester_slint.exe`i_slint_core::context::with_platform at context.rs:69 frame #71: 0x00007ff728855781 tester_slint.exe`i_slint_backend_selector::with_platform at lib.rs:136 frame #72: 0x00007ff7288561a1 tester_slint.exe`union enum2$,enum2$ > > slint::run_event_loop() at lib.rs:235 frame #73: 0x00007ff728576c44 tester_slint.exe`union enum2$,enum2$ > > tester_slint::app_main::slint_generatedMainWindow::impl$43::run(self=0x0000000eb333f8b0) at main.rs:5543 frame #74: 0x00007ff72859756e tester_slint.exe`union enum2$,enum2$ > > tester_slint::app_main::main() at app_main.rs:22 frame #75: 0x00007ff728597451 tester_slint.exe`static union enum2$,enum2$ > > tester_slint::main() at main.rs:5 frame #76: 0x00007ff7285085d3 tester_slint.exe`union enum2$,enum2$ > > core::ops::function::FnOnce::call_once,enum2$ > > (=(tester_slint.exe`static union enum2$,enum2$ > > tester_slint::main() at main.rs:4), =)(),tuple$<> >( *) at function.rs:250 frame #77: 0x00007ff72858a0b6 tester_slint.exe`union enum2$,enum2$ > > std::sys_common::backtrace::__rust_begin_short_backtrace,enum2$ > > (f=(tester_slint.exe`static union enum2$,enum2$ > > tester_slint::main() at main.rs:4))(),enum2$,enum2$ > > >( *) at backtrace.rs:155 frame #78: 0x00007ff72853e526 tester_slint.exe`int std::rt::lang_start::closure$0,enum2$ > > >(struct std::rt::lang_start::closure_env$0,enum2$ > > > *) at rt.rs:166 frame #79: 0x00007ff7291a0a02 tester_slint.exe`void std::rt::lang_start_internal() at rt.rs:148 frame #80: 0x00007ff72853e4fa tester_slint.exe`__int64 std::rt::lang_start,enum2$ > > >(main=(tester_slint.exe`static union enum2$,enum2$ > > tester_slint::main() at main.rs:4), argc=1, argv=0x000001478f20a660, sigpipe='\0') at rt.rs:165 frame #81: 0x00007ff728597479 tester_slint.exe`main + 25 frame #82: 0x00007ff7291c9680 tester_slint.exe`static int __scrt_common_main_seh() at exe_common.inl:288 frame #83: 0x00007ff90aaa257d kernel32.dll`BaseThreadInitThunk + 29 frame #84: 0x00007ff90c0aaf28 ntdll.dll`RtlUserThreadStart + 40 thread #4 frame #0: 0x00007ff90c0f3bf4 ntdll.dll`NtWaitForWorkViaWorkerFactory + 20 frame #1: 0x00007ff90c08585e ntdll.dll`RtlClearThreadWorkOnBehalfTicket + 862 frame #2: 0x00007ff90aaa257d kernel32.dll`BaseThreadInitThunk + 29 frame #3: 0x00007ff90c0aaf28 ntdll.dll`RtlUserThreadStart + 40 thread #2 frame #0: 0x00007ff90c0f3bf4 ntdll.dll`NtWaitForWorkViaWorkerFactory + 20 frame #1: 0x00007ff90c08585e ntdll.dll`RtlClearThreadWorkOnBehalfTicket + 862 frame #2: 0x00007ff90aaa257d kernel32.dll`BaseThreadInitThunk + 29 frame #3: 0x00007ff90c0aaf28 ntdll.dll`RtlUserThreadStart + 40 thread #3 frame #0: 0x00007ff90c0f3bf4 ntdll.dll`NtWaitForWorkViaWorkerFactory + 20 frame #1: 0x00007ff90c08585e ntdll.dll`RtlClearThreadWorkOnBehalfTicket + 862 frame #2: 0x00007ff90aaa257d kernel32.dll`BaseThreadInitThunk + 29 frame #3: 0x00007ff90c0aaf28 ntdll.dll`RtlUserThreadStart + 40 thread #14 frame #0: 0x00007ff90c0f3bf4 ntdll.dll`NtWaitForWorkViaWorkerFactory + 20 frame #1: 0x00007ff90c08585e ntdll.dll`RtlClearThreadWorkOnBehalfTicket + 862 frame #2: 0x00007ff90aaa257d kernel32.dll`BaseThreadInitThunk + 29 frame #3: 0x00007ff90c0aaf28 ntdll.dll`RtlUserThreadStart + 40 thread #7 frame #0: 0x00007ff90c0f3bf4 ntdll.dll`NtWaitForWorkViaWorkerFactory + 20 frame #1: 0x00007ff90c08585e ntdll.dll`RtlClearThreadWorkOnBehalfTicket + 862 frame #2: 0x00007ff90aaa257d kernel32.dll`BaseThreadInitThunk + 29 frame #3: 0x00007ff90c0aaf28 ntdll.dll`RtlUserThreadStart + 40 thread #11 frame #0: 0x00007ff90c0f0024 ntdll.dll`NtWaitForSingleObject + 20 frame #1: 0x00007ff9093e952e KernelBase.dll`WaitForSingleObjectEx + 142 frame #2: 0x00007ff88280254a nvoglv64.dll`DrvValidateVersion + 48506 frame #3: 0x00007ff88258786c nvoglv64.dll frame #4: 0x00007ff882587244 nvoglv64.dll frame #5: 0x00007ff882803978 nvoglv64.dll`DrvValidateVersion + 53672 frame #6: 0x00007ff90aaa257d kernel32.dll`BaseThreadInitThunk + 29 frame #7: 0x00007ff90c0aaf28 ntdll.dll`RtlUserThreadStart + 40 thread #12 frame #0: 0x00007ff90c0f0af4 ntdll.dll`NtWaitForMultipleObjects + 20 frame #1: 0x00007ff909406089 KernelBase.dll`WaitForMultipleObjectsEx + 233 frame #2: 0x00007ff909405f8e KernelBase.dll`WaitForMultipleObjects + 14 frame #3: 0x00007ff882837e17 nvoglv64.dll`DrvPresentBuffers + 50343 frame #4: 0x00007ff88283737c nvoglv64.dll`DrvPresentBuffers + 47628 frame #5: 0x00007ff90aaa257d kernel32.dll`BaseThreadInitThunk + 29 frame #6: 0x00007ff90c0aaf28 ntdll.dll`RtlUserThreadStart + 40 thread #13 frame #0: 0x00007ff90938acf4 win32u.dll`NtUserMsgWaitForMultipleObjectsEx + 20 frame #1: 0x00007ff90a3e5e67 user32.dll`MsgWaitForMultipleObjects + 87 frame #2: 0x00007ff8827fadaf nvoglv64.dll`DrvValidateVersion + 17887 frame #3: 0x00007ff90aaa257d kernel32.dll`BaseThreadInitThunk + 29 frame #4: 0x00007ff90c0aaf28 ntdll.dll`RtlUserThreadStart + 40 thread #17 frame #0: 0x00007ff90c0f0af4 ntdll.dll`NtWaitForMultipleObjects + 20 frame #1: 0x00007ff909406089 KernelBase.dll`WaitForMultipleObjectsEx + 233 frame #2: 0x00007ff909405f8e KernelBase.dll`WaitForMultipleObjects + 14 frame #3: 0x00007ff8e4b4517d UIAutomationCore.dll`UiaReturnRawElementProvider + 80557 frame #4: 0x00007ff8e4b44cf9 UIAutomationCore.dll`UiaReturnRawElementProvider + 79401 frame #5: 0x00007ff90aaa257d kernel32.dll`BaseThreadInitThunk + 29 frame #6: 0x00007ff90c0aaf28 ntdll.dll`RtlUserThreadStart + 40 thread #15 frame #0: 0x00007ff90c0f3bf4 ntdll.dll`NtWaitForWorkViaWorkerFactory + 20 frame #1: 0x00007ff90c08585e ntdll.dll`RtlClearThreadWorkOnBehalfTicket + 862 frame #2: 0x00007ff90aaa257d kernel32.dll`BaseThreadInitThunk + 29 frame #3: 0x00007ff90c0aaf28 ntdll.dll`RtlUserThreadStart + 40 thread #5 frame #0: 0x00007ff90c0f0af4 ntdll.dll`NtWaitForMultipleObjects + 20 frame #1: 0x00007ff909406089 KernelBase.dll`WaitForMultipleObjectsEx + 233 frame #2: 0x00007ff909ff8d2d combase.dll`CoFreeUnusedLibrariesEx + 1565 frame #3: 0x00007ff909ff8a62 combase.dll`CoFreeUnusedLibrariesEx + 850 frame #4: 0x00007ff909ff8da9 combase.dll`CoFreeUnusedLibrariesEx + 1689 frame #5: 0x00007ff90aaa257d kernel32.dll`BaseThreadInitThunk + 29 frame #6: 0x00007ff90c0aaf28 ntdll.dll`RtlUserThreadStart + 40 thread #6 frame #0: 0x00007ff90c0f3bf4 ntdll.dll`NtWaitForWorkViaWorkerFactory + 20 frame #1: 0x00007ff90c08585e ntdll.dll`RtlClearThreadWorkOnBehalfTicket + 862 frame #2: 0x00007ff90aaa257d kernel32.dll`BaseThreadInitThunk + 29 frame #3: 0x00007ff90c0aaf28 ntdll.dll`RtlUserThreadStart + 40 * thread #19, stop reason = Exception 0x80000003 encountered at address 0x7ff90c0f3c90 * frame #0: 0x00007ff90c0f3c91 ntdll.dll`DbgBreakPoint + 1 frame #1: 0x00007ff90c1270fe ntdll.dll`DbgUiRemoteBreakin + 78 frame #2: 0x00007ff90aaa257d kernel32.dll`BaseThreadInitThunk + 29 frame #3: 0x00007ff90c0aaf28 ntdll.dll`RtlUserThreadStart + 40 ```

Is that a debug or release build?

Of course, release is better than debug, but I meant for a release build. To be honest, the release build on Windows is worse than the debug build on Linux.

ogoffart commented 3 months ago

The problem seems to be the accessibility code. Maybe the same as https://github.com/slint-ui/slint/issues/5041

Justyna-JustCode commented 3 months ago

I can confirm that turning off the accessibility feature resolves the problem (although I had to figure out how to do this myself - either I'm blind, or the instructions on how to do this are not mentioned anywhere in the docs :wink: ). Also, the overall performance gets much better.

ogoffart commented 3 months ago

I'll close this as a duplicate of #5041, and the code should be better now.