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

UI hanging on Windows when multiple components are created #5338

Closed
Justyna-JustCode opened this issue Jun 3, 2024 · 5 comments
Closed

UI hanging on Windows when multiple components are created #5338

Justyna-JustCode opened this issue Jun 3, 2024 · 5 comments

Comments

@Justyna-JustCode
Copy link
Contributor

Justyna-JustCode commented Jun 3, 2024

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:

explorer_Vi2USZyJWS.mp4

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
Copy link
Member

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
Copy link
Contributor Author

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<ref$<i_slint_core::item_tree::ItemTree_vtable_mod::ItemTreeTO> > @ 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<i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure_env$0,accesskit::NodeBuilder>(self=0x00007ff72923e390, t=enum2$<core::option::Option<core::pin::Pin<ref$<i_slint_core::properties::BindingHolder<tuple$<> > > > > > @ 0x0000000eb333a3b8, f=0x0000000eb333a520, f=0x0000000eb333a520, f=0x0000000eb333a520, f=<unavailable>) at lib.rs:265
 frame #5: 0x00007ff72885fc31 tester_slint.exe`struct accesskit::NodeBuilder i_slint_core::properties::PropertyTracker<tuple$<> >::evaluate_as_dependency_root<tuple$<>,accesskit::NodeBuilder,i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure_env$0>(self=Pin<ref$<i_slint_core::properties::PropertyTracker<tuple$<> > > > @ 0x0000000eb333a498, f=0x0000000eb333a5a0, f=0x0000000eb333a5a0, f=0x0000000eb333a5a0, f=<unavailable>) at properties.rs:1467
 frame #6: 0x00007ff7288614b4 tester_slint.exe`struct accesskit::NodeBuilder i_slint_core::properties::PropertyTracker<tuple$<> >::evaluate<tuple$<>,accesskit::NodeBuilder,i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure_env$0>(self=Pin<ref$<i_slint_core::properties::PropertyTracker<tuple$<> > > > @ 0x0000000eb333a5c0, f=0x0000000eb333a7c0, f=0x0000000eb333a7c0, f=<unavailable>) 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<tuple$<i_slint_core::item_tree::ItemRc>,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::option::Option<accesskit::NodeId> > core::iter::adapters::map::impl$2::next<accesskit::NodeId,core::iter::sources::from_fn::FromFn<i_slint_core::accessibility::accessible_descendents::closure_env$0>,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<accesskit::NodeId,alloc::alloc::Global> alloc::vec::spec_from_iter_nested::impl$0::from_iter<accesskit::NodeId,core::iter::adapters::map::Map<core::iter::sources::from_fn::FromFn<i_slint_core::accessibility::accessible_descendents::closure_env$0>,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<accesskit::NodeId,alloc::alloc::Global> alloc::vec::spec_from_iter::impl$0::from_iter<accesskit::NodeId,core::iter::adapters::map::Map<core::iter::sources::from_fn::FromFn<i_slint_core::accessibility::accessible_descendents::closure_env$0>,i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure_env$1> >(iterator=<unavailable>) at spec_from_iter.rs:33
 frame #13: 0x00007ff72887d2c7 tester_slint.exe`struct alloc::vec::Vec<accesskit::NodeId,alloc::alloc::Global> alloc::vec::impl$14::from_iter<accesskit::NodeId,core::iter::adapters::map::Map<core::iter::sources::from_fn::FromFn<i_slint_core::accessibility::accessible_descendents::closure_env$0>,i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure_env$1> >(iter=<unavailable>) at mod.rs:2894
 frame #14: 0x00007ff7288ad7c1 tester_slint.exe`struct alloc::vec::Vec<accesskit::NodeId,alloc::alloc::Global> core::iter::traits::iterator::Iterator::collect<core::iter::adapters::map::Map<core::iter::sources::from_fn::FromFn<i_slint_core::accessibility::accessible_descendents::closure_env$0>,i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure_env$1>,alloc::vec::Vec<accesskit::NodeId,alloc::alloc::Global> >(self=<unavailable>) 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<tuple$<i_slint_core::item_tree::ItemRc>,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::option::Option<accesskit::NodeId> > core::iter::adapters::map::impl$2::next<accesskit::NodeId,core::iter::sources::from_fn::FromFn<i_slint_core::accessibility::accessible_descendents::closure_env$0>,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<accesskit::NodeId,alloc::alloc::Global>::extend_desugared<accesskit::NodeId,alloc::alloc::Global,core::iter::adapters::map::Map<core::iter::sources::from_fn::FromFn<i_slint_core::accessibility::accessible_descendents::closure_env$0>,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<accesskit::NodeId,core::iter::adapters::map::Map<core::iter::sources::from_fn::FromFn<i_slint_core::accessibility::accessible_descendents::closure_env$0>,i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure_env$1>,alloc::alloc::Global>(self=(8) vec![{...}, {...}, {...}, {...}, {...}, ...], iter=<unavailable>) at spec_extend.rs:17
 frame #21: 0x00007ff7288720bd tester_slint.exe`struct alloc::vec::Vec<accesskit::NodeId,alloc::alloc::Global> alloc::vec::spec_from_iter_nested::impl$0::from_iter<accesskit::NodeId,core::iter::adapters::map::Map<core::iter::sources::from_fn::FromFn<i_slint_core::accessibility::accessible_descendents::closure_env$0>,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<accesskit::NodeId,alloc::alloc::Global> alloc::vec::spec_from_iter::impl$0::from_iter<accesskit::NodeId,core::iter::adapters::map::Map<core::iter::sources::from_fn::FromFn<i_slint_core::accessibility::accessible_descendents::closure_env$0>,i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure_env$1> >(iterator=<unavailable>) at spec_from_iter.rs:33
 frame #23: 0x00007ff72887d2c7 tester_slint.exe`struct alloc::vec::Vec<accesskit::NodeId,alloc::alloc::Global> alloc::vec::impl$14::from_iter<accesskit::NodeId,core::iter::adapters::map::Map<core::iter::sources::from_fn::FromFn<i_slint_core::accessibility::accessible_descendents::closure_env$0>,i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure_env$1> >(iter=<unavailable>) at mod.rs:2894
 frame #24: 0x00007ff7288ad7c1 tester_slint.exe`struct alloc::vec::Vec<accesskit::NodeId,alloc::alloc::Global> core::iter::traits::iterator::Iterator::collect<core::iter::adapters::map::Map<core::iter::sources::from_fn::FromFn<i_slint_core::accessibility::accessible_descendents::closure_env$0>,i_slint_backend_winit::accesskit::impl$0::build_node_for_item_recursively::closure_env$1>,alloc::vec::Vec<accesskit::NodeId,alloc::alloc::Global> >(self=<unavailable>) 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<i_slint_backend_winit::accesskit::impl$0::build_new_tree::closure_env$0,accesskit::NodeId>(self=0x00007ff72923e390, t=enum2$<core::option::Option<core::pin::Pin<ref$<i_slint_core::properties::BindingHolder<tuple$<> > > > > > @ 0x0000000eb333bd98, f=0x0000000eb333be90, f=0x0000000eb333be90, f=0x0000000eb333be90, f=<unavailable>) at lib.rs:265
 frame #28: 0x00007ff7288602cb tester_slint.exe`struct accesskit::NodeId i_slint_core::properties::PropertyTracker<i_slint_backend_winit::accesskit::AccessibilitiesPropertyTracker>::evaluate_as_dependency_root<i_slint_backend_winit::accesskit::AccessibilitiesPropertyTracker,accesskit::NodeId,i_slint_backend_winit::accesskit::impl$0::build_new_tree::closure_env$0>(self=Pin<ref$<i_slint_core::properties::PropertyTracker<i_slint_backend_winit::accesskit::AccessibilitiesPropertyTracker> > > @ 0x0000000eb333be80, f=0x0000000eb333c038, f=0x0000000eb333c038, f=0x0000000eb333c038, f=<unavailable>) 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<i_slint_backend_winit::accesskit::impl$0::register_item_tree::closure$0::closure_env$0>(adapter=0x000001479492d6b0) at subclass.rs:186
 frame #32: 0x00007ff7288eae6e tester_slint.exe`union enum2$<core::option::Option<accesskit_windows::adapter::QueuedEvents> > enum2$<core::option::Option<ref$<accesskit_windows::adapter::Adapter> > >::map<ref$<accesskit_windows::adapter::Adapter>,accesskit_windows::adapter::QueuedEvents,accesskit_windows::subclass::impl$1::update_if_active::closure_env$0<i_slint_backend_winit::accesskit::impl$0::register_item_tree::closure$0::closure_env$0> >(self=enum2$<core::option::Option<ref$<accesskit_windows::adapter::Adapter> > > @ 0x0000000eb333c2e0, f=closure_env$0<i_slint_backend_winit::accesskit::impl$0::register_item_tree::closure$0::closure_env$0> @ 0x0000000eb333c308) at option.rs:1073
 frame #33: 0x00007ff7288c575d tester_slint.exe`union enum2$<core::option::Option<accesskit_windows::adapter::QueuedEvents> > accesskit_windows::subclass::SubclassingAdapter::update_if_active<i_slint_backend_winit::accesskit::impl$0::register_item_tree::closure$0::closure_env$0>(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<i_slint_backend_winit::accesskit::impl$0::register_item_tree::closure$0::closure_env$0>(self=0x0000014794928d00, updater=closure_env$0 @ 0x0000000eb333c400) at windows.rs:43
 frame #35: 0x00007ff7288f5fa3 tester_slint.exe`void accesskit_winit::Adapter::update_if_active<i_slint_backend_winit::accesskit::impl$0::register_item_tree::closure$0::closure_env$0>(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<i_slint_backend_winit::accesskit::impl$0::register_item_tree::closure_env$0,tuple$<> >(=0x0000014796f49840, =<unavailable>) at function.rs:250
 frame #38: 0x00007ff728b97000 tester_slint.exe`void alloc::boxed::impl$47::call_once<tuple$<>,dyn$<core::ops::function::FnOnce<tuple$<>,assoc$<Output,tuple$<> > > >,alloc::alloc::Global>(struct alloc::boxed::Box<dyn$<core::ops::function::FnOnce<tuple$<>,assoc$<Output,tuple$<> > > >,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$<core::result::Result<bool,std::thread::local::AccessError> > std::thread::local::LocalKey<core::cell::RefCell<i_slint_core::timers::TimerList> >::try_with<core::cell::RefCell<i_slint_core::timers::TimerList>,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<core::cell::RefCell<i_slint_core::timers::TimerList> >::with<core::cell::RefCell<i_slint_core::timers::TimerList>,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=<unavailable>, 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<i_slint_backend_winit::event_loop::impl$6::run::closure$2::closure_env$0,tuple$<> >(self=0x00007ff729208740, t=0x0000000eb333d088, f=0x0000000eb333d098, f=0x0000000eb333d098, f=0x0000000eb333d098, f=<unavailable>) at lib.rs:265
 frame #47: 0x00007ff728896e1f tester_slint.exe`void i_slint_backend_winit::event_loop::impl$6::run::closure$2(event=<unavailable>, 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<enum2$<i_slint_backend_winit::SlintUserEvent>,i_slint_backend_winit::event_loop::impl$6::run::closure_env$2>(event=<unavailable>) at event_loop.rs:236
 frame #49: 0x00007ff7288f5cd8 tester_slint.exe`void alloc::boxed::impl$48::call_mut<tuple$<enum2$<winit::event::Event<enum2$<i_slint_backend_winit::SlintUserEvent> > > >,dyn$<core::ops::function::FnMut<tuple$<enum2$<winit::event::Event<enum2$<i_slint_backend_winit::SlintUserEvent> > > >,assoc$<Output,tuple$<> > > >,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<enum2$<i_slint_backend_winit::SlintUserEvent> >(struct winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<i_slint_backend_winit::SlintUserEvent> >) at runner.rs:250
 frame #51: 0x00007ff7288cb954 tester_slint.exe`void core::panic::unwind_safe::impl$25::call_once<tuple$<>,winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<i_slint_backend_winit::SlintUserEvent> > >(self=<unavailable>, =<unavailable>) at unwind_safe.rs:272
 frame #52: 0x00007ff72887edd4 tester_slint.exe`void 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$<i_slint_backend_winit::SlintUserEvent> > >,tuple$<> >(data="\U0000001f") at panicking.rs:552
 frame #53: 0x00007ff72888d883 tester_slint.exe
 frame #54: 0x00007ff72887e89a tester_slint.exe`union enum2$<core::result::Result<tuple$<>,alloc::boxed::Box<dyn$<core::any::Any,core::marker::Send>,alloc::alloc::Global> > > 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$<i_slint_backend_winit::SlintUserEvent> > > >(f=<unavailable>) at panicking.rs:516
 frame #55: 0x00007ff72890a639 tester_slint.exe`union enum2$<core::result::Result<tuple$<>,alloc::boxed::Box<dyn$<core::any::Any,core::marker::Send>,alloc::alloc::Global> > > 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$<i_slint_backend_winit::SlintUserEvent> > >,tuple$<> >(f=<unavailable>) at panic.rs:146
 frame #56: 0x00007ff7288aea7f tester_slint.exe`union enum2$<core::option::Option<tuple$<> > > winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<i_slint_backend_winit::SlintUserEvent> >::catch_unwind<enum2$<i_slint_backend_winit::SlintUserEvent>,tuple$<>,winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<i_slint_backend_winit::SlintUserEvent> > >(self=0x000001478f20d1c0, f=0x0000000eb333db58, f=0x0000000eb333db58, f=0x0000000eb333db58, f=0x0000000eb333db58, f=<unavailable>) at runner.rs:183
 frame #57: 0x00007ff7288b07bb tester_slint.exe`void winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<i_slint_backend_winit::SlintUserEvent> >::call_event_handler<enum2$<i_slint_backend_winit::SlintUserEvent> >(self=0x000001478f20d1c0, event=<unavailable>) at runner.rs:246
 frame #58: 0x00007ff7288b030a tester_slint.exe`void winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<i_slint_backend_winit::SlintUserEvent> >::call_new_events<enum2$<i_slint_backend_winit::SlintUserEvent> >(self=0x000001478f20d1c0, init=false) at runner.rs:368
 frame #59: 0x00007ff7288b0005 tester_slint.exe`void winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<i_slint_backend_winit::SlintUserEvent> >::move_state_to<enum2$<i_slint_backend_winit::SlintUserEvent> >(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<enum2$<i_slint_backend_winit::SlintUserEvent> >::wakeup<enum2$<i_slint_backend_winit::SlintUserEvent> >(self=0x000001478f20d1c0) at runner.rs:215
 frame #61: 0x00007ff728881777 tester_slint.exe`void winit::platform_impl::platform::event_loop::EventLoop<enum2$<i_slint_backend_winit::SlintUserEvent> >::wait_and_dispatch_message<enum2$<i_slint_backend_winit::SlintUserEvent> >(self=0x0000000eb333ec40) at event_loop.rs:390
 frame #62: 0x00007ff72888100b tester_slint.exe`union enum2$<core::result::Result<tuple$<>,enum2$<winit::error::EventLoopError> > > winit::platform_impl::platform::event_loop::EventLoop<enum2$<i_slint_backend_winit::SlintUserEvent> >::run_on_demand<enum2$<i_slint_backend_winit::SlintUserEvent>,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$<core::result::Result<tuple$<>,enum2$<winit::error::EventLoopError> > > winit::platform::run_on_demand::impl$0::run_on_demand<enum2$<i_slint_backend_winit::SlintUserEvent>,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$<core::result::Result<i_slint_backend_winit::event_loop::EventLoopState,enum2$<i_slint_core::api::PlatformError> > > i_slint_backend_winit::event_loop::EventLoopState::run(self=0x0000000eb333f0e0, self=0x0000000eb333f0e0, self=0x0000000eb333f0e0, self=0x0000000eb333f0e0, self=0x0000000eb333f0e0, self=0x0000000eb333f0e0, self=<unavailable>) at event_loop.rs:548
 frame #65: 0x00007ff72889c77c tester_slint.exe`union enum2$<core::result::Result<tuple$<>,enum2$<i_slint_core::api::PlatformError> > > 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<T>::try_with at local.rs:284
 frame #69: 0x00007ff72885586d tester_slint.exe`std::thread::local::LocalKey<T>::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$<core::result::Result<tuple$<>,enum2$<i_slint_core::api::PlatformError> > > slint::run_event_loop() at lib.rs:235
 frame #73: 0x00007ff728576c44 tester_slint.exe`union enum2$<core::result::Result<tuple$<>,enum2$<i_slint_core::api::PlatformError> > > tester_slint::app_main::slint_generatedMainWindow::impl$43::run(self=0x0000000eb333f8b0) at main.rs:5543
 frame #74: 0x00007ff72859756e tester_slint.exe`union enum2$<core::result::Result<tuple$<>,enum2$<i_slint_core::api::PlatformError> > > tester_slint::app_main::main() at app_main.rs:22
 frame #75: 0x00007ff728597451 tester_slint.exe`static union enum2$<core::result::Result<tuple$<>,enum2$<i_slint_core::api::PlatformError> > > tester_slint::main() at main.rs:5
 frame #76: 0x00007ff7285085d3 tester_slint.exe`union enum2$<core::result::Result<tuple$<>,enum2$<i_slint_core::api::PlatformError> > > core::ops::function::FnOnce::call_once<enum2$<core::result::Result<tuple$<>,enum2$<i_slint_core::api::PlatformError> > > (=(tester_slint.exe`static union enum2$<core::result::Result<tuple$<>,enum2$<i_slint_core::api::PlatformError> > > tester_slint::main() at main.rs:4), =<unavailable>)(),tuple$<> >( *) at function.rs:250
 frame #77: 0x00007ff72858a0b6 tester_slint.exe`union enum2$<core::result::Result<tuple$<>,enum2$<i_slint_core::api::PlatformError> > > std::sys_common::backtrace::__rust_begin_short_backtrace<enum2$<core::result::Result<tuple$<>,enum2$<i_slint_core::api::PlatformError> > > (f=(tester_slint.exe`static union enum2$<core::result::Result<tuple$<>,enum2$<i_slint_core::api::PlatformError> > > tester_slint::main() at main.rs:4))(),enum2$<core::result::Result<tuple$<>,enum2$<i_slint_core::api::PlatformError> > > >( *) at backtrace.rs:155
 frame #78: 0x00007ff72853e526 tester_slint.exe`int std::rt::lang_start::closure$0<enum2$<core::result::Result<tuple$<>,enum2$<i_slint_core::api::PlatformError> > > >(struct std::rt::lang_start::closure_env$0<enum2$<core::result::Result<tuple$<>,enum2$<i_slint_core::api::PlatformError> > > > *) 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$<core::result::Result<tuple$<>,enum2$<i_slint_core::api::PlatformError> > > >(main=(tester_slint.exe`static union enum2$<core::result::Result<tuple$<>,enum2$<i_slint_core::api::PlatformError> > > 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
Copy link
Member

The problem seems to be the accessibility code. Maybe the same as #5041

@Justyna-JustCode
Copy link
Contributor Author

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 😉 ).
Also, the overall performance gets much better.

@ogoffart
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants