diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2024-05-17 15:04:26 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2024-05-18 06:55:18 +0200 |
commit | 9a4f7a093bcf252edac458ed6b5411a73264fdc0 (patch) | |
tree | e99350175d64f14e49eef3d180e320ec02d2c914 /vcl | |
parent | 028ac95c0e9991b59a835527b6fed2f8d3e2bddf (diff) |
qt: Run QtFrame::SetIcon in main thread
Fixes this crash/assertion seen when starting Writer with
the qt6 VCL plugin with a fresh user profile with qtbase debug
build (as of commit 70a2e7f32b9f9ce19d1538f14fbde7b0d1e77ffd):
Thread 19 "soffice.bin" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffada006c0 (LWP 150142)]
__pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
44 ./nptl/pthread_kill.c: No such file or directory.
(gdb) bt
#0 __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
#1 0x00007ffff78a6b7f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#2 0x00007ffff78584e2 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3 0x00007ffff78414ed in __GI_abort () at ./stdlib/abort.c:79
#4 0x00007fffe34f95c9 in qAbort() () at /home/michi/development/git/qt5/qtbase/src/corelib/global/qassert.cpp:49
#5 0x00007fffe350d459 in qt_message_fatal<QString&>(QtMsgType, QMessageLogContext const&, QString&) (context=..., message=...) at /home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:2112
#6 0x00007fffe35063e6 in qt_message(QtMsgType, const QMessageLogContext &, const char *, typedef __va_list_tag __va_list_tag *)
(msgType=QtFatalMsg, context=..., msg=0x7fffe3b8afa8 "ASSERT failure in %s: \"%s\", file %s, line %d", ap=0x7fffad9faab8) at /home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:380
#7 0x00007fffe35084b1 in QMessageLogger::fatal(char const*, ...) const (this=0x7fffad9fad00, msg=0x7fffe3b8afa8 "ASSERT failure in %s: \"%s\", file %s, line %d")
at /home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:880
#8 0x00007fffe34f969c in qt_assert_x(char const*, char const*, char const*, int)
(where=0x7fffe3bae469 "QCoreApplication::sendEvent", what=0x7fff9d691f60 "Cannot send events to objects owned by a different thread. Current thread 0x0x7fff9c456670. Receiver 'QtMainWindowClassWindow' (of type 'QWidgetWindow') was created in thread 0x0x55555560dc60", file=0x7fffe3bae098 "/home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp", line=547) at /home/michi/development/git/qt5/qtbase/src/corelib/global/qassert.cpp:114
#9 0x00007fffe35f54e6 in QCoreApplicationPrivate::checkReceiverThread(QObject*) (receiver=0x55555bb8a180) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:547
#10 0x00007fffe15a786e in QApplication::notify(QObject*, QEvent*) (this=0x55555560d9e0, receiver=0x55555bb8a180, e=0x7fffad9fb120) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:2580
#11 0x00007fffe35f68be in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x55555bb8a180, event=0x7fffad9fb120) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1154
#12 0x00007fffe35f7677 in QCoreApplication::sendEvent(QObject*, QEvent*) (receiver=0x55555bb8a180, event=0x7fffad9fb120) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1598
#13 0x00007fffe24f74d0 in QWindow::setIcon(QIcon const&) (this=0x55555bb8a180, icon=...) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindow.cpp:1094
#14 0x00007fffe165564d in QWidgetPrivate::setWindowIcon_sys() (this=0x55555b24b370) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:6208
#15 0x00007fffe1655598 in QWidget::setWindowIcon(QIcon const&) (this=0x55555735d7a0, icon=...) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:6198
#16 0x00007fffe42362a9 in QtFrame::SetIcon(unsigned short) (this=0x55555bba7d30, nIcon=4) at vcl/qt6/../qt5/QtFrame.cxx:378
#17 0x00007fffee0a2aa6 in SystemWindow::SetIcon(unsigned short) (this=0x7fff9d68a7c0, nIcon=4) at /home/michi/development/git/libreoffice/vcl/source/window/syswin.cxx:332
#18 0x00007ffff4c843f1 in framework::TitleBarUpdate::impl_updateIcon(com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&)
(this=0x7fff9c452fe0, xFrame=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x7fff9d68c690) at /home/michi/development/git/libreoffice/framework/source/helper/titlebarupdate.cxx:278
#19 0x00007ffff4c831c2 in framework::TitleBarUpdate::impl_forceUpdate() (this=0x7fff9c452fe0) at /home/michi/development/git/libreoffice/framework/source/helper/titlebarupdate.cxx:214
#20 0x00007ffff4c8304b in framework::TitleBarUpdate::frameAction(com::sun::star::frame::FrameActionEvent const&) (this=0x7fff9c452fe0, aEvent=...) at /home/michi/development/git/libreoffice/framework/source/helper/titlebarupdate.cxx:95
#21 0x00007ffff4e25397 in (anonymous namespace)::XFrameImpl::implts_sendFrameActionEvent(com::sun::star::frame::FrameAction const&)
(this=0x7fff9d68c620, aAction=@0x7ffff4a01f68: com::sun::star::frame::FrameAction::FrameAction_COMPONENT_ATTACHED) at /home/michi/development/git/libreoffice/framework/source/services/frame.cxx:2960
#22 0x00007ffff4e1df33 in (anonymous namespace)::XFrameImpl::setComponent(com::sun::star::uno::Reference<com::sun::star::awt::XWindow> const&, com::sun::star::uno::Reference<com::sun::star::frame::XController> const&)
(this=0x7fff9d68c620, xComponentWindow=uno::Reference to (VCLXContainer *) 0x7fff9dd02cd0, xController=uno::Reference to (ScTabViewObj *) 0x7fff9d8d82d8)
at /home/michi/development/git/libreoffice/framework/source/services/frame.cxx:1552
#23 0x00007ffff40291b3 in utl::ConnectFrameControllerModel(com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, com::sun::star::uno::Reference<com::sun::star::frame::XController2> const&, com::sun::star::uno::Reference<com::sun::star::frame::XModel> const&)
(xFrame=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x7fff9d68c690, xController=uno::Reference to (ScTabViewObj *) 0x7fff9d8d82d8, xModel=uno::Reference to (ScModelObj *) 0x7fff9c471680) at include/unotools/fcm.hxx:45
#24 0x00007ffff402551a in (anonymous namespace)::SfxFrameLoader_Impl::impl_createDocumentView(com::sun::star::uno::Reference<com::sun::star::frame::XModel2> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, comphelper::NamedValueCollection const&, rtl::OUString const&)
(i_rModel=uno::Reference to (ScModelObj *) 0x7fff9c471680, i_rFrame=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x7fff9d68c690, i_rViewFactoryArgs=..., i_rViewName="Default")
at /home/michi/development/git/libreoffice/sfx2/source/view/frmload.cxx:584
#25 0x00007ffff402272f in (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&)
(this=0x7fff9c451600, rArgs=uno::Sequence of length 11 = {...}, _rTargetFrame=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x7fff9d68c690) at /home/michi/development/git/libreoffice/sfx2/source/view/frmload.cxx:759
#26 0x00007ffff4dd7b61 in framework::LoadEnv::impl_loadContent() (this=0x7fffad9fcbb8) at /home/michi/development/git/libreoffice/framework/source/loadenv/loadenv.cxx:1176
#27 0x00007ffff4dd48e4 in framework::LoadEnv::start() (this=0x7fffad9fcbb8) at /home/michi/development/git/libreoffice/framework/source/loadenv/loadenv.cxx:412
#28 0x00007ffff4dd21b2 in framework::LoadEnv::startLoading(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, rtl::OUString const&, int, LoadEnvFeatures)
(this=0x7fffad9fcbb8, sURL="file:///home/michi/development/git/libreoffice/instdir/program/../program/opencl/cl-test.ods", lMediaDescriptor=uno::Sequence of length 1 = {...}, xBaseFrame=uno::Reference to (framework::Desktop *) 0x5555569ad308, sTarget="_blank", nSearchFlags=0, eFeature=LoadEnvFeatures::NONE) at /home/michi/development/git/libreoffice/framework/source/loadenv/loadenv.cxx:308
#29 0x00007ffff4dd0998 in framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference<com::sun::star::frame::XComponentLoader> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)
(xLoader=uno::Reference to (framework::Desktop *) 0x5555569ad318, xContext=uno::Reference to (cppu::(anonymous namespace)::ComponentContext *) 0x555555623d48, sURL="file:///home/michi/development/git/libreoffice/instdir/program/../program/opencl/cl-test.ods", sTarget="_blank", nSearchFlags=0, lArgs=uno::Sequence of length 1 = {...}) at /home/michi/development/git/libreoffice/framework/source/loadenv/loadenv.cxx:168
#30 0x00007ffff4e06a3f in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)
(this=0x5555569ad2a0, sURL="file:///home/michi/development/git/libreoffice/instdir/program/../program/opencl/cl-test.ods", sTargetFrameName="_blank", nSearchFlags=0, lArguments=uno::Sequence of length 1 = {...})
at /home/michi/development/git/libreoffice/framework/source/services/desktop.cxx:592
#31 0x00007ffff4e06b34 in non-virtual thunk to framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) ()
at /home/michi/development/git/libreoffice/instdir/program/libfwklo.so
#32 0x00007ffff7ba9147 in desktop::testOpenCLCompute(com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> const&, rtl::OUString const&)
(xDesktop=uno::Reference to (framework::Desktop *) 0x5555569ad2f8, rURL="file:///home/michi/development/git/libreoffice/instdir/program/../program/opencl/cl-test.ods")
at /home/michi/development/git/libreoffice/desktop/source/app/opencl.cxx:132
#33 0x00007ffff7ba7f54 in desktop::Desktop::CheckOpenCLCompute(com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> const&) (xDesktop=uno::Reference to (framework::Desktop *) 0x5555569ad2f8)
--Type <RET> for more, q to quit, c to continue without paging--
at /home/michi/development/git/libreoffice/desktop/source/app/opencl.cxx:241
#34 0x00007ffff7b5719d in std::__invoke_impl<void, void (*)(com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> const&), com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> >(std::__invoke_other, void (*&&)(com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> const&), com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2>&&)
(__f=@0x5555573c20b0: 0x7ffff7ba7760 <desktop::Desktop::CheckOpenCLCompute(com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> const&)>, __args=...)
at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:61
#35 0x00007ffff7b5712d in std::__invoke<void (*)(com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> const&), com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> >(void (*&&)(com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> const&), com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2>&&)
(__fn=@0x5555573c20b0: 0x7ffff7ba7760 <desktop::Desktop::CheckOpenCLCompute(com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> const&)>, __args=...)
at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:96
#36 0x00007ffff7b57102 in std::thread::_Invoker<std::tuple<void (*)(com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> const&), com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> > >::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) (this=0x5555573c20a8) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_thread.h:292
#37 0x00007ffff7b570c5 in std::thread::_Invoker<std::tuple<void (*)(com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> const&), com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> > >::operator()()
(this=0x5555573c20a8) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_thread.h:299
#38 0x00007ffff7b56e69 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)(com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> const&), com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> > > >::_M_run() (this=0x5555573c20a0) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_thread.h:244
#39 0x00007ffff74dee24 in () at /lib/x86_64-linux-gnu/libstdc++.so.6
#40 0x00007ffff78a4dbb in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:444
#41 0x00007ffff79269f8 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
Change-Id: Ic611eb26b140c060cba4d81603e506806cf43bab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167778
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/qt5/QtFrame.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/vcl/qt5/QtFrame.cxx b/vcl/qt5/QtFrame.cxx index d4a43fc7a544..7c1ff38cb8cd 100644 --- a/vcl/qt5/QtFrame.cxx +++ b/vcl/qt5/QtFrame.cxx @@ -350,6 +350,14 @@ void QtFrame::SetTitle(const OUString& rTitle) void QtFrame::SetIcon(sal_uInt16 nIcon) { + QtInstance* pSalInst(GetQtInstance()); + assert(pSalInst); + if (!pSalInst->IsMainThread()) + { + pSalInst->RunInMainThread([this, nIcon]() { SetIcon(nIcon); }); + return; + } + if (m_nStyle & (SalFrameStyleFlags::PLUG | SalFrameStyleFlags::SYSTEMCHILD | SalFrameStyleFlags::FLOAT | SalFrameStyleFlags::INTRO |