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

thread 'main' panicked at 'invalid key' #3212

Closed heng30 closed 1 year ago

heng30 commented 1 year ago

System: ArchLinux Language: Rust

I can't provide a slint demo, because I don't know which component causes the app crashed. There has a low probability of crashing when I constantly click on the UI or press control key. Here is the rust backtrace:

thread 'main' panicked at 'invalid key', /home/blue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/i-slint-core-1.1.0/timers.rs:244:37
stack backtrace:
   0:     0x556f8e9af97a - std::backtrace_rs::backtrace::libunwind::trace::h9a6b80bbf328ba5d
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x556f8e9af97a - std::backtrace_rs::backtrace::trace_unsynchronized::hd162ec543a11886b
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x556f8e9af97a - std::sys_common::backtrace::_print_fmt::h78a5099be12f51a6
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x556f8e9af97a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::ha1c5390454d74f71
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x556f8e9d9b9f - core::fmt::write::h9ffde816c577717b
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/fmt/mod.rs:1254:17
   5:     0x556f8e9ab0c5 - std::io::Write::write_fmt::h88186074961638e4
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/io/mod.rs:1698:15
   6:     0x556f8e9af745 - std::sys_common::backtrace::_print::h184198273ed08d59
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x556f8e9af745 - std::sys_common::backtrace::print::h1b4d8e7add699453
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x556f8e9b0dee - std::panicking::default_hook::{{closure}}::h393bcea75423915a
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:269:22
   9:     0x556f8e9b0b95 - std::panicking::default_hook::h48c64f31d8b3fd03
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:288:9
  10:     0x556f8e9b134e - std::panicking::rust_panic_with_hook::hafdc493a79370062
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:691:13
  11:     0x556f8e6173ba - std::panicking::begin_panic::{{closure}}::h461fe166d68f1b2d
  12:     0x556f8e617386 - std::sys_common::backtrace::__rust_end_short_backtrace::h11fe22418f063a87
  13:     0x556f8d909f8a - std::panicking::begin_panic::h9906c973e2af850c
  14:     0x556f8e6209ac - std::thread::local::LocalKey<T>::with::h09bfeca88fe0ea26
  15:     0x556f8e61e9d3 - i_slint_core::platform::update_timers_and_animations::h1633b91fc798277b
  16:     0x556f8e5bac1e - i_slint_backend_qt::qt_window::timer_event::h534020119c4be294
  17:     0x7fd2342b1c26 - _ZN7QObject5eventEP6QEvent
  18:     0x7fd233178b5c - _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent
  19:     0x7fd23428e028 - _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent
  20:     0x7fd2342d8583 - _ZN14QTimerInfoList14activateTimersEv
  21:     0x7fd2342d8bc2 - <unknown>
  22:     0x7fd23290f53b - g_main_context_dispatch
  23:     0x7fd23296c219 - <unknown>
  24:     0x7fd23290e1a2 - g_main_context_iteration
  25:     0x7fd2342d8d3c - _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE
  26:     0x7fd23428668c - _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE
  27:     0x7fd2342912f9 - _ZN16QCoreApplication4execEv
  28:     0x556f8e5c2aef - <i_slint_backend_qt::Backend as i_slint_core::platform::Platform>::run_event_loop::h561be21d4f21c0f2
  29:     0x556f8dff7aee - std::thread::local::LocalKey<T>::with::hec8366305bc82c76
  30:     0x556f8dff7830 - slint::run_event_loop::hd7c56a27b58d0f56
  31:     0x556f8dbe7880 - <chatbox::slint_generatedAppWindow::AppWindow as i_slint_core::api::ComponentHandle>::run::h682917e606e95cc5
  32:     0x556f8dd94f5e - tokio::runtime::park::CachedParkThread::block_on::hcd407a162eb62a6e
  33:     0x556f8ddba008 - tokio::runtime::scheduler::multi_thread::MultiThread::block_on::h957bda7d369e65b7
  34:     0x556f8dc8bc16 - tokio::runtime::runtime::Runtime::block_on::h097a84da86ae3278
  35:     0x556f8dda9e01 - chatbox::main::ha7290733633d3816
  36:     0x556f8ddc23a3 - std::sys_common::backtrace::__rust_begin_short_backtrace::ha9e86ce762e6ae0a
  37:     0x556f8dd840a9 - std::rt::lang_start::{{closure}}::ha5b54872c845e809
  38:     0x556f8e9a50ae - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::hb1327dc2ef3fecdf
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/ops/function.rs:287:13
  39:     0x556f8e9a50ae - std::panicking::try::do_call::h4044173225fe83dd
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:485:40
  40:     0x556f8e9a50ae - std::panicking::try::hd8a722c09d156a53
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:449:19
  41:     0x556f8e9a50ae - std::panic::catch_unwind::hd2ca07971cf0119b
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panic.rs:140:14
  42:     0x556f8e9a50ae - std::rt::lang_start_internal::{{closure}}::h26d89d595cf47b70
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/rt.rs:148:48
  43:     0x556f8e9a50ae - std::panicking::try::do_call::hf47aa1aa005e5f1a
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:485:40
  44:     0x556f8e9a50ae - std::panicking::try::h73d246b2423eaf4e
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:449:19
  45:     0x556f8e9a50ae - std::panic::catch_unwind::hbaaeae8f1b2f9915
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panic.rs:140:14
  46:     0x556f8e9a50ae - std::rt::lang_start_internal::h76f3e81e6b8f13f9
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/rt.rs:148:20
  47:     0x556f8dda9ec5 - main
  48:     0x7fd232e3c790 - <unknown>
  49:     0x7fd232e3c84a - __libc_start_main
  50:     0x556f8d921be5 - _start
  51:                0x0 - <unknown>
Qt has caught an exception thrown from an event handler. Throwing
exceptions from an event handler is not supported in Qt.
You must not let any exception whatsoever propagate through Qt code.
If that is not possible, in Qt 5 you must at least reimplement
QCoreApplication::notify() and catch all exceptions there.
ogoffart commented 1 year ago

Thanks for reporting a bug. Please try again with Slint 1.1.1 I think that's related to #3019

heng30 commented 1 year ago

Thanks for your reply, I will update to Slint 1.1.1.

hunger commented 1 year ago

@Heng30: Does it work with Slint 1.1.1? We can close this issue if so :-)