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

Fix building against MySQL Connector/C 8 #20

Closed

Conversation

Peter-Levine
Copy link
Contributor

In MySQL Connector/C 8, my_bool is replaced by bool. It was previously defined as char. When building against MySQL Connector/C 8, this leads to errors such as:

var/tmp/portage/app-office/libreoffice-6.3.0.4/work/libreoffice-6.3.0.4/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx: In member function ‘virtual sal_Bool connectivity::mysqlc::OPreparedResultSet::next()’:
/var/tmp/portage/app-office/libreoffice-6.3.0.4/work/libreoffice-6.3.0.4/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx:635:30: error: cannot convert ‘char*’ to ‘bool*’ in assignment
  635 |         m_aData[i].is_null = &m_aMetaData[i].is_null;
      |                              ^~~~~~~~~~~~~~~~~~~~~~~
      |                              |
      |                              char*
/var/tmp/portage/app-office/libreoffice-6.3.0.4/work/libreoffice-6.3.0.4/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx:638:28: error: cannot convert ‘char*’ to ‘bool*’ in assignment
  638 |         m_aData[i].error = &m_aMetaData[i].error;
      |                            ^~~~~~~~~~~~~~~~~~~~~
      |                            |
      |                            char*
make[1]: *** [/var/tmp/portage/app-office/libreoffice-6.3.0.4/work/libreoffice-6.3.0.4/solenv/gbuild/LinkTarget.mk:293: /var/tmp/portage/app-office/libreoffice-6.3.0.4/work/libreoffice-6.3.0.4/workdir/CxxObject/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.o] Error 1

This commit fixes that error by redefining affected members of struct BindMetaData as bool if using version 8 of greater. Otherwise, they default to char.

Change the type of BindMetaData::is_null and BindMetaData::error with bool if building against MySQL Connector/C 8.
@smehrbrodt
Copy link
Contributor

Can you push this patch to gerrit please?
https://wiki.documentfoundation.org/Development/gerrit

@Peter-Levine
Copy link
Contributor Author

@Peter-Levine Peter-Levine deleted the mysql-connector-c-8 branch October 18, 2019 05:41
tdf-gerrit pushed a commit that referenced this pull request Dec 10, 2019
including one from comment #20 and one from comment #34

Change-Id: I7d3ded6d986a548d7a9c88f0036e734b4b5ccb87
Reviewed-on: https://gerrit.libreoffice.org/84604
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
tdf-gerrit pushed a commit that referenced this pull request Dec 10, 2019
including one from comment #20 and one from comment #34

Change-Id: I7d3ded6d986a548d7a9c88f0036e734b4b5ccb87
Reviewed-on: https://gerrit.libreoffice.org/84604
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
(cherry picked from commit 55204db)
Reviewed-on: https://gerrit.libreoffice.org/84804
tdf-gerrit pushed a commit that referenced this pull request Dec 16, 2019
Unfortunately, this isn't fully functional, but
didn't want to lose the effort. The problem is
that there is no proper config for languages
in the unit-tests. So even when we set the
language explicitly, it still doesn't apply
to the SpellCheckerDispatcher, which is
where it matters. This seems to be because
the config is not properly propagated and
broadcast. Below is the stacktrace as
works on desktop. During the unittest
the Broadcaster has no change listener
for LngSvcMgr, so SpellCheckerDispatcher::SetServiceList
doesn't get called.

 #0  0x00007f47f3fed7e6 in SpellCheckerDispatcher::SetServiceList(com::sun::star::lang::Locale const&, com::sun::star::uno::Sequence<rtl::OUString> const&)
     (this=0x5589de40e7a0, rLocale=..., rSvcImplNames=uno::Sequence of length 1 = {...}) at /home/ash/prj/master/linguistic/source/spelldsp.cxx:795
 #1  0x00007f47f3fcc0ad in LngSvcMgr::Notify(com::sun::star::uno::Sequence<rtl::OUString> const&) (this=0x5589de43b4e0, rPropertyNames=uno::Sequence of length 4 = {...})
     at /home/ash/prj/master/linguistic/source/lngsvcmgr.cxx:826
 #2  0x00007f47fa2d3c8d in utl::ConfigItem::CallNotify(com::sun::star::uno::Sequence<rtl::OUString> const&) (this=0x5589de43b530, rPropertyNames=uno::Sequence of length 4 = {...})
     at /home/ash/prj/master/unotools/source/config/configitem.cxx:181
 #3  0x00007f47fa2d3946 in utl::ConfigChangeListener_Impl::changesOccurred(com::sun::star::util::ChangesEvent const&) (this=0x5589de464b90, rEvent=...)
     at /home/ash/prj/master/unotools/source/config/configitem.cxx:143
 #4  0x00007f47e273bb61 in configmgr::Broadcaster::send() (this=0x7ffcc604c5b0) at /home/ash/prj/master/configmgr/source/broadcaster.cxx:182
 #5  0x00007f47e277f002 in configmgr::RootAccess::commitChanges() (this=0x5589dd557400) at /home/ash/prj/master/configmgr/source/rootaccess.cxx:171
 #6  0x00007f47fa2d80e3 in utl::ConfigItem::ReplaceSetProperties(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)
     (this=0x5589dd5571b0, rNode="ServiceManager/SpellCheckerList", rValues=uno::Sequence of length 4 = {...}) at /home/ash/prj/master/unotools/source/config/configitem.cxx:1025
 #7  0x00007f47fa339983 in SvtLinguConfig::ReplaceSetProperties(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)
     (this=0x7ffcc604cb40, rNode="ServiceManager/SpellCheckerList", rValues=uno::Sequence of length 4 = {...}) at /home/ash/prj/master/unotools/source/config/lingucfg.cxx:847
 #8  0x00007f47f3fcb88f in LngSvcMgr::UpdateAll() (this=0x5589de43b4e0) at /home/ash/prj/master/linguistic/source/lngsvcmgr.cxx:765
 #9  0x00007f47f3fc9caa in LngSvcMgr::LngSvcMgr() (this=0x5589de43b4e0) at /home/ash/prj/master/linguistic/source/lngsvcmgr.cxx:438
 #10 0x00007f47f3fd3baf in LngSvcMgr_CreateInstance(com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> const&) ()
     at /home/ash/prj/master/linguistic/source/lngsvcmgr.cxx:1967
 #11 0x00007f4800e9656b in cppu::OSingleFactoryHelper::createInstanceEveryTime(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) (this=0x5589de3ccfc8, xContext=
     uno::Reference to (cppu::ComponentContext *) 0x5589dbcca630) at /home/ash/prj/master/cppuhelper/source/factory.cxx:149
 #12 0x00007f4800e96790 in cppu::OSingleFactoryHelper::createInstanceWithContext(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&)
     (this=0x5589de3ccfc8, xContext=uno::Reference to (cppu::ComponentContext *) 0x5589dbcca630) at /home/ash/prj/master/cppuhelper/source/factory.cxx:175
 #13 0x00007f4800e97107 in cppu::OFactoryComponentHelper::createInstanceWithContext(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&)
     (this=0x5589de3ccf60, xContext=uno::Reference to (cppu::ComponentContext *) 0x5589dbcca630) at /home/ash/prj/master/cppuhelper/source/factory.cxx:374
 #14 0x00007f4800eebc8f in cppuhelper::ServiceManager::Data::Implementation::createInstance(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, bool)
     (this=0x5589dbd2f030, context=uno::Reference to (cppu::ComponentContext *) 0x5589dbcca630, singletonRequest=false) at /home/ash/prj/master/cppuhelper/source/servicemanager.cxx:667
 #15 0x00007f4800eee587 in cppuhelper::ServiceManager::createInstanceWithContext(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&)
     (this=0x5589dbcbaaf0, aServiceSpecifier="com.sun.star.linguistic2.LinguServiceManager", Context=uno::Reference to (cppu::ComponentContext *) 0x5589dbcca630)
     at /home/ash/prj/master/cppuhelper/source/servicemanager.cxx:991
 #16 0x00007f4800776778 in com::sun::star::linguistic2::LinguServiceManager::create(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&)
     (the_context=uno::Reference to (cppu::ComponentContext *) 0x5589dbcca630)
     at /home/ash/prj/master/workdir/UnoApiHeadersTarget/offapi/normal/com/sun/star/linguistic2/LinguServiceManager.hpp:38
 #17 0x00007f4800772d51 in GetLngSvcMgr_Impl() () at /home/ash/prj/master/editeng/source/misc/unolingu.cxx:66
 #18 0x00007f4800773449 in SpellDummy_Impl::GetSpell_Impl() (this=0x5589dd82f420) at /home/ash/prj/master/editeng/source/misc/unolingu.cxx:217
 #19 0x00007f4800773614 in SpellDummy_Impl::isValid(rtl::OUString const&, short, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)
     (this=0x5589dd82f420, rWord="a", nLanguage=1033, rProperties=empty uno::Sequence) at /home/ash/prj/master/editeng/source/misc/unolingu.cxx:249
 #20 0x00007f48006ae4c2 in ImpEditEngine::DoOnlineSpelling(ContentNode*, bool, bool) (this=0x5589de195060, pThisNodeOnly=0x0, bSpellAtCursorPos=false, bInterruptible=true)
     at /home/ash/prj/master/editeng/source/editeng/impedit4.cxx:2306
 #21 0x00007f480067d0d2 in ImpEditEngine::OnlineSpellHdl(Timer*) (this=0x5589de195060) at /home/ash/prj/master/editeng/source/editeng/impedit3.cxx:322

Change-Id: Iffef03502c78311427aa8883739678120cc84931
(cherry picked from commit 4f77bd94028a140133814d735c0425bbd0de4839)
Reviewed-on: https://gerrit.libreoffice.org/85007
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
tdf-gerrit pushed a commit that referenced this pull request Dec 23, 2019
Unfortunately, this isn't fully functional, but
didn't want to lose the effort. The problem is
that there is no proper config for languages
in the unit-tests. So even when we set the
language explicitly, it still doesn't apply
to the SpellCheckerDispatcher, which is
where it matters. This seems to be because
the config is not properly propagated and
broadcast. Below is the stacktrace as
works on desktop. During the unittest
the Broadcaster has no change listener
for LngSvcMgr, so SpellCheckerDispatcher::SetServiceList
doesn't get called.

 #0  0x00007f47f3fed7e6 in SpellCheckerDispatcher::SetServiceList(com::sun::star::lang::Locale const&, com::sun::star::uno::Sequence<rtl::OUString> const&)
     (this=0x5589de40e7a0, rLocale=..., rSvcImplNames=uno::Sequence of length 1 = {...}) at /home/ash/prj/master/linguistic/source/spelldsp.cxx:795
 #1  0x00007f47f3fcc0ad in LngSvcMgr::Notify(com::sun::star::uno::Sequence<rtl::OUString> const&) (this=0x5589de43b4e0, rPropertyNames=uno::Sequence of length 4 = {...})
     at /home/ash/prj/master/linguistic/source/lngsvcmgr.cxx:826
 #2  0x00007f47fa2d3c8d in utl::ConfigItem::CallNotify(com::sun::star::uno::Sequence<rtl::OUString> const&) (this=0x5589de43b530, rPropertyNames=uno::Sequence of length 4 = {...})
     at /home/ash/prj/master/unotools/source/config/configitem.cxx:181
 #3  0x00007f47fa2d3946 in utl::ConfigChangeListener_Impl::changesOccurred(com::sun::star::util::ChangesEvent const&) (this=0x5589de464b90, rEvent=...)
     at /home/ash/prj/master/unotools/source/config/configitem.cxx:143
 #4  0x00007f47e273bb61 in configmgr::Broadcaster::send() (this=0x7ffcc604c5b0) at /home/ash/prj/master/configmgr/source/broadcaster.cxx:182
 #5  0x00007f47e277f002 in configmgr::RootAccess::commitChanges() (this=0x5589dd557400) at /home/ash/prj/master/configmgr/source/rootaccess.cxx:171
 #6  0x00007f47fa2d80e3 in utl::ConfigItem::ReplaceSetProperties(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)
     (this=0x5589dd5571b0, rNode="ServiceManager/SpellCheckerList", rValues=uno::Sequence of length 4 = {...}) at /home/ash/prj/master/unotools/source/config/configitem.cxx:1025
 #7  0x00007f47fa339983 in SvtLinguConfig::ReplaceSetProperties(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)
     (this=0x7ffcc604cb40, rNode="ServiceManager/SpellCheckerList", rValues=uno::Sequence of length 4 = {...}) at /home/ash/prj/master/unotools/source/config/lingucfg.cxx:847
 #8  0x00007f47f3fcb88f in LngSvcMgr::UpdateAll() (this=0x5589de43b4e0) at /home/ash/prj/master/linguistic/source/lngsvcmgr.cxx:765
 #9  0x00007f47f3fc9caa in LngSvcMgr::LngSvcMgr() (this=0x5589de43b4e0) at /home/ash/prj/master/linguistic/source/lngsvcmgr.cxx:438
 #10 0x00007f47f3fd3baf in LngSvcMgr_CreateInstance(com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> const&) ()
     at /home/ash/prj/master/linguistic/source/lngsvcmgr.cxx:1967
 #11 0x00007f4800e9656b in cppu::OSingleFactoryHelper::createInstanceEveryTime(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) (this=0x5589de3ccfc8, xContext=
     uno::Reference to (cppu::ComponentContext *) 0x5589dbcca630) at /home/ash/prj/master/cppuhelper/source/factory.cxx:149
 #12 0x00007f4800e96790 in cppu::OSingleFactoryHelper::createInstanceWithContext(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&)
     (this=0x5589de3ccfc8, xContext=uno::Reference to (cppu::ComponentContext *) 0x5589dbcca630) at /home/ash/prj/master/cppuhelper/source/factory.cxx:175
 #13 0x00007f4800e97107 in cppu::OFactoryComponentHelper::createInstanceWithContext(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&)
     (this=0x5589de3ccf60, xContext=uno::Reference to (cppu::ComponentContext *) 0x5589dbcca630) at /home/ash/prj/master/cppuhelper/source/factory.cxx:374
 #14 0x00007f4800eebc8f in cppuhelper::ServiceManager::Data::Implementation::createInstance(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, bool)
     (this=0x5589dbd2f030, context=uno::Reference to (cppu::ComponentContext *) 0x5589dbcca630, singletonRequest=false) at /home/ash/prj/master/cppuhelper/source/servicemanager.cxx:667
 #15 0x00007f4800eee587 in cppuhelper::ServiceManager::createInstanceWithContext(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&)
     (this=0x5589dbcbaaf0, aServiceSpecifier="com.sun.star.linguistic2.LinguServiceManager", Context=uno::Reference to (cppu::ComponentContext *) 0x5589dbcca630)
     at /home/ash/prj/master/cppuhelper/source/servicemanager.cxx:991
 #16 0x00007f4800776778 in com::sun::star::linguistic2::LinguServiceManager::create(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&)
     (the_context=uno::Reference to (cppu::ComponentContext *) 0x5589dbcca630)
     at /home/ash/prj/master/workdir/UnoApiHeadersTarget/offapi/normal/com/sun/star/linguistic2/LinguServiceManager.hpp:38
 #17 0x00007f4800772d51 in GetLngSvcMgr_Impl() () at /home/ash/prj/master/editeng/source/misc/unolingu.cxx:66
 #18 0x00007f4800773449 in SpellDummy_Impl::GetSpell_Impl() (this=0x5589dd82f420) at /home/ash/prj/master/editeng/source/misc/unolingu.cxx:217
 #19 0x00007f4800773614 in SpellDummy_Impl::isValid(rtl::OUString const&, short, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)
     (this=0x5589dd82f420, rWord="a", nLanguage=1033, rProperties=empty uno::Sequence) at /home/ash/prj/master/editeng/source/misc/unolingu.cxx:249
 #20 0x00007f48006ae4c2 in ImpEditEngine::DoOnlineSpelling(ContentNode*, bool, bool) (this=0x5589de195060, pThisNodeOnly=0x0, bSpellAtCursorPos=false, bInterruptible=true)
     at /home/ash/prj/master/editeng/source/editeng/impedit4.cxx:2306
 #21 0x00007f480067d0d2 in ImpEditEngine::OnlineSpellHdl(Timer*) (this=0x5589de195060) at /home/ash/prj/master/editeng/source/editeng/impedit3.cxx:322

Change-Id: Iffef03502c78311427aa8883739678120cc84931
(cherry picked from commit 4f77bd94028a140133814d735c0425bbd0de4839)
Reviewed-on: https://gerrit.libreoffice.org/85007
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
(cherry picked from commit 66c1f6b)
Reviewed-on: https://gerrit.libreoffice.org/85683
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
tdf-gerrit pushed a commit that referenced this pull request Mar 24, 2020
...before the destruction of the

  std::unique_ptr<SbxAppData> xSbxAppData;

member during the destruction of BasicDLLImpl can set that
BasicDLLImpl::xSbxAppData to null.  Because the destruction of
SbxAppData::m_aGlobErr may call into SbxValue::Put -> SbxBase::GetError ->
GetSbxData_Impl, which would recursively access that

  return *BasicDLLImpl::BASIC_DLL->xSbxAppData;

This causes problems with libc++ (i.e., on macOS), where ~std::unique_ptr sets
its internal pointer to null before calling the destructor of the pointed-to
object.  Whereas it happens to not cause problems with e.g. libstdc++, where
~std::unique_ptr calls the destructor of the pointed-to object first before
setting the pointer to null.

The problem showed up with <https://gerrit.libreoffice.org/c/core/+/85017/14>
"VBA Err object raise method TestCases", where CppunitTest_basic_macros kept
failing on macOS with

> * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
>     frame #0: 0x00000001119f18e7 libsblo.dylib`SbxValue::Put(this=0x000000014c1cff00, rVal=0x00007ffeefbf1218) + 55 at basic/source/sbx/sbxvalue.cxx:414
>    411 	bool SbxValue::Put( const SbxValues& rVal )
>    412 	{
>    413 	    bool bRes = false;
> -> 414 	    ErrCode eOld = GetError();
>    415 	    if( eOld != ERRCODE_NONE )
>    416 	        ResetError();
>    417 	    if( !CanWrite() )
> Target 0: (cppunittester) stopped.
> (lldb) bt
> * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
>   * frame #0: 0x00000001119f18e7 libsblo.dylib`SbxValue::Put(this=0x000000014c1cff00, rVal=0x00007ffeefbf1218) + 55 at basic/source/sbx/sbxvalue.cxx:414
>     frame #1: 0x00000001119f2399 libsblo.dylib`SbxValue::Clear(this=0x000000014c1cff00) + 553 at basic/source/sbx/sbxvalue.cxx:176
>     frame #2: 0x00000001119f20d0 libsblo.dylib`SbxValue::~SbxValue(this=0x000000014c1cff00, vtt=0x0000000111a2af70) + 80 at basic/source/sbx/sbxvalue.cxx:139
>     frame #3: 0x00000001119f825d libsblo.dylib`SbxVariable::~SbxVariable(this=0x000000014c1cff00, vtt=0x0000000111a2af68) + 381 at basic/source/sbx/sbxvar.cxx:125
>     frame #4: 0x00000001119e619a libsblo.dylib`SbxProperty::~SbxProperty(this=0x000000014c1cff00, vtt=0x0000000111a2af60) + 42 at basic/source/sbx/sbxobj.cxx:861
>     frame #5: 0x000000011188ce81 libsblo.dylib`SbUnoProperty::~SbUnoProperty(this=0x000000014c1cff00, vtt=0x0000000111a2af58) + 97 at basic/source/classes/sbunoobj.cxx:2591
>     frame #6: 0x000000011188ceb3 libsblo.dylib`SbUnoProperty::~SbUnoProperty(this=0x000000014c1cff00) + 35 at basic/source/classes/sbunoobj.cxx:2591
>     frame #7: 0x000000011188cf0c libsblo.dylib`SbUnoProperty::~SbUnoProperty(this=0x000000014c1cff00) + 28 at basic/source/classes/sbunoobj.cxx:2591
>     frame #8: 0x000000011180c235 libsblo.dylib`SvRefBase::ReleaseRef(this=0x000000014c1cffa0) + 197 at include/tools/ref.hxx:163
>     frame #9: 0x000000011184fda7 libsblo.dylib`tools::SvRef<SbxVariable>::~SvRef(this=0x000000014c1d2490) + 55 at include/tools/ref.hxx:56
>     frame #10: 0x000000011184a545 libsblo.dylib`tools::SvRef<SbxVariable>::~SvRef(this=0x000000014c1d2490) + 21 at include/tools/ref.hxx:55
>     frame #11: 0x00000001119be5af libsblo.dylib`SbxVarEntry::~SbxVarEntry(this=0x000000014c1d2490) + 47 at basic/source/sbx/sbxarray.cxx:31
>     frame #12: 0x00000001119bc3d5 libsblo.dylib`SbxVarEntry::~SbxVarEntry(this=0x000000014c1d2490) + 21 at basic/source/sbx/sbxarray.cxx:31
>     frame #13: 0x00000001119bed29 libsblo.dylib`std::__1::allocator<SbxVarEntry>::destroy(this=0x000000014c1940a0, __p=0x000000014c1d2490) + 25 at c++/v1/memory:1931
>     frame #14: 0x00000001119becfd libsblo.dylib`void std::__1::allocator_traits<std::__1::allocator<SbxVarEntry> >::__destroy<SbxVarEntry>((null)=std::__1::true_type @ 0x00007ffeefbf1448, __a=0x000000014c1940a0, __p=0x000000014c1d2490) + 29 at c++/v1/memory:1793
>     frame #15: 0x00000001119beccd libsblo.dylib`void std::__1::allocator_traits<std::__1::allocator<SbxVarEntry> >::destroy<SbxVarEntry>(__a=0x000000014c1940a0, __p=0x000000014c1d2490) + 29 at c++/v1/memory:1630
>     frame #16: 0x00000001119bec7b libsblo.dylib`std::__1::__vector_base<SbxVarEntry, std::__1::allocator<SbxVarEntry> >::__destruct_at_end(this=0x000000014c194090, __new_last=0x000000014c1d2490) + 91 at c++/v1/vector:426
>     frame #17: 0x00000001119bebab libsblo.dylib`std::__1::__vector_base<SbxVarEntry, std::__1::allocator<SbxVarEntry> >::clear(this=0x000000014c194090) + 27 at c++/v1/vector:369
>     frame #18: 0x00000001119bea47 libsblo.dylib`std::__1::__vector_base<SbxVarEntry, std::__1::allocator<SbxVarEntry> >::~__vector_base(this=0x000000014c194090) + 39 at c++/v1/vector:463
>     frame #19: 0x00000001119be958 libsblo.dylib`std::__1::vector<SbxVarEntry, std::__1::allocator<SbxVarEntry> >::~vector(this=0x000000014c194090 size=3) + 40 at c++/v1/vector:555
>     frame #20: 0x00000001119bafa5 libsblo.dylib`std::__1::vector<SbxVarEntry, std::__1::allocator<SbxVarEntry> >::~vector(this=0x000000014c194090 size=3) + 21 at c++/v1/vector:550
>     frame #21: 0x00000001119bb457 libsblo.dylib`SbxArray::~SbxArray(this=0x000000014c194080, vtt=0x0000000111a385e8) + 71 at basic/source/sbx/sbxarray.cxx:75
>     frame #22: 0x00000001119bb4a3 libsblo.dylib`SbxArray::~SbxArray(this=0x000000014c194080) + 35 at basic/source/sbx/sbxarray.cxx:74
>     frame #23: 0x00000001119bb4fc libsblo.dylib`SbxArray::~SbxArray(this=0x000000014c194080) + 28 at basic/source/sbx/sbxarray.cxx:74
>     frame #24: 0x000000011180c235 libsblo.dylib`SvRefBase::ReleaseRef(this=0x000000014c194080) + 197 at include/tools/ref.hxx:163
>     frame #25: 0x000000011184dbd7 libsblo.dylib`tools::SvRef<SbxArray>::~SvRef(this=0x000000014c1cfe58) + 55 at include/tools/ref.hxx:56
>     frame #26: 0x000000011184cc25 libsblo.dylib`tools::SvRef<SbxArray>::~SvRef(this=0x000000014c1cfe58) + 21 at include/tools/ref.hxx:55
>     frame #27: 0x00000001119e0d10 libsblo.dylib`SbxObject::~SbxObject(this=0x000000014c1cfdd0, vtt=0x0000000111a37d18) + 288 at basic/source/sbx/sbxobj.cxx:111
>     frame #28: 0x000000011188b73d libsblo.dylib`SbUnoObject::~SbUnoObject(this=0x000000014c1cfdd0, vtt=0x0000000111a37d10) + 221 at basic/source/classes/sbunoobj.cxx:2387
>     frame #29: 0x0000000111990d51 libsblo.dylib`SbxErrObject::~SbxErrObject(this=0x000000014c1cfdd0, vtt=0x0000000111a37d08) + 113 at basic/source/classes/errobject.cxx:184
>     frame #30: 0x0000000111990d83 libsblo.dylib`SbxErrObject::~SbxErrObject(this=0x000000014c1cfdd0) + 35 at basic/source/classes/errobject.cxx:183
>     frame #31: 0x0000000111990dfc libsblo.dylib`SbxErrObject::~SbxErrObject(this=0x000000014c1cfdd0) + 28 at basic/source/classes/errobject.cxx:183
>     frame #32: 0x000000011180c235 libsblo.dylib`SvRefBase::ReleaseRef(this=0x000000014c1cfee8) + 197 at include/tools/ref.hxx:163
>     frame #33: 0x00000001119bcac6 libsblo.dylib`tools::SvRef<SbxVariable>::clear(this=0x0000000110e365a8) + 70 at include/tools/ref.hxx:64
>     frame #34: 0x00000001119ca764 libsblo.dylib`SbxAppData::~SbxAppData(this=0x0000000110e365a0) + 84 at basic/source/sbx/sbxbase.cxx:49
>     frame #35: 0x00000001119ca965 libsblo.dylib`SbxAppData::~SbxAppData(this=0x0000000110e365a0) + 21 at basic/source/sbx/sbxbase.cxx:45
>     frame #36: 0x000000011199272b libsblo.dylib`std::__1::default_delete<SbxAppData>::operator(this=0x0000000110e2cfb0, __ptr=0x0000000110e365a0)(SbxAppData*) const + 43 at c++/v1/memory:2363
>     frame #37: 0x00000001119926af libsblo.dylib`std::__1::unique_ptr<SbxAppData, std::__1::default_delete<SbxAppData> >::reset(this=0x0000000110e2cfb0, __p=0x0000000000000000) + 95 at c++/v1/memory:2618
>     frame #38: 0x0000000111992649 libsblo.dylib`std::__1::unique_ptr<SbxAppData, std::__1::default_delete<SbxAppData> >::~unique_ptr(this=0x0000000110e2cfb0) + 25 at c++/v1/memory:2572
>     frame #39: 0x0000000111992625 libsblo.dylib`std::__1::unique_ptr<SbxAppData, std::__1::default_delete<SbxAppData> >::~unique_ptr(this=0x0000000110e2cfb0) + 21 at c++/v1/memory:2572
>     frame #40: 0x00000001119925f5 libsblo.dylib`(anonymous namespace)::BasicDLLImpl::~BasicDLLImpl(this=0x0000000110e2cfa0) + 53 at basic/source/runtime/basrdll.cxx:33
>     frame #41: 0x0000000111992415 libsblo.dylib`(anonymous namespace)::BasicDLLImpl::~BasicDLLImpl(this=0x0000000110e2cfa0) + 21 at basic/source/runtime/basrdll.cxx:33
>     frame #42: 0x000000011199243c libsblo.dylib`(anonymous namespace)::BasicDLLImpl::~BasicDLLImpl(this=0x0000000110e2cfa0) + 28 at basic/source/runtime/basrdll.cxx:33
>     frame #43: 0x000000011180c235 libsblo.dylib`SvRefBase::ReleaseRef(this=0x0000000110e2cfa0) + 197 at include/tools/ref.hxx:163
>     frame #44: 0x0000000111992039 libsblo.dylib`tools::SvRef<SvRefBase>::clear(this=0x00007ffeefbf1bb0) + 57 at include/tools/ref.hxx:64
>     frame #45: 0x0000000111991f0b libsblo.dylib`BasicDLL::~BasicDLL(this=0x00007ffeefbf1bb0) + 123 at basic/source/runtime/basrdll.cxx:69
>     frame #46: 0x0000000111992055 libsblo.dylib`BasicDLL::~BasicDLL(this=0x00007ffeefbf1bb0) + 21 at basic/source/runtime/basrdll.cxx:66
>     frame #47: 0x0000000110f07a5a libtest_basic_macros.dylib`MacroSnippet::~MacroSnippet(this=0x00007ffeefbf1ba8) + 74 at basic/qa/cppunit/basictest.hxx:23
>     frame #48: 0x0000000110f07a05 libtest_basic_macros.dylib`MacroSnippet::~MacroSnippet(this=0x00007ffeefbf1ba8) + 21 at basic/qa/cppunit/basictest.hxx:23
>     frame #49: 0x0000000110f269b7 libtest_basic_macros.dylib`(anonymous namespace)::VBATest::testMiscVBAFunctions(this=0x0000000100651890) + 1319 at basic/qa/cppunit/test_vba.cxx:168
[...]

Change-Id: I776b7f0686e0915b69119b2e6a513e2a4b40822f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90967
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
tdf-gerrit pushed a commit that referenced this pull request Apr 2, 2020
…roller

...and not just add it to the new controller.  It caused

> $ SAL_USE_VCLPLUGIN=gen make UITest_chart UITEST_TEST_NAME=chartLegend.chartLegend.test_chart_display_legend_dialog

to fail with

> ==346284==ERROR: AddressSanitizer: heap-use-after-free on address 0x61a00049cca8 at pc 0x7f8496747751 bp 0x7fff7c483f10 sp 0x7fff7c483f08
> READ of size 8 at 0x61a00049cca8 thread T0
>  #0 in chart::sidebar::ChartSidebarSelectionListener::selectionChanged(com::sun::star::lang::EventObject const&) at chart2/source/controller/sidebar/ChartSidebarSelectionListener.cxx:66:15
>  #1 in chart::ChartController::impl_notifySelectionChangeListeners() at chart2/source/controller/main/ChartController_Window.cxx:1740:28
>  #2 in chart::ChartController::impl_selectObjectAndNotiy() at chart2/source/controller/main/ChartController_Window.cxx:1756:5
>  #3 in chart::ChartController::modeChanged(com::sun::star::util::ModeChangeEvent const&) at chart2/source/controller/main/ChartController.cxx:538:31
>  #4 in chart::ChartView::impl_notifyModeChangeListener(rtl::OUString const&) at chart2/source/view/main/ChartView.cxx:2653:32
>  #5 in chart::ChartView::impl_updateView(bool) at chart2/source/view/main/ChartView.cxx:2561:9
>  #6 in chart::ChartView::update() at chart2/source/view/main/ChartView.cxx:2687:5
>  #7 in chart::ChartController::execute_Paint(OutputDevice&, tools::Rectangle const&) at chart2/source/controller/main/ChartController_Window.cxx:485:25
>  #8 in chart::ChartWindow::Paint(OutputDevice&, tools::Rectangle const&) at chart2/source/controller/main/ChartWindow.cxx:99:30
>  #9 in PaintHelper::DoPaint(vcl::Region const*) at vcl/source/window/paint.cxx:309:24
>  #10 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags) at vcl/source/window/paint.cxx:613:17
>  #11 in PaintHelper::~PaintHelper() at vcl/source/window/paint.cxx:549:30
>  #12 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags) at vcl/source/window/paint.cxx:619:1
>  #13 in PaintHelper::~PaintHelper() at vcl/source/window/paint.cxx:549:30
>  #14 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags) at vcl/source/window/paint.cxx:619:1
>  #15 in PaintHelper::~PaintHelper() at vcl/source/window/paint.cxx:549:30
>  #16 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags) at vcl/source/window/paint.cxx:619:1
>  #17 in PaintHelper::~PaintHelper() at vcl/source/window/paint.cxx:549:30
>  #18 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags) at vcl/source/window/paint.cxx:619:1
>  #19 in PaintHelper::~PaintHelper() at vcl/source/window/paint.cxx:549:30
>  #20 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags) at vcl/source/window/paint.cxx:619:1
>  #21 in PaintHelper::~PaintHelper() at vcl/source/window/paint.cxx:549:30
>  #22 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags) at vcl/source/window/paint.cxx:619:1
>  #23 in PaintHelper::~PaintHelper() at vcl/source/window/paint.cxx:549:30
>  #24 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags) at vcl/source/window/paint.cxx:619:1
>  #25 in PaintHelper::~PaintHelper() at vcl/source/window/paint.cxx:549:30
>  #26 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags) at vcl/source/window/paint.cxx:619:1
>  #27 in vcl::Window::ImplCallOverlapPaint() at vcl/source/window/paint.cxx:637:9
>  #28 in vcl::Window::ImplHandlePaintHdl(Timer*) at vcl/source/window/paint.cxx:660:9
>  #29 in vcl::Window::LinkStubImplHandlePaintHdl(void*, Timer*) at vcl/source/window/paint.cxx:641:1
>  #30 in Link<Timer*, void>::Call(Timer*) const at include/tools/link.hxx:111:45
>  #31 in Timer::Invoke() at vcl/source/app/timer.cxx:75:21
>  #32 in Scheduler::ProcessTaskScheduling() at vcl/source/app/scheduler.cxx:478:20
>  #33 in Scheduler::CallbackTaskScheduling() at vcl/source/app/scheduler.cxx:287:5
>  #34 in SalTimer::CallCallback() at vcl/inc/saltimer.hxx:54:13
>  #35 in X11SalData::Timeout() at vcl/unx/generic/app/saldata.cxx:551:41
>  #36 in SalXLib::CheckTimeout(bool) at vcl/unx/generic/app/saldata.cxx:635:17
>  #37 in SalXLib::Yield(bool, bool) at vcl/unx/generic/app/saldata.cxx:716:25
>  #38 in X11SalInstance::DoYield(bool, bool) at vcl/unx/generic/app/salinst.cxx:182:20
>  #39 in ImplYield(bool, bool) at vcl/source/app/svapp.cxx:454:48
>  #40 in Application::Yield() at vcl/source/app/svapp.cxx:518:5
>  #41 in Application::Execute() at vcl/source/app/svapp.cxx:433:9
>  #42 in desktop::Desktop::Main() at desktop/source/app/app.cxx:1602:17
>  #43 in ImplSVMain() at vcl/source/app/svmain.cxx:196:35
>  #44 in SVMain() at vcl/source/app/svmain.cxx:228:12
>  #45 in soffice_main at desktop/source/app/sofficemain.cxx:107:12
>  #46 in sal_main at desktop/source/app/main.c:48:15
>  #47 in main at desktop/source/app/main.c:47:1
> 0x61a00049cca8 is located 1064 bytes inside of 1160-byte region [0x61a00049c880,0x61a00049cd08)
> freed by thread T0 here:
>  #0 in operator delete(void*, unsigned long) at compiler-rt/lib/asan/asan_new_delete.cpp:172:3
>  #1 in chart::sidebar::ChartLinePanel::~ChartLinePanel() at chart2/source/controller/sidebar/ChartLinePanel.cxx:143:1
>  #2 in VclReferenceBase::release() const at include/vcl/vclreferencebase.hxx:40:13
>  #3 in rtl::Reference<vcl::Window>::~Reference() at include/rtl/ref.hxx:92:22
>  #4 in VclPtr<vcl::Window>::disposeAndClear() at include/vcl/vclptr.hxx:208:5
>  #5 in sfx2::sidebar::SidebarPanelBase::disposing() at sfx2/source/sidebar/SidebarPanelBase.cxx:81:15
>  #6 in cppu::WeakComponentImplHelperBase::dispose() at cppuhelper/source/implbase.cxx:102:17
>  #7 in cppu::PartialWeakComponentImplHelper<com::sun::star::ui::XContextChangeEventListener, com::sun::star::ui::XUIElement, com::sun::star::ui::XToolPanel, com::sun::star::ui::XSidebarPanel, com::sun::star::ui::XUpdateModel>::dispose() at include/cppuhelper/compbase.hxx:90:36
>  #8 in sfx2::sidebar::Panel::dispose() at sfx2/source/sidebar/Panel.cxx:106:25
>  #9 in VclReferenceBase::disposeOnce() at vcl/source/outdev/vclreferencebase.cxx:38:5
>  #10 in VclPtr<sfx2::sidebar::Panel>::disposeAndClear() at include/vcl/vclptr.hxx:206:19
>  #11 in sfx2::sidebar::Deck::dispose() at sfx2/source/sidebar/Deck.cxx:92:17
>  #12 in VclReferenceBase::disposeOnce() at vcl/source/outdev/vclreferencebase.cxx:38:5
>  #13 in VclPtr<sfx2::sidebar::Deck>::disposeAndClear() at include/vcl/vclptr.hxx:206:19
>  #14 in sfx2::sidebar::SidebarController::CreateDeck(rtl::OUString const&, sfx2::sidebar::Context const&, bool) at sfx2/source/sidebar/SidebarController.cxx:664:19
>  #15 in sfx2::sidebar::SidebarController::SwitchToDeck(sfx2::sidebar::DeckDescriptor const&, sfx2::sidebar::Context const&) at sfx2/source/sidebar/SidebarController.cxx:822:5
>  #16 in sfx2::sidebar::SidebarController::UpdateConfigurations() at sfx2/source/sidebar/SidebarController.cxx:569:9
>  #17 in sfx2::sidebar::SidebarController::SidebarController(sfx2::sidebar::SidebarDockingWindow*, SfxViewFrame const*)::$_3::operator()() const at sfx2/source/sidebar/SidebarController.cxx:140:52
>  #18 in void std::__invoke_impl<void, sfx2::sidebar::SidebarController::SidebarController(sfx2::sidebar::SidebarDockingWindow*, SfxViewFrame const*)::$_3&>(std::__invoke_other, sfx2::sidebar::SidebarController::SidebarController(sfx2::sidebar::SidebarDockingWindow*, SfxViewFrame const*)::$_3&) at include/c++/10.0.1/bits/invoke.h:60:14
>  #19 in std::enable_if<is_invocable_r_v<void, sfx2::sidebar::SidebarController::SidebarController(sfx2::sidebar::SidebarDockingWindow*, SfxViewFrame const*)::$_3&>, void>::type std::__invoke_r<void, sfx2::sidebar::SidebarController::SidebarController(sfx2::sidebar::SidebarDockingWindow*, SfxViewFrame const*)::$_3&>(sfx2::sidebar::SidebarController::SidebarController(sfx2::sidebar::SidebarDockingWindow*, SfxViewFrame const*)::$_3&) at include/c++/10.0.1/bits/invoke.h:110:2
>  #20 in std::_Function_handler<void (), sfx2::sidebar::SidebarController::SidebarController(sfx2::sidebar::SidebarDockingWindow*, SfxViewFrame const*)::$_3>::_M_invoke(std::_Any_data const&) at include/c++/10.0.1/bits/std_function.h:291:9
>  #21 in std::function<void ()>::operator()() const at include/c++/10.0.1/bits/std_function.h:622:14
>  #22 in sfx2::sidebar::AsynchronousCall::HandleUserCall(void*) at sfx2/source/sidebar/AsynchronousCall.cxx:66:9
>  #23 in sfx2::sidebar::AsynchronousCall::LinkStubHandleUserCall(void*, void*) at sfx2/source/sidebar/AsynchronousCall.cxx:62:1
>  #24 in Link<void*, void>::Call(void*) const at include/tools/link.hxx:111:45
>  #25 in ImplHandleUserEvent(ImplSVEvent*) at vcl/source/window/winproc.cxx:2009:30
>  #26 in ImplWindowFrameProc(vcl::Window*, SalEvent, void const*) at vcl/source/window/winproc.cxx:2562:13
>  #27 in SalFrame::CallCallback(SalEvent, void const*) const at vcl/inc/salframe.hxx:306:29
>  #28 in SalGenericDisplay::ProcessEvent(SalUserEventList::SalUserEvent) at vcl/unx/generic/app/gendisp.cxx:66:22
>  #29 in SalUserEventList::DispatchUserEvents(bool) at vcl/source/app/salusereventlist.cxx:108:17
>  #30 in SalGenericDisplay::DispatchInternalEvent(bool) at vcl/unx/generic/app/gendisp.cxx:51:12
>  #31 in SalX11Display::Yield() at vcl/unx/generic/app/saldisp.cxx:1918:9
>  #32 in DisplayYield(int, void*) at vcl/unx/generic/app/saldisp.cxx:414:13
>  #33 in (anonymous namespace)::YieldEntry::HandleNextEvent() const at vcl/unx/generic/app/saldata.cxx:566:38
>  #34 in SalXLib::Yield(bool, bool) at vcl/unx/generic/app/saldata.cxx:662:25
>  #35 in X11SalInstance::DoYield(bool, bool) at vcl/unx/generic/app/salinst.cxx:182:20
>  #36 in ImplYield(bool, bool) at vcl/source/app/svapp.cxx:454:48
>  #37 in Application::Yield() at vcl/source/app/svapp.cxx:518:5
>  #38 in Dialog::Execute() at vcl/source/window/dialog.cxx:1032:9
>  #39 in SalInstanceDialog::run() at vcl/source/app/salvtables.cxx:1480:23
>  #40 in weld::DialogController::run() at include/vcl/weld.hxx:2196:47
>  #41 in chart::ChartController::executeDispatch_OpenLegendDialog() at chart2/source/controller/main/ChartController_Insert.cxx:227:18
>  #42 in chart::ChartController::dispatch(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at chart2/source/controller/main/ChartController.cxx:1130:15
>  #43 in ChartUIObject::PostCommand(void*) at chart2/source/controller/uitest/uiobject.cxx:76:41
>  #44 in ChartUIObject::LinkStubPostCommand(void*, void*) at chart2/source/controller/uitest/uiobject.cxx:72:1
>  #45 in Link<void*, void>::Call(void*) const at include/tools/link.hxx:111:45
>  #46 in ImplHandleUserEvent(ImplSVEvent*) at vcl/source/window/winproc.cxx:2009:30
>  #47 in ImplWindowFrameProc(vcl::Window*, SalEvent, void const*) at vcl/source/window/winproc.cxx:2562:13
>  #48 in SalFrame::CallCallback(SalEvent, void const*) const at vcl/inc/salframe.hxx:306:29
>  #49 in SalGenericDisplay::ProcessEvent(SalUserEventList::SalUserEvent) at vcl/unx/generic/app/gendisp.cxx:66:22
>  #50 in SalUserEventList::DispatchUserEvents(bool) at vcl/source/app/salusereventlist.cxx:108:17
>  #51 in SalGenericDisplay::DispatchInternalEvent(bool) at vcl/unx/generic/app/gendisp.cxx:51:12
>  #52 in SalX11Display::Yield() at vcl/unx/generic/app/saldisp.cxx:1918:9
>  #53 in DisplayYield(int, void*) at vcl/unx/generic/app/saldisp.cxx:414:13
>  #54 in (anonymous namespace)::YieldEntry::HandleNextEvent() const at vcl/unx/generic/app/saldata.cxx:566:38
>  #55 in SalXLib::Yield(bool, bool) at vcl/unx/generic/app/saldata.cxx:662:25
>  #56 in X11SalInstance::DoYield(bool, bool) at vcl/unx/generic/app/salinst.cxx:182:20
>  #57 in ImplYield(bool, bool) at vcl/source/app/svapp.cxx:454:48
>  #58 in Application::Reschedule(bool) at vcl/source/app/svapp.cxx:467:12
>  #59 in (anonymous namespace)::ExecuteWrapper::ExecuteActionHdl(Timer*) at vcl/source/uitest/uno/uiobject_uno.cxx:91:13
>  #60 in (anonymous namespace)::ExecuteWrapper::LinkStubExecuteActionHdl(void*, Timer*) at vcl/source/uitest/uno/uiobject_uno.cxx:78:1
>  #61 in Link<Timer*, void>::Call(Timer*) const at include/tools/link.hxx:111:45
>  #62 in Timer::Invoke() at vcl/source/app/timer.cxx:75:21
>  #63 in Scheduler::ProcessTaskScheduling() at vcl/source/app/scheduler.cxx:478:20
>  #64 in Scheduler::CallbackTaskScheduling() at vcl/source/app/scheduler.cxx:287:5
>  #65 in SalTimer::CallCallback() at vcl/inc/saltimer.hxx:54:13
>  #66 in X11SalData::Timeout() at vcl/unx/generic/app/saldata.cxx:551:41
>  #67 in SalXLib::CheckTimeout(bool) at vcl/unx/generic/app/saldata.cxx:635:17
>  #68 in SalXLib::Yield(bool, bool) at vcl/unx/generic/app/saldata.cxx:716:25
>  #69 in X11SalInstance::DoYield(bool, bool) at vcl/unx/generic/app/salinst.cxx:182:20
>  #70 in ImplYield(bool, bool) at vcl/source/app/svapp.cxx:454:48
>  #71 in Application::Yield() at vcl/source/app/svapp.cxx:518:5
>  #72 in Application::Execute() at vcl/source/app/svapp.cxx:433:9
>  #73 in desktop::Desktop::Main() at desktop/source/app/app.cxx:1602:17
>  #74 in ImplSVMain() at vcl/source/app/svmain.cxx:196:35
>  #75 in SVMain() at vcl/source/app/svmain.cxx:228:12
>  #76 in soffice_main at desktop/source/app/sofficemain.cxx:107:12
>  #77 in sal_main at desktop/source/app/main.c:48:15
>  #78 in main at desktop/source/app/main.c:47:1
> previously allocated by thread T0 here:
>  #0 in operator new(unsigned long) at compiler-rt/lib/asan/asan_new_delete.cpp:99:3
>  #1 in VclPtr<chart::sidebar::ChartLinePanel> VclPtr<chart::sidebar::ChartLinePanel>::Create<vcl::Window*&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, chart::ChartController*&>(vcl::Window*&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, chart::ChartController*&) at include/vcl/vclptr.hxx:129:42
>  #2 in chart::sidebar::ChartLinePanel::Create(vcl::Window*, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, chart::ChartController*) at chart2/source/controller/sidebar/ChartLinePanel.cxx:117:12
>  #3 in chart::sidebar::ChartPanelFactory::createUIElement(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at chart2/source/controller/sidebar/Chart2PanelFactory.cxx:107:22
>  #4 in non-virtual thunk to chart::sidebar::ChartPanelFactory::createUIElement(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at chart2/source/controller/sidebar/Chart2PanelFactory.cxx
>  #5 in (anonymous namespace)::UIElementFactoryManager::createUIElement(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/uifactory/uielementfactorymanager.cxx:437:39
>  #6 in non-virtual thunk to (anonymous namespace)::UIElementFactoryManager::createUIElement(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/uifactory/uielementfactorymanager.cxx
>  #7 in sfx2::sidebar::SidebarController::CreateUIElement(com::sun::star::uno::Reference<com::sun::star::awt::XWindowPeer> const&, rtl::OUString const&, bool, sfx2::sidebar::Context const&) at sfx2/source/sidebar/SidebarController.cxx:967:32
>  #8 in sfx2::sidebar::SidebarController::CreatePanel(rtl::OUString const&, vcl::Window*, bool, sfx2::sidebar::Context const&, VclPtr<sfx2::sidebar::Deck> const&) at sfx2/source/sidebar/SidebarController.cxx:908:43
>  #9 in sfx2::sidebar::SidebarController::CreatePanels(rtl::OUString const&, sfx2::sidebar::Context const&) at sfx2/source/sidebar/SidebarController.cxx:720:41
>  #10 in sfx2::sidebar::SidebarController::CreateDeck(rtl::OUString const&, sfx2::sidebar::Context const&, bool) at sfx2/source/sidebar/SidebarController.cxx:672:5
>  #11 in sfx2::sidebar::SidebarController::SwitchToDeck(sfx2::sidebar::DeckDescriptor const&, sfx2::sidebar::Context const&) at sfx2/source/sidebar/SidebarController.cxx:822:5
>  #12 in sfx2::sidebar::SidebarController::UpdateConfigurations() at sfx2/source/sidebar/SidebarController.cxx:569:9
>  #13 in sfx2::sidebar::SidebarController::notifyContextChangeEvent(com::sun::star::ui::ContextChangeEventObject const&) at sfx2/source/sidebar/SidebarController.cxx:323:9
>  #14 in (anonymous namespace)::ContextChangeEventMultiplexer::addContextChangeEventListener(com::sun::star::uno::Reference<com::sun::star::ui::XContextChangeEventListener> const&, com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&) at framework/source/services/ContextChangeEventMultiplexer.cxx:176:29
>  #15 in sfx2::sidebar::SidebarController::registerSidebarForFrame(sfx2::sidebar::SidebarController*, com::sun::star::uno::Reference<com::sun::star::frame::XController> const&) at sfx2/source/sidebar/SidebarController.cxx:213:19
>  #16 in chart::ChartController::attachFrame(com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) at chart2/source/controller/main/ChartController.cxx:400:9
>  #17 in chart::ChartFrameLoader::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) at chart2/source/controller/main/ChartFrameloader.cxx:133:22
>  #18 in framework::LoadEnv::impl_loadContent() at framework/source/loadenv/loadenv.cxx:1157:37
>  #19 in framework::LoadEnv::start() at framework/source/loadenv/loadenv.cxx:395:20
>  #20 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) at framework/source/loadenv/loadenv.cxx:300:5
>  #21 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&) at framework/source/loadenv/loadenv.cxx:169:14
>  #22 in (anonymous namespace)::XFrameImpl::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/services/frame.cxx:590:16
>  #23 in non-virtual thunk to (anonymous namespace)::XFrameImpl::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/services/frame.cxx
>  #24 in DocumentHolder::LoadDocToFrame(bool) at embeddedobj/source/general/docholder.cxx:984:31
>  #25 in DocumentHolder::ShowInplace(com::sun::star::uno::Reference<com::sun::star::awt::XWindowPeer> const&, com::sun::star::awt::Rectangle const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> const&) at embeddedobj/source/general/docholder.cxx:477:15
>  #26 in OCommonEmbeddedObject::SwitchStateTo_Impl(int) at embeddedobj/source/commonembedding/embedobj.cxx:252:42
>  #27 in OCommonEmbeddedObject::changeState(int) at embeddedobj/source/commonembedding/embedobj.cxx:451:17
>  #28 in OCommonEmbeddedObject::doVerb(int) at embeddedobj/source/commonembedding/embedobj.cxx:537:9
>  #29 in SfxInPlaceClient::DoVerb(long) at sfx2/source/view/ipclient.cxx:950:40
>  #30 in ScTabViewShell::ActivateObject(SdrOle2Obj*, long) at sc/source/ui/view/tabvwshb.cxx:205:29
>  #31 in ScGridWinUIObject::execute(rtl::OUString const&, std::__debug::map<rtl::OUString const, rtl::OUString, std::less<rtl::OUString const>, std::allocator<std::pair<rtl::OUString const, rtl::OUString> > > const&) at sc/source/ui/uitest/uiobject.cxx:175:29
>  #32 in UIObjectUnoObj::executeAction(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)::$_0::operator()() const at vcl/source/uitest/uno/uiobject_uno.cxx:124:16
>  #33 in void std::__invoke_impl<void, UIObjectUnoObj::executeAction(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)::$_0&>(std::__invoke_other, UIObjectUnoObj::executeAction(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)::$_0&) at include/c++/10.0.1/bits/invoke.h:60:14
>  #34 in std::enable_if<is_invocable_r_v<void, UIObjectUnoObj::executeAction(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)::$_0&>, void>::type std::__invoke_r<void, UIObjectUnoObj::executeAction(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)::$_0&>(UIObjectUnoObj::executeAction(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)::$_0&) at include/c++/10.0.1/bits/invoke.h:110:2
>  #35 in std::_Function_handler<void (), UIObjectUnoObj::executeAction(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)::$_0>::_M_invoke(std::_Any_data const&) at include/c++/10.0.1/bits/std_function.h:291:9
>  #36 in std::function<void ()>::operator()() const at include/c++/10.0.1/bits/std_function.h:622:14
>  #37 in (anonymous namespace)::ExecuteWrapper::ExecuteActionHdl(Timer*) at vcl/source/uitest/uno/uiobject_uno.cxx:83:13
>  #38 in (anonymous namespace)::ExecuteWrapper::LinkStubExecuteActionHdl(void*, Timer*) at vcl/source/uitest/uno/uiobject_uno.cxx:78:1
>  #39 in Link<Timer*, void>::Call(Timer*) const at include/tools/link.hxx:111:45
>  #40 in Timer::Invoke() at vcl/source/app/timer.cxx:75:21
>  #41 in Scheduler::ProcessTaskScheduling() at vcl/source/app/scheduler.cxx:478:20
>  #42 in Scheduler::CallbackTaskScheduling() at vcl/source/app/scheduler.cxx:287:5
>  #43 in SalTimer::CallCallback() at vcl/inc/saltimer.hxx:54:13
>  #44 in X11SalData::Timeout() at vcl/unx/generic/app/saldata.cxx:551:41
>  #45 in SalXLib::CheckTimeout(bool) at vcl/unx/generic/app/saldata.cxx:635:17
>  #46 in SalXLib::Yield(bool, bool) at vcl/unx/generic/app/saldata.cxx:716:25
>  #47 in X11SalInstance::DoYield(bool, bool) at vcl/unx/generic/app/salinst.cxx:182:20
>  #48 in ImplYield(bool, bool) at vcl/source/app/svapp.cxx:454:48
>  #49 in Application::Yield() at vcl/source/app/svapp.cxx:518:5
>  #50 in Application::Execute() at vcl/source/app/svapp.cxx:433:9
>  #51 in desktop::Desktop::Main() at desktop/source/app/app.cxx:1602:17
>  #52 in ImplSVMain() at vcl/source/app/svmain.cxx:196:35
>  #53 in SVMain() at vcl/source/app/svmain.cxx:228:12
>  #54 in soffice_main at desktop/source/app/sofficemain.cxx:107:12
>  #55 in sal_main at desktop/source/app/main.c:48:15
>  #56 in main at desktop/source/app/main.c:47:1

The changes that were necessary to fix that scenario are those in
ChartAreaPanel.cxx and ChartLinePanel.cxx, but the other updateModel
implementations look equally broken.

Change-Id: I064fb701dc10e7cb7ef7ea5839f7dd1ae8d0ebba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91467
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
tdf-gerrit pushed a commit that referenced this pull request Apr 3, 2020
make a copy of m_pImpGraphicList because if we swap out a svg, the svg filter
may create more temp Graphics which are auto-added to m_pImpGraphicList
invalidating a loop over m_pImpGraphicList

 #0  0x00007ffff0d25ae5 in vcl::graphic::Manager::reduceGraphicMemory() (this=0x7ffff1bc4760 <vcl::graphic::Manager::get()::gStaticManager>)
    at vcl/source/graphic/Manager.cxx:88
 #1  0x00007ffff0d25ee9 in vcl::graphic::Manager::registerGraphic(std::shared_ptr<ImpGraphic> const&, rtl::OUString const&)
    (this=0x7ffff1bc4760 <vcl::graphic::Manager::get()::gStaticManager>, pImpGraphic=std::shared_ptr<ImpGraphic> (use count 1, weak count 0) = {...})
    at vcl/source/graphic/Manager.cxx:139
 #2  0x00007ffff0d26406 in vcl::graphic::Manager::newInstance() (this=0x7ffff1bc4760 <vcl::graphic::Manager::get()::gStaticManager>)
    at vcl/source/graphic/Manager.cxx:184
 #3  0x00007ffff0b6735c in Graphic::Graphic() (this=0x7fffffff84f0) at vcl/source/gdi/graph.cxx:182
 #4  0x00007fffdc526600 in svgio::svgreader::SvgImageNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer&, bool) const
    (this=0x555556817940, rTarget=...) at svgio/source/svgreader/svgimagenode.cxx:219
 #5  0x00007fffdc52e75d in svgio::svgreader::SvgNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer&, bool) const
    (this=0x55555a6a93d0, rTarget=..., bReferenced=false) at svgio/source/svgreader/svgnode.cxx:529
 #6  0x00007fffdc522339 in svgio::svgreader::SvgGNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer&, bool) const
    (this=0x55555a6a93d0, rTarget=..., bReferenced=false) at svgio/source/svgreader/svggnode.cxx:106
 #7  0x00007fffdc52e75d in svgio::svgreader::SvgNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer&, bool) const
    (this=0x55555a6a9070, rTarget=..., bReferenced=false) at svgio/source/svgreader/svgnode.cxx:529
 #8  0x00007fffdc522339 in svgio::svgreader::SvgGNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer&, bool) const
    (this=0x55555a6a9070, rTarget=..., bReferenced=false) at svgio/source/svgreader/svggnode.cxx:106
 #9  0x00007fffdc52e75d in svgio::svgreader::SvgNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer&, bool) const
    (this=0x55555a5f9150, rTarget=..., bReferenced=false) at svgio/source/svgreader/svgnode.cxx:529
 #10 0x00007fffdc54d19f in svgio::svgreader::SvgSvgNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer&, bool) const
    (this=0x55555a5f9150, rTarget=..., bReferenced=false) at svgio/source/svgreader/svgsvgnode.cxx:304
 #11 0x00007fffdc571373 in svgio::svgreader::(anonymous namespace)::XSvgParser::getDecomposition(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, rtl::OUString const&) (this=0x55555a69c6d0, xSVGStream=uno::Reference to (comphelper::SequenceInputStream *) 0x555557480668, aAbsolutePath="")
    at svgio/source/svguno/xsvgparser.cxx:160
 #12 0x00007ffff0cf849b in VectorGraphicData::ensureSequenceAndRange() (this=0x555556ea7540)
    at vcl/source/gdi/vectorgraphicdata.cxx:196
 #13 0x00007ffff0cf9124 in VectorGraphicData::getRange() const (this=0x555556ea7540)
    at vcl/source/gdi/vectorgraphicdata.cxx:323
 #14 0x00007ffff0b74da7 in ImpGraphic::ImplGetPrefSize() const (this=0x5555588b00f0) at vcl/source/gdi/impgraph.cxx:778
 #15 0x00007ffff0b76623 in ImpGraphic::ImplWriteEmbedded(SvStream&) (this=0x5555588b00f0, rOStm=...)
    at vcl/source/gdi/impgraph.cxx:1235
 #16 0x00007ffff0b770a1 in ImpGraphic::ImplSwapOut(SvStream*) (this=0x5555588b00f0, xOStm=0x55555826b7d0)
    at vcl/source/gdi/impgraph.cxx:1377
 #17 0x00007ffff0b76bdb in ImpGraphic::ImplSwapOut() (this=0x5555588b00f0) at vcl/source/gdi/impgraph.cxx:1328
 #18 0x00007ffff0d25c88 in vcl::graphic::Manager::reduceGraphicMemory() (this=0x7ffff1bc4760 <vcl::graphic::Manager::get()::gStaticManager>)
    at vcl/source/graphic/Manager.cxx:107
 #19 0x00007ffff0d25ee9 in vcl::graphic::Manager::registerGraphic(std::shared_ptr<ImpGraphic> const&, rtl::OUString const&)
    (this=0x7ffff1bc4760 <vcl::graphic::Manager::get()::gStaticManager>, pImpGraphic=std::shared_ptr<ImpGraphic> (use count 1, weak count 0) = {...})
    at vcl/source/graphic/Manager.cxx:139
 #20 0x00007ffff0d26406 in vcl::graphic::Manager::newInstance() (this=0x7ffff1bc4760 <vcl::graphic::Manager::get()::gStaticManager>)
    at vcl/source/graphic/Manager.cxx:184
 #21 0x00007ffff0b6735c in Graphic::Graphic() (this=0x555556d5ea68) at vcl/source/gdi/graph.cxx:182

Change-Id: I4e1ffcb12ead0d53b7ca2f369154e9c753af77d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91650
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
tdf-gerrit pushed a commit that referenced this pull request Apr 27, 2020
If something goes wrong, better keep the testing Python and the tested soffice
process in a state in which the actual problem can (hopefully) be debugged
better.

I happened to run into a hung UITest_chart on Linux, where soffice.bin was still
at

> Thread 1 (Thread 0x7f2e2b280fc0 (LWP 1906251)):
> #0  futex_abstimed_wait_cancelable (private=0, abstime=0x7f2e27b59a80, clockid=<optimized out>, expected=0, futex_word=0x60e000024e8c) at /usr/src/debug/glibc-2.31-17-gab029a2801/sysdeps/nptl/futex-internal.h:320
> #1  __pthread_cond_wait_common (abstime=0x7f2e27b59a80, clockid=<optimized out>, mutex=0x60e000024e38, cond=0x60e000024e60) at /usr/src/debug/glibc-2.31-17-gab029a2801/nptl/pthread_cond_wait.c:520
> #2  __pthread_cond_clockwait (abstime=0x7f2e27b59a80, clockid=<optimized out>, mutex=0x60e000024e38, cond=0x60e000024e60) at /usr/src/debug/glibc-2.31-17-gab029a2801/nptl/pthread_cond_wait.c:677
> #3  __pthread_cond_clockwait (cond=0x60e000024e60, mutex=0x60e000024e38, clockid=<optimized out>, abstime=0x7f2e27b59a80) at /usr/src/debug/glibc-2.31-17-gab029a2801/nptl/pthread_cond_wait.c:665
> #4  0x00007f2e5fead808 in std::condition_variable::__wait_until_impl<std::chrono::duration<long, std::ratio<1l, 1000000000l> > >(std::unique_lock<std::mutex>&, std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&) (this=0x60e000024e60, __lock=..., __atime=...) at include/c++/10.0.1/condition_variable:210
> #5  0x00007f2e5fead295 in std::condition_variable::wait_until<std::chrono::duration<long, std::ratio<1l, 1000000000l> > >(std::unique_lock<std::mutex>&, std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&) (this=0x60e000024e60, __lock=..., __atime=...) at include/c++/10.0.1/condition_variable:120
> #6  0x00007f2e5fea8f05 in std::condition_variable::wait_until<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> >, SvpSalInstance::DoYield(bool, bool)::$_2>(std::unique_lock<std::mutex>&, std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&, SvpSalInstance::DoYield(bool, bool)::$_2) (this=0x60e000024e60, __lock=..., __atime=..., __p=...) at include/c++/10.0.1/condition_variable:159
> #7  0x00007f2e5fea6e60 in std::condition_variable::wait_for<long, std::ratio<1l, 1000l>, SvpSalInstance::DoYield(bool, bool)::$_2>(std::unique_lock<std::mutex>&, std::chrono::duration<long, std::ratio<1l, 1000l> > const&, SvpSalInstance::DoYield(bool, bool)::$_2) (this=0x60e000024e60, __lock=..., __rtime=..., __p=...) at include/c++/10.0.1/condition_variable:186
> #8  0x00007f2e5fea5a8e in SvpSalInstance::DoYield(bool, bool) (this=0x611000001bc0, bWait=true, bHandleAllCurrentEvents=false) at vcl/headless/svpinst.cxx:497
> #9  0x00007f2e5f3a232d in ImplYield(bool, bool) (i_bWait=true, i_bAllEvents=false) at vcl/source/app/svapp.cxx:454
> #10 0x00007f2e5f3a18e8 in Application::Yield() () at vcl/source/app/svapp.cxx:518
> #11 0x00007f2e5bf32c2d in Dialog::Execute() (this=0x61a000072080) at vcl/source/window/dialog.cxx:1032
> #12 0x00007f2e5efdcd62 in SalInstanceDialog::run() (this=0x619000091080) at vcl/source/app/salvtables.cxx:1480
> #13 0x00007f2dc37421fd in weld::DialogController::run() (this=0x61200077c5c0) at include/vcl/weld.hxx:2227
> #14 0x00007f2dc39672f2 in chart::CreationWizardUnoDlg::execute() (this=0x610000168d40) at chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx:189
> #15 0x00007f2df91f2507 in FuInsertChart::FuInsertChart(ScTabViewShell&, vcl::Window*, ScDrawView*, SdrModel*, SfxRequest&) (this=0x7f2e27f1a300, rViewSh=..., pWin=0x61a0001e8a80, pViewP=0x61d0001f6880, pDoc=0x617000066a00, rReq=...) at sc/source/ui/drawfunc/fuins2.cxx:673
> #16 0x00007f2dfaf9a379 in ScTabViewShell::ExecDrawIns(SfxRequest&) (this=0x61d0001eaa80, rReq=...) at sc/source/ui/view/tabvwshb.cxx:336
> #17 0x00007f2dfaedf365 in SfxStubScTabViewShellExecDrawIns(SfxShell*, SfxRequest&) (pShell=0x61d0001eaa80, rReq=...) at workdir/SdiTarget/sc/sdi/scslots.hxx:1447
> #18 0x00007f2e8031ded6 in SfxShell::CallExec(void (*)(SfxShell*, SfxRequest&), SfxRequest&) (this=0x61d0001eaa80, pFunc=0x7f2dfaedf240 <SfxStubScTabViewShellExecDrawIns(SfxShell*, SfxRequest&)>, rReq=...) at include/sfx2/shell.hxx:197
> #19 0x00007f2e802a77ff in SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, SfxRequest&, bool) (this=0x6020002f3dd0, rShell=..., rSlot=..., rReq=..., bRecord=true) at sfx2/source/control/dispatch.cxx:251
> #20 0x00007f2e802aacb6 in SfxDispatcher::PostMsgHandler(std::unique_ptr<SfxRequest, std::default_delete<SfxRequest> >) (this=0x6020002f3dd0, pReq=std::unique_ptr<class SfxRequest> = {...}) at sfx2/source/control/dispatch.cxx:988
[...]

but the Python process was already at

> Traceback (most recent call first):
>   <built-in method waitpid of module object at remote 0x60800002d1c0>
>   File "instdir/program/python-core-3.7.7/lib/subprocess.py", line 1611, in _try_wait
>     (pid, sts) = os.waitpid(self.pid, wait_flags)
>   File "instdir/program/python-core-3.7.7/lib/subprocess.py", line 1653, in _wait
>     (pid, sts) = self._try_wait(0)
>   File "instdir/program/python-core-3.7.7/lib/subprocess.py", line 1019, in wait
>     return self._wait(timeout=timeout)
>   File "uitest/libreoffice/connection.py", line 133, in tearDown
>     ret = self.soffice.wait()
>   File "uitest/libreoffice/connection.py", line 178, in tearDown
>     self.connection.tearDown()
>   File "uitest/uitest/framework.py", line 46, in tearDown
>     self.connection.tearDown()
>   File "instdir/program/python-core-3.7.7/lib/unittest/case.py", line 631, in run
>     self.tearDown()
>   File "instdir/program/python-core-3.7.7/lib/unittest/case.py", line 676, in __call__
>     return self.run(*args, **kwds)
>   File "instdir/program/python-core-3.7.7/lib/unittest/suite.py", line 122, in run
>     test(result)
>   File "instdir/program/python-core-3.7.7/lib/unittest/suite.py", line 84, in __call__
>     return self.run(*args, **kwds)
>   File "instdir/program/python-core-3.7.7/lib/unittest/runner.py", line 176, in run
>     test(result)
>   File "uitest/test_main.py", line 128, in <module>
>     result = unittest.TextTestRunner(stream=sys.stdout, verbosity=2).run(test_suite)

and the relevant

> ======================================================================
> ERROR: test_tdf99069_chart_cancel_data_ranges_dialog (tdf99069.tdf99069)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "sc/qa/uitest/chart/tdf99069.py", line 32, in test_tdf99069_chart_cancel_data_ranges_dialog
>     self.ui_test.execute_dialog_through_command(".uno:InsertObjectChart")
>   File "uitest/uitest/test.py", line 83, in execute_dialog_through_command
>     raise DialogNotExecutedException(command)
> uitest.test.DialogNotExecutedException: Dialog not executed for: .uno:InsertObjectChart

had not yet been written to workdir/UITest/chart/done.log (Python's unittest
appears to unhelpfully hold back such vital information until the very end of
the full test run).

That means DialogNotClosedException is unused now and can thus be removed.

Change-Id: I556ae52f05b1362f4e78f2de362a7b4f9b8a0cf7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92959
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
tdf-gerrit pushed a commit that referenced this pull request May 14, 2020
...presumably introduced by what looks like typos in
e9164b9 "lok: shape scaling rework"

>      }
>      // size
>      if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_WIDTH,true,&pPoolItem)) {
> -        nSizX=static_cast<const SfxUInt32Item*>(pPoolItem)->GetValue();
> +        nSizX=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
>          bChgSiz=true;
>          bChgWdh=true;
>      }
>      if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_HEIGHT,true,&pPoolItem)) {
> -        nSizY=static_cast<const SfxUInt32Item*>(pPoolItem)->GetValue();
> +        nSizY=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
>          bChgSiz=true;
>          bChgHgt=true;
>      }

but only showing up now (presumably due to newly added test code in
2f4ea95 "lok: unit test for metric field or
formatted field control") during CppunitTest_desktop_lib:

> svx/source/svdraw/svdedtv1.cxx:1602:15: runtime error: downcast of address 0x603001642720 which does not point to an object of type 'const SfxInt32Item'
> 0x603001642720: note: object is of type 'SfxUInt32Item'
>  7a 04 80 2b  50 bb 0f 7f cb 7f 00 00  01 00 00 00 6a 27 00 be  bc e8 02 00 be be be be  be be be be
>               ^~~~~~~~~~~~~~~~~~~~~~~
>               vptr for 'SfxUInt32Item'
>  #0 in SdrEditView::SetGeoAttrToMarked(SfxItemSet const&) at svx/source/svdraw/svdedtv1.cxx:1602:15
>  #1 in ScDrawShell::ExecDrawAttr(SfxRequest&) at sc/source/ui/drawfunc/drawsh.cxx:385:32
>  #2 in SfxStubScDrawShellExecDrawAttr(SfxShell*, SfxRequest&) at workdir/SdiTarget/sc/sdi/scslots.hxx:2779:1
>  #3 in SfxShell::CallExec(void (*)(SfxShell*, SfxRequest&), SfxRequest&) at include/sfx2/shell.hxx:197:35
>  #4 in SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, SfxRequest&, bool) at sfx2/source/control/dispatch.cxx:252:16
>  #5 in SfxDispatcher::Execute_(SfxShell&, SfxSlot const&, SfxRequest&, SfxCallMode) at sfx2/source/control/dispatch.cxx:752:9
>  #6 in SfxDispatcher::ExecuteList(unsigned short, SfxCallMode, std::initializer_list<SfxPoolItem const*>, std::initializer_list<SfxPoolItem const*>) at sfx2/source/control/dispatch.cxx:960:8
>  #7 in svx::sidebar::PosSizePropertyPanel::executeSize() at svx/source/sidebar/possize/PosSizePropertyPanel.cxx:848:45
>  #8 in svx::sidebar::PosSizePropertyPanel::ChangeWidthHdl(weld::MetricSpinButton&) at svx/source/sidebar/possize/PosSizePropertyPanel.cxx:378:5
>  #9 in svx::sidebar::PosSizePropertyPanel::LinkStubChangeWidthHdl(void*, weld::MetricSpinButton&) at svx/source/sidebar/possize/PosSizePropertyPanel.cxx:360:1
>  #10 in Link<weld::MetricSpinButton&, void>::Call(weld::MetricSpinButton&) const at include/tools/link.hxx:111:45
>  #11 in weld::MetricSpinButton::signal_value_changed() at include/vcl/weld.hxx:1721:54
>  #12 in weld::MetricSpinButton::spin_button_value_changed(weld::SpinButton&) at vcl/source/window/builder.cxx:192:9
>  #13 in weld::MetricSpinButton::LinkStubspin_button_value_changed(void*, weld::SpinButton&) at vcl/source/window/builder.cxx:190:5
>  #14 in Link<weld::SpinButton&, void>::Call(weld::SpinButton&) const at include/tools/link.hxx:111:45
>  #15 in weld::SpinButton::signal_value_changed() at include/vcl/weld.hxx:1490:54
>  #16 in SalInstanceSpinButton::UpDownHdl(SpinField&) at vcl/source/app/salvtables.cxx:5169:71
>  #17 in SalInstanceSpinButton::LinkStubUpDownHdl(void*, SpinField&) at vcl/source/app/salvtables.cxx:5169:1
>  #18 in Link<SpinField&, void>::Call(SpinField&) const at include/tools/link.hxx:111:45
>  #19 in SpinField::Up()::$_0::operator()() const at vcl/source/control/spinfld.cxx:361:88
>  #20 in void std::__invoke_impl<void, SpinField::Up()::$_0&>(std::__invoke_other, SpinField::Up()::$_0&) at include/c++/11.0.0/bits/invoke.h:60:14
>  #21 in std::enable_if<is_invocable_r_v<void, SpinField::Up()::$_0&>, void>::type std::__invoke_r<void, SpinField::Up()::$_0&>(SpinField::Up()::$_0&) at include/c++/11.0.0/bits/invoke.h:110:2
>  #22 in std::_Function_handler<void (), SpinField::Up()::$_0>::_M_invoke(std::_Any_data const&) at include/c++/11.0.0/bits/std_function.h:291:9
>  #23 in std::function<void ()>::operator()() const at include/c++/11.0.0/bits/std_function.h:622:14
>  #24 in Control::ImplCallEventListenersAndHandler(VclEventId, std::function<void ()> const&) at vcl/source/control/ctrl.cxx:315:13
>  #25 in SpinField::Up() at vcl/source/control/spinfld.cxx:361:5
>  #26 in FormattedField::SetValueFromString(rtl::OUString const&) at vcl/source/control/fmtfield.cxx:854:20
>  #27 in FormattedFieldUIObject::execute(rtl::OUString const&, std::__debug::map<rtl::OUString const, rtl::OUString, std::less<rtl::OUString const>, std::allocator<std::pair<rtl::OUString const, rtl::OUString> > > const&) at vcl/source/uitest/uiobject.cxx:1361:31
>  #28 in DesktopLOKTest::testMetricField() at desktop/qa/desktop_lib/test_desktop_lib.cxx:2858:13

Change-Id: I57988723e23f5a419639e37fe130bad92682a1a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94178
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
tdf-gerrit pushed a commit that referenced this pull request May 25, 2020
If something goes wrong, better keep the testing Python and the tested soffice
process in a state in which the actual problem can (hopefully) be debugged
better.

I happened to run into a hung UITest_options on Linux, where soffice.bin was
still at

> Thread 1 (Thread 0x7fa6371d9fc0 (LWP 1210042)):
> #0  futex_abstimed_wait_cancelable (private=0, abstime=0x7fa633a17f80, clockid=<optimized out>, expected=0, futex_word=0x60e000024e88) at /usr/src/debug/glibc-2.31-17-gab029a2801/sysdeps/nptl/futex-internal.h:320
> #1  __pthread_cond_wait_common (abstime=0x7fa633a17f80, clockid=<optimized out>, mutex=0x60e000024e38, cond=0x60e000024e60) at /usr/src/debug/glibc-2.31-17-gab029a2801/nptl/pthread_cond_wait.c:520
> #2  __pthread_cond_clockwait (abstime=0x7fa633a17f80, clockid=<optimized out>, mutex=0x60e000024e38, cond=0x60e000024e60) at /usr/src/debug/glibc-2.31-17-gab029a2801/nptl/pthread_cond_wait.c:677
> #3  __pthread_cond_clockwait (cond=0x60e000024e60, mutex=0x60e000024e38, clockid=<optimized out>, abstime=0x7fa633a17f80) at /usr/src/debug/glibc-2.31-17-gab029a2801/nptl/pthread_cond_wait.c:665
> #4  0x00007fa66899be08 in std::condition_variable::__wait_until_impl<std::chrono::duration<long, std::ratio<1l, 1000000000l> > >(std::unique_lock<std::mutex>&, std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&) (this=0x60e000024e60, __lock=..., __atime=...) at include/c++/10.0.1/condition_variable:210
> #5  0x00007fa66899b895 in std::condition_variable::wait_until<std::chrono::duration<long, std::ratio<1l, 1000000000l> > >(std::unique_lock<std::mutex>&, std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&) (this=0x60e000024e60, __lock=..., __atime=...) at include/c++/10.0.1/condition_variable:120
> #6  0x00007fa668997505 in std::condition_variable::wait_until<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> >, SvpSalInstance::DoYield(bool, bool)::$_2>(std::unique_lock<std::mutex>&, std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&, SvpSalInstance::DoYield(bool, bool)::$_2) (this=0x60e000024e60, __lock=..., __atime=..., __p=...) at include/c++/10.0.1/condition_variable:159
> #7  0x00007fa668995460 in std::condition_variable::wait_for<long, std::ratio<1l, 1000l>, SvpSalInstance::DoYield(bool, bool)::$_2>(std::unique_lock<std::mutex>&, std::chrono::duration<long, std::ratio<1l, 1000l> > const&, SvpSalInstance::DoYield(bool, bool)::$_2) (this=0x60e000024e60, __lock=..., __rtime=..., __p=...) at include/c++/10.0.1/condition_variable:186
> #8  0x00007fa66899408e in SvpSalInstance::DoYield(bool, bool) (this=0x611000001bc0, bWait=true, bHandleAllCurrentEvents=false) at vcl/headless/svpinst.cxx:497
> #9  0x00007fa667e7114d in ImplYield(bool, bool) (i_bWait=true, i_bAllEvents=false) at vcl/source/app/svapp.cxx:455
> #10 0x00007fa667e70708 in Application::Yield() () at vcl/source/app/svapp.cxx:519
> #11 0x00007fa66498f6cd in Dialog::Execute() (this=0x618003c16480) at vcl/source/window/dialog.cxx:1030
> #12 0x00007fa667a93812 in SalInstanceDialog::run() (this=0x616000575780) at vcl/source/app/salvtables.cxx:1482
> #13 0x00007fa2e8711b8d in weld::DialogController::run() (this=0x60c004e70d80) at include/vcl/weld.hxx:2289
> #14 0x00007fa2e98a6cbc in OfaTreeOptionsDialog::run() (this=0x60c004e70d80) at cui/source/options/treeopt.cxx:1937
> #15 0x00007fa2e90c4d15 in CuiAbstractController_Impl::Execute() (this=0x60300187b4f0) at cui/source/factory/dlgfact.cxx:103
> #16 0x00007fa688bc9b2d in SfxApplication::OfaExec_Impl(SfxRequest&) (this=0x604006f2fe10, rReq=...) at sfx2/source/appl/appserv.cxx:1311
> #17 0x00007fa688b17655 in SfxStubSfxApplicationOfaExec_Impl(SfxShell*, SfxRequest&) (pShell=0x604006f2fe10, rReq=...) at workdir/SdiTarget/sfx2/sdi/sfxslots.hxx:1270
> #18 0x00007fa6892521f6 in SfxShell::CallExec(void (*)(SfxShell*, SfxRequest&), SfxRequest&) (this=0x604006f2fe10, pFunc=0x7fa688b17530 <SfxStubSfxApplicationOfaExec_Impl(SfxShell*, SfxRequest&)>, rReq=...) at include/sfx2/shell.hxx:197
> #19 0x00007fa6891dbb1f in SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, SfxRequest&, bool) (this=0x6020013430b0, rShell=..., rSlot=..., rReq=..., bRecord=true) at sfx2/source/control/dispatch.cxx:252
> #20 0x00007fa6891defd6 in SfxDispatcher::PostMsgHandler(std::unique_ptr<SfxRequest, std::default_delete<SfxRequest> >) (this=0x6020013430b0, pReq=std::unique_ptr<class SfxRequest> = {...}) at sfx2/source/control/dispatch.cxx:989
[...]

but the Python process was already at

> Traceback (most recent call first):
>   <built-in method waitpid of module object at remote 0x60800002d140>
>   File "instdir/program/python-core-3.7.7/lib/subprocess.py", line 1611, in _try_wait
>     (pid, sts) = os.waitpid(self.pid, wait_flags)
>   File "instdir/program/python-core-3.7.7/lib/subprocess.py", line 1653, in _wait
>     (pid, sts) = self._try_wait(0)
>   File "instdir/program/python-core-3.7.7/lib/subprocess.py", line 1019, in wait
>     return self._wait(timeout=timeout)
>   File "uitest/libreoffice/connection.py", line 133, in tearDown
>     ret = self.soffice.wait()
>   File "uitest/libreoffice/connection.py", line 178, in tearDown
>     self.connection.tearDown()
>   File "uitest/uitest/framework.py", line 46, in tearDown
>     self.connection.tearDown()
>   File "instdir/program/python-core-3.7.7/lib/unittest/case.py", line 631, in run
>     self.tearDown()
>   File "instdir/program/python-core-3.7.7/lib/unittest/case.py", line 676, in __call__
>     return self.run(*args, **kwds)
>   File "instdir/program/python-core-3.7.7/lib/unittest/suite.py", line 122, in run
>     test(result)
>   File "instdir/program/python-core-3.7.7/lib/unittest/suite.py", line 84, in __call__
>     return self.run(*args, **kwds)
>   File "instdir/program/python-core-3.7.7/lib/unittest/runner.py", line 176, in run
>     test(result)
>   File "uitest/test_main.py", line 128, in <module>
>     result = unittest.TextTestRunner(stream=sys.stdout, verbosity=2).run(test_suite)

and the relevant

> ======================================================================
> ERROR: test_tdf78133_options_app_colors (tdf78133.tdf78133)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "sw/qa/uitest/options/tdf78133.py", line 38, in test_tdf78133_options_app_colors
>     self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog")  #optionsdialog
>   File "uitest/uitest/test.py", line 78, in execute_dialog_through_command
>     raise DialogNotExecutedException(command)
> uitest.test.DialogNotExecutedException: Dialog not executed for: .uno:OptionsTreeDialog

had not yet been written to workdir/UITest/options/done.log (Python's unittest
appears to unhelpfully hold back such vital information until the very end of
the full test run).

There appears to be no test code that relies on a timed-out
execute_dialog_through_command throwing an exception instead of hanging (at
least, there is no explicit catching of DialogNotExecutedException anywhere in
the code, and a full `make check screenshot` on Linux kept working with this
change).

(This is similar to 19d3dba "Do not time out
close_dialog_through_button".)

Change-Id: Ie907a091ae09b59e65c4b2676298e147c9d2da2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94786
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
tdf-gerrit pushed a commit that referenced this pull request May 27, 2020
Unfortunately, this isn't fully functional, but
didn't want to lose the effort. The problem is
that there is no proper config for languages
in the unit-tests. So even when we set the
language explicitly, it still doesn't apply
to the SpellCheckerDispatcher, which is
where it matters. This seems to be because
the config is not properly propagated and
broadcast. Below is the stacktrace as
works on desktop. During the unittest
the Broadcaster has no change listener
for LngSvcMgr, so SpellCheckerDispatcher::SetServiceList
doesn't get called.

 #0  0x00007f47f3fed7e6 in SpellCheckerDispatcher::SetServiceList(com::sun::star::lang::Locale const&, com::sun::star::uno::Sequence<rtl::OUString> const&)
     (this=0x5589de40e7a0, rLocale=..., rSvcImplNames=uno::Sequence of length 1 = {...}) at /home/ash/prj/master/linguistic/source/spelldsp.cxx:795
 #1  0x00007f47f3fcc0ad in LngSvcMgr::Notify(com::sun::star::uno::Sequence<rtl::OUString> const&) (this=0x5589de43b4e0, rPropertyNames=uno::Sequence of length 4 = {...})
     at /home/ash/prj/master/linguistic/source/lngsvcmgr.cxx:826
 #2  0x00007f47fa2d3c8d in utl::ConfigItem::CallNotify(com::sun::star::uno::Sequence<rtl::OUString> const&) (this=0x5589de43b530, rPropertyNames=uno::Sequence of length 4 = {...})
     at /home/ash/prj/master/unotools/source/config/configitem.cxx:181
 #3  0x00007f47fa2d3946 in utl::ConfigChangeListener_Impl::changesOccurred(com::sun::star::util::ChangesEvent const&) (this=0x5589de464b90, rEvent=...)
     at /home/ash/prj/master/unotools/source/config/configitem.cxx:143
 #4  0x00007f47e273bb61 in configmgr::Broadcaster::send() (this=0x7ffcc604c5b0) at /home/ash/prj/master/configmgr/source/broadcaster.cxx:182
 #5  0x00007f47e277f002 in configmgr::RootAccess::commitChanges() (this=0x5589dd557400) at /home/ash/prj/master/configmgr/source/rootaccess.cxx:171
 #6  0x00007f47fa2d80e3 in utl::ConfigItem::ReplaceSetProperties(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)
     (this=0x5589dd5571b0, rNode="ServiceManager/SpellCheckerList", rValues=uno::Sequence of length 4 = {...}) at /home/ash/prj/master/unotools/source/config/configitem.cxx:1025
 #7  0x00007f47fa339983 in SvtLinguConfig::ReplaceSetProperties(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)
     (this=0x7ffcc604cb40, rNode="ServiceManager/SpellCheckerList", rValues=uno::Sequence of length 4 = {...}) at /home/ash/prj/master/unotools/source/config/lingucfg.cxx:847
 #8  0x00007f47f3fcb88f in LngSvcMgr::UpdateAll() (this=0x5589de43b4e0) at /home/ash/prj/master/linguistic/source/lngsvcmgr.cxx:765
 #9  0x00007f47f3fc9caa in LngSvcMgr::LngSvcMgr() (this=0x5589de43b4e0) at /home/ash/prj/master/linguistic/source/lngsvcmgr.cxx:438
 #10 0x00007f47f3fd3baf in LngSvcMgr_CreateInstance(com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> const&) ()
     at /home/ash/prj/master/linguistic/source/lngsvcmgr.cxx:1967
 #11 0x00007f4800e9656b in cppu::OSingleFactoryHelper::createInstanceEveryTime(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) (this=0x5589de3ccfc8, xContext=
     uno::Reference to (cppu::ComponentContext *) 0x5589dbcca630) at /home/ash/prj/master/cppuhelper/source/factory.cxx:149
 #12 0x00007f4800e96790 in cppu::OSingleFactoryHelper::createInstanceWithContext(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&)
     (this=0x5589de3ccfc8, xContext=uno::Reference to (cppu::ComponentContext *) 0x5589dbcca630) at /home/ash/prj/master/cppuhelper/source/factory.cxx:175
 #13 0x00007f4800e97107 in cppu::OFactoryComponentHelper::createInstanceWithContext(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&)
     (this=0x5589de3ccf60, xContext=uno::Reference to (cppu::ComponentContext *) 0x5589dbcca630) at /home/ash/prj/master/cppuhelper/source/factory.cxx:374
 #14 0x00007f4800eebc8f in cppuhelper::ServiceManager::Data::Implementation::createInstance(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, bool)
     (this=0x5589dbd2f030, context=uno::Reference to (cppu::ComponentContext *) 0x5589dbcca630, singletonRequest=false) at /home/ash/prj/master/cppuhelper/source/servicemanager.cxx:667
 #15 0x00007f4800eee587 in cppuhelper::ServiceManager::createInstanceWithContext(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&)
     (this=0x5589dbcbaaf0, aServiceSpecifier="com.sun.star.linguistic2.LinguServiceManager", Context=uno::Reference to (cppu::ComponentContext *) 0x5589dbcca630)
     at /home/ash/prj/master/cppuhelper/source/servicemanager.cxx:991
 #16 0x00007f4800776778 in com::sun::star::linguistic2::LinguServiceManager::create(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&)
     (the_context=uno::Reference to (cppu::ComponentContext *) 0x5589dbcca630)
     at /home/ash/prj/master/workdir/UnoApiHeadersTarget/offapi/normal/com/sun/star/linguistic2/LinguServiceManager.hpp:38
 #17 0x00007f4800772d51 in GetLngSvcMgr_Impl() () at /home/ash/prj/master/editeng/source/misc/unolingu.cxx:66
 #18 0x00007f4800773449 in SpellDummy_Impl::GetSpell_Impl() (this=0x5589dd82f420) at /home/ash/prj/master/editeng/source/misc/unolingu.cxx:217
 #19 0x00007f4800773614 in SpellDummy_Impl::isValid(rtl::OUString const&, short, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)
     (this=0x5589dd82f420, rWord="a", nLanguage=1033, rProperties=empty uno::Sequence) at /home/ash/prj/master/editeng/source/misc/unolingu.cxx:249
 #20 0x00007f48006ae4c2 in ImpEditEngine::DoOnlineSpelling(ContentNode*, bool, bool) (this=0x5589de195060, pThisNodeOnly=0x0, bSpellAtCursorPos=false, bInterruptible=true)
     at /home/ash/prj/master/editeng/source/editeng/impedit4.cxx:2306
 #21 0x00007f480067d0d2 in ImpEditEngine::OnlineSpellHdl(Timer*) (this=0x5589de195060) at /home/ash/prj/master/editeng/source/editeng/impedit3.cxx:322

(cherry picked from commit 4f77bd94028a140133814d735c0425bbd0de4839)
Reviewed-on: https://gerrit.libreoffice.org/85007
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
(cherry picked from commit 66c1f6b)
Reviewed-on: https://gerrit.libreoffice.org/85683
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>

Change-Id: Iffef03502c78311427aa8883739678120cc84931
tdf-gerrit pushed a commit that referenced this pull request Apr 7, 2021
...introduced with 244a447 "Make Pivot table
data source dialog async", as seen e.g. during UITest_calc_tests8:

> ==1217030==ERROR: AddressSanitizer: stack-use-after-return on address 0x7f06d7133444 at pc 0x7f069f0cb613 bp 0x7ffe24058430 sp 0x7ffe24058428
> WRITE of size 2 at 0x7f06d7133444 thread T0
>  #0 in ScAddress::operator=(ScAddress const&) at sc/inc/address.hxx:415:10
>  #1 in ScCellShell::ExecuteDataPilotDialog()::$_4::operator()(int) const at sc/source/ui/view/cellsh1.cxx:3014:42
>  #2 in void std::__invoke_impl<void, ScCellShell::ExecuteDataPilotDialog()::$_4&, int>(std::__invoke_other, ScCellShell::ExecuteDataPilotDialog()::$_4&, int&&) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.0/../../../../include/c++/11.0.0/bits/invoke.h:60:14
>  #3 in std::enable_if<is_invocable_r_v<void, ScCellShell::ExecuteDataPilotDialog()::$_4&, int>, void>::type std::__invoke_r<void, ScCellShell::ExecuteDataPilotDialog()::$_4&, int>(ScCellShell::ExecuteDataPilotDialog()::$_4&, int&&) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.0/../../../../include/c++/11.0.0/bits/invoke.h:110:2
>  #4 in std::_Function_handler<void (int), ScCellShell::ExecuteDataPilotDialog()::$_4>::_M_invoke(std::_Any_data const&, int&&) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.0/../../../../include/c++/11.0.0/bits/std_function.h:291:9
>  #5 in std::function<void (int)>::operator()(int) const at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.0/../../../../include/c++/11.0.0/bits/std_function.h:560:9
>  #6 in Dialog::EndDialog(long) at vcl/source/window/dialog.cxx:1137:9
>  #7 in Dialog::ResponseHdl(Button*) at vcl/source/window/dialog.cxx:1391:5
>  #8 in Dialog::LinkStubResponseHdl(void*, Button*) at vcl/source/window/dialog.cxx:1376:1
>  #9 in Link<Button*, void>::Call(Button*) const at include/tools/link.hxx:111:45
>  #10 in Button::Click()::$_0::operator()() const at vcl/source/control/button.cxx:124:87
>  #11 in void std::__invoke_impl<void, Button::Click()::$_0&>(std::__invoke_other, Button::Click()::$_0&) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.0/../../../../include/c++/11.0.0/bits/invoke.h:60:14
>  #12 in std::enable_if<is_invocable_r_v<void, Button::Click()::$_0&>, void>::type std::__invoke_r<void, Button::Click()::$_0&>(Button::Click()::$_0&) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.0/../../../../include/c++/11.0.0/bits/invoke.h:110:2
>  #13 in std::_Function_handler<void (), Button::Click()::$_0>::_M_invoke(std::_Any_data const&) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.0/../../../../include/c++/11.0.0/bits/std_function.h:291:9
>  #14 in std::function<void ()>::operator()() const at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.0/../../../../include/c++/11.0.0/bits/std_function.h:560:9
>  #15 in Control::ImplCallEventListenersAndHandler(VclEventId, std::function<void ()> const&) at vcl/source/control/ctrl.cxx:315:13
>  #16 in Button::Click() at vcl/source/control/button.cxx:124:5
>  #17 in ButtonUIObject::execute(rtl::OUString const&, std::__debug::map<rtl::OUString const, rtl::OUString, std::less<rtl::OUString const>, std::allocator<std::pair<rtl::OUString const, rtl::OUString> > > const&) at vcl/source/uitest/uiobject.cxx:614:19
>  #18 in UIObjectUnoObj::executeAction(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)::$_0::operator()() const at vcl/source/uitest/uno/uiobject_uno.cxx:124:16
>  #19 in void std::__invoke_impl<void, UIObjectUnoObj::executeAction(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)::$_0&>(std::__invoke_other, UIObjectUnoObj::executeAction(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)::$_0&) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.0/../../../../include/c++/11.0.0/bits/invoke.h:60:14
>  #20 in std::enable_if<is_invocable_r_v<void, UIObjectUnoObj::executeAction(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)::$_0&>, void>::type std::__invoke_r<void, UIObjectUnoObj::executeAction(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)::$_0&>(UIObjectUnoObj::executeAction(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)::$_0&) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.0/../../../../include/c++/11.0.0/bits/invoke.h:110:2
>  #21 in std::_Function_handler<void (), UIObjectUnoObj::executeAction(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)::$_0>::_M_invoke(std::_Any_data const&) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.0/../../../../include/c++/11.0.0/bits/std_function.h:291:9
>  #22 in std::function<void ()>::operator()() const at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.0/../../../../include/c++/11.0.0/bits/std_function.h:560:9
>  #23 in (anonymous namespace)::ExecuteWrapper::ExecuteActionHdl(Timer*) at vcl/source/uitest/uno/uiobject_uno.cxx:83:13
>  #24 in (anonymous namespace)::ExecuteWrapper::LinkStubExecuteActionHdl(void*, Timer*) at vcl/source/uitest/uno/uiobject_uno.cxx:78:1
>  #25 in Link<Timer*, void>::Call(Timer*) const at include/tools/link.hxx:111:45
>  #26 in Timer::Invoke() at vcl/source/app/timer.cxx:75:21
>  #27 in Scheduler::ProcessTaskScheduling() at vcl/source/app/scheduler.cxx:486:20
>  #28 in Scheduler::CallbackTaskScheduling() at vcl/source/app/scheduler.cxx:288:5
>  #29 in SalTimer::CallCallback() at vcl/inc/saltimer.hxx:54:13
>  #30 in SvpSalInstance::CheckTimeout(bool) at vcl/headless/svpinst.cxx:210:53
>  #31 in SvpSalInstance::DoYield(bool, bool) at vcl/headless/svpinst.cxx:463:21
>  #32 in ImplYield(bool, bool) at vcl/source/app/svapp.cxx:447:48
>  #33 in Application::Yield() at vcl/source/app/svapp.cxx:511:5
>  #34 in Application::Execute() at vcl/source/app/svapp.cxx:426:9
>  #35 in desktop::Desktop::Main() at desktop/source/app/app.cxx:1588:13
>  #36 in ImplSVMain() at vcl/source/app/svmain.cxx:196:35
>  #37 in SVMain() at vcl/source/app/svmain.cxx:228:12
>  #38 in soffice_main at desktop/source/app/sofficemain.cxx:98:12
>  #39 in sal_main at desktop/source/app/main.c:49:15
>  #40 in main at desktop/source/app/main.c:47:1

Change-Id: I7ff5148f4bf9170fc7add312053de5acc153125b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106919
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
tdf-gerrit pushed a commit that referenced this pull request Jul 21, 2021
Skip attributes with empty string value in
'Qt5AccessibleWidget::attributes'.

Besides not being a useful value, I also
got a crash using Accerciser to navigate in Calc's
"Format Cells" dialog -> "Font Effects" -> "Text Decoration"
-> "Overlining" -> "Overlining".

'Qt5AccessibleWidget::attributes' had returned
"font-family:;font-size:0pt;font-weight:normal;"
and 'AtSpiAdaptor::getAttributes' (from the Qt library)
aborts, since it splits the "font-family:" part at the colon,
then expects two substrings: one for the attribute name, one
for the value - but there was no value set:

    QString joined = interface->textInterface()->attributes(offset, &startOffset, &endOffset);
    const QStringList attributes = joined.split (QLatin1Char(';'), Qt::SkipEmptyParts, Qt::CaseSensitive);
    for (const QString &attr : attributes) {
        QStringList items;
        items = attr.split(QLatin1Char(':'), Qt::SkipEmptyParts, Qt::CaseSensitive);
->      AtSpiAttribute attribute = atspiTextAttribute(items[0], items[1]);
        if (!attribute.isNull())
            set[attribute.name] = attribute.value;
    }

The IAccessible2 spec for the "background-color" text attribute [1]
doesn't specify any default value to be used.

Backtrace:

    Thread 1 received signal SIGABRT, Aborted.
        __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
        50      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
        (rr) bt
    #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
    #1  0x00007f4dcd0bd537 in __GI_abort () at abort.c:79
    #2  0x00007f4dba7fd810 in qt_message_fatal(QtMsgType, QMessageLogContext const&, QString const&) (context=..., message=...) at global/qlogging.cpp:1914
    #3  0x00007f4dba7f9d48 in QMessageLogger::fatal(char const*, ...) const (this=0x7ffc30a4a6b0, msg=0x7f4dbab9ebb0 "ASSERT failure in %s: \"%s\", file %s, line %d") at global/qlogging.cpp:893
    #4  0x00007f4dba7f1484 in qt_assert_x(char const*, char const*, char const*, int) (where=0x7f4db778eb36 "QList<T>::operator[]", what=0x7f4db778eac8 "index out of range", file=0x7f4db778ea90 "../../../include/QtCore/../../src/corelib/tools/qlist.h", line=579)
            at global/qglobal.cpp:3366
    #5  0x00007f4db7736a65 in QList<QString>::operator[](int) (this=0x7ffc30a4a730, i=1) at ../../../include/QtCore/../../src/corelib/tools/qlist.h:579
    #6  0x00007f4db773017e in AtSpiAdaptor::getAttributes(QAccessibleInterface*, int, bool) const (this=0x557748f27800, interface=0x7f4d8c07cc30, offset=9, includeDefaults=true) at atspiadaptor.cpp:2059
    #7  0x00007f4db772cd74 in AtSpiAdaptor::textInterface(QAccessibleInterface*, QString const&, QDBusMessage const&, QDBusConnection const&) (this=0x557748f27800, interface=0x7f4d8c07cc30, function=..., message=..., connection=...) at atspiadaptor.cpp:1802
    #8  0x00007f4db77274f8 in AtSpiAdaptor::handleMessage(QDBusMessage const&, QDBusConnection const&) (this=0x557748f27800, message=..., connection=...) at atspiadaptor.cpp:1286
    #9  0x00007f4db7fe4d04 in QDBusConnectionPrivate::activateObject(QDBusConnectionPrivate::ObjectTreeNode&, QDBusMessage const&, int) (this=0x7f4d8c014b00, node=..., msg=..., pathStartPos=27) at qdbusintegrator.cpp:1458
    #10 0x00007f4db7fe58ca in QDBusActivateObjectEvent::placeMetaCall(QObject*) (this=0x557753615310) at qdbusintegrator.cpp:1617
    #11 0x00007f4dbaab3c66 in QObject::event(QEvent*) (this=0x557748f27800, e=0x557753615310) at kernel/qobject.cpp:1314
    #12 0x00007f4db96be845 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=0x557747e30970, receiver=0x557748f27800, e=0x557753615310) at kernel/qapplication.cpp:3632
    #13 0x00007f4db96bbcfb in QApplication::notify(QObject*, QEvent*) (this=0x557747f1d8b0, receiver=0x557748f27800, e=0x557753615310) at kernel/qapplication.cpp:2972
    #14 0x00007f4dbaa70aba in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x557748f27800, event=0x557753615310) at kernel/qcoreapplication.cpp:1064
    #15 0x00007f4dbaa71452 in QCoreApplication::sendEvent(QObject*, QEvent*) (receiver=0x557748f27800, event=0x557753615310) at kernel/qcoreapplication.cpp:1462
    #16 0x00007f4dbaa7213a in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (receiver=0x0, event_type=0, data=0x557747eff460) at kernel/qcoreapplication.cpp:1821
    #17 0x00007f4dbaa71acc in QCoreApplication::sendPostedEvents(QObject*, int) (receiver=0x0, event_type=0) at kernel/qcoreapplication.cpp:1680
    #18 0x00007f4dbaaff079 in postEventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=0x557748056a30) at kernel/qeventdispatcher_glib.cpp:277
    #19 0x00007f4dbfe4ce6b in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #20 0x00007f4dbfe4d118 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #21 0x00007f4dbfe4d1cf in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #22 0x00007f4dbaaff7a2 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x557748062a70, flags=...) at kernel/qeventdispatcher_glib.cpp:423
    #23 0x00007f4db76af8fc in QXcbGlibEventDispatcher::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x557748062a70, flags=...) at qxcbeventdispatcher.cpp:143
    #24 0x00007f4db9255353 in Qt5Instance::DoYield(bool, bool) (this=0x557747f22580, bWait=4, bHandleAllCurrentEvents=2) at .../libreoffice/vcl/qt5/Qt5Instance.cxx:400
    #25 0x00007f4db9255465 in Qt5Instance::AnyInput(VclInputFlags) (this=0xd87f0c9bbde3ed00, nType=(VclInputFlags::PAINT | VclInputFlags::TIMER | VclInputFlags::OTHER | VclInputFlags::APPEVENT | unknown: 0x7fc0))
            at .../libreoffice/vcl/qt5/Qt5Instance.cxx:422
    #26 0x00007f4dc594b64a in ImplYield(bool, bool) (i_bWait=true, i_bAllEvents=false) at .../libreoffice/vcl/source/app/svapp.cxx:465
    #27 0x00007f4dc594be0b in Application::Yield() () at .../libreoffice/vcl/source/app/svapp.cxx:532
    #28 0x00007f4dc594b357 in Application::Execute() () at .../libreoffice/vcl/source/app/svapp.cxx:444
    #29 0x00007f4dcd2c4226 in desktop::Desktop::Main() (this=0x7ffc30a4c540) at .../libreoffice/desktop/source/app/app.cxx:1602
    #30 0x00007f4dc5967cc6 in ImplSVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:199
    #31 0x00007f4dc5967de7 in SVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:231
    #32 0x00007f4dcd324e9f in soffice_main() () at .../libreoffice/desktop/source/app/sofficemain.cxx:98
    #33 0x000055774613895d in sal_main () at .../libreoffice/desktop/source/app/main.c:49
    #34 0x0000557746138943 in main (argc=2, argv=0x7ffc30a4c8b8) at .../libreoffice/desktop/source/app/main.c:47

[1] https://wiki.linuxfoundation.org/accessibility/iaccessible2/textattributes

Change-Id: I5e9d5121e69340ff728a87b4a6cb5c182d9ad11b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119247
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
tdf-gerrit pushed a commit that referenced this pull request Jul 21, 2021
...as seen at least once during UITest_calc_tests9, with thread 1 at

> Thread 1 (Thread 0x7f2c48958fc0 (LWP 439791) "soffice.bin"):
> #0  0x00007f2caa2b17b0 in __lll_lock_wait () at /lib64/libpthread.so.0
> #1  0x00007f2caa2aa553 in pthread_mutex_lock () at /lib64/libpthread.so.0
> #2  0x00007f2ca399275b in __gthread_mutex_lock(pthread_mutex_t*) (__mutex=0x7f2ca40ce020 <cppu::getTypeEntries(cppu::class_data*)::aMutex>) at /home/sbergman/gcc/trunk/inst/include/c++/12.0.0/x86_64-pc-linux-gnu/bits/gthr-default.h:749
> #3  0x00007f2ca39948cb in std::mutex::lock() (this=0x7f2ca40ce020 <cppu::getTypeEntries(cppu::class_data*)::aMutex>) at /home/sbergman/gcc/trunk/inst/include/c++/12.0.0/bits/std_mutex.h:100
> #4  0x00007f2ca39940eb in std::lock_guard<std::mutex>::lock_guard(std::mutex&) (this=0x7f2c4752d820, __m=...) at /home/sbergman/gcc/trunk/inst/include/c++/12.0.0/bits/std_mutex.h:229
> #5  0x00007f2ca3990fdb in cppu::getTypeEntries(cppu::class_data*) (cd=0x7f2c3eda4640 <cppu::detail::ImplClassData<cppu::WeakImplHelper<com::sun::star::i18n::XCollator, com::sun::star::lang::XServiceInfo>, com::sun::star::i18n::XCollator, com::sun::star::lang::XServiceInfo>::operator()()::s_cd>) at /home/sbergman/lo/core/cppuhelper/source/implbase_ex.cxx:71
> #6  0x00007f2ca398c616 in cppu::queryDeepNoXInterface(_typelib_TypeDescriptionReference const*, cppu::class_data*, void*) (pDemandedTDR=0x60f00020ec60, cd=0x7f2c3eda4640 <cppu::detail::ImplClassData<cppu::WeakImplHelper<com::sun::star::i18n::XCollator, com::sun::star::lang::XServiceInfo>, com::sun::star::i18n::XCollator, com::sun::star::lang::XServiceInfo>::operator()()::s_cd>, that=0x60e0002a2960) at /home/sbergman/lo/core/cppuhelper/source/implbase_ex.cxx:155
> #7  0x00007f2ca398ea93 in cppu::WeakImplHelper_query(com::sun::star::uno::Type const&, cppu::class_data*, void*, cppu::OWeakObject*) (rType=invalid uno::Type, cd=0x7f2c3eda4640 <cppu::detail::ImplClassData<cppu::WeakImplHelper<com::sun::star::i18n::XCollator, com::sun::star::lang::XServiceInfo>, com::sun::star::i18n::XCollator, com::sun::star::lang::XServiceInfo>::operator()()::s_cd>, that=0x60e0002a2960, pBase=0x60e0002a2960) at /home/sbergman/lo/core/cppuhelper/source/implbase_ex.cxx:283
> #8  0x00007f2c3ea61105 in cppu::WeakImplHelper<com::sun::star::i18n::XCollator, com::sun::star::lang::XServiceInfo>::queryInterface(com::sun::star::uno::Type const&) (this=0x60e0002a2960, aType=invalid uno::Type) at /home/sbergman/lo/core/include/cppuhelper/implbase.hxx:111
> #9  0x00007f2c7c491500 in com::sun::star::uno::BaseReference::iquery(com::sun::star::uno::XInterface*, com::sun::star::uno::Type const&) (pInterface=0x60e0002a2960, rType=invalid uno::Type) at /home/sbergman/lo/core/include/com/sun/star/uno/Reference.hxx:59
> #10 0x00007f2c7c8a1165 in com::sun::star::uno::Reference<com::sun::star::i18n::XCollator>::iquery(com::sun::star::uno::XInterface*) (pInterface=0x60e0002a2960) at /home/sbergman/lo/core/include/com/sun/star/uno/Reference.hxx:74
> #11 0x00007f2c7c8a015e in com::sun::star::uno::Reference<com::sun::star::i18n::XCollator>::Reference(com::sun::star::uno::BaseReference const&, com::sun::star::uno::UnoReference_Query) (this=0x7f2c47447020, rRef=...) at /home/sbergman/lo/core/include/com/sun/star/uno/Reference.hxx:176
> #12 0x00007f2c7c89ebaa in com::sun::star::i18n::Collator::create(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) (the_context=uno::Reference to (class cppu::(anonymous namespace)::ComponentContext *) 0x611000005e50) at /home/sbergman/lo/core/workdir/UnoApiHeadersTarget/offapi/normal/com/sun/star/i18n/Collator.hpp:38
> #13 0x00007f2c7c89c324 in CollatorWrapper::CollatorWrapper(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) (this=0x60200097c0f0, rxContext=uno::Reference to (class cppu::(anonymous namespace)::ComponentContext *) 0x611000005e50) at /home/sbergman/lo/core/unotools/source/i18n/collatorwrapper.cxx:30
> #14 0x00007f2c14889098 in ScGlobal::GetCaseCollator()::$_6::operator()() const (this=0x7f2c470e74a0) at /home/sbergman/lo/core/sc/source/core/data/global.cxx:1044
> #15 0x00007f2c14886efc in comphelper::doubleCheckedInit<CollatorWrapper, ScGlobal::GetCaseCollator()::$_6, osl::Guard<osl::Mutex>, osl::GetGlobalMutex>(std::atomic<CollatorWrapper*>&, ScGlobal::GetCaseCollator()::$_6, osl::GetGlobalMutex) (pointer=..., function=..., guardCtor=...) at /home/sbergman/lo/core/include/comphelper/doublecheckedinit.hxx:53
> #16 0x00007f2c14886d1c in ScGlobal::GetCaseCollator() () at /home/sbergman/lo/core/sc/source/core/data/global.cxx:1041
> #17 0x00007f2c1627adde in ScTypedStrData::LessCaseSensitive::operator()(ScTypedStrData const&, ScTypedStrData const&) const (this=0x7f2c471eab20, left=..., right=...) at /home/sbergman/lo/core/sc/source/core/tool/typedstrdata.cxx:26
> #18 0x00007f2c13ad7750 in std::sort<__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<ScTypedStrData*, std::__cxx1998::vector<ScTypedStrData, std::allocator<ScTypedStrData> > >, std::__debug::vector<ScTypedStrData, std::allocator<ScTypedStrData> >, std::random_access_iterator_tag>, ScTypedStrData::LessCaseSensitive>(__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<ScTypedStrData*, std::__cxx1998::vector<ScTypedStrData, std::allocator<ScTypedStrData> > >, std::__debug::vector<ScTypedStrData, std::allocator<ScTypedStrData> >, std::random_access_iterator_tag>, __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<ScTypedStrData*, std::__cxx1998::vector<ScTypedStrData, std::allocator<ScTypedStrData> > >, std::__debug::vector<ScTypedStrData, std::allocator<ScTypedStrData> >, std::random_access_iterator_tag>, ScTypedStrData::LessCaseSensitive) at /home/sbergman/gcc/trunk/inst/include/c++/12.0.0/bits/stl_algo.h:4873
> #19 0x00007f2c13ab544d in (anonymous namespace)::sortAndRemoveDuplicates(std::__debug::vector<ScTypedStrData, std::allocator<ScTypedStrData> >&, bool) (rStrings=std::__debug::vector of length 1, capacity 1 = {...}, bCaseSens=true) at /home/sbergman/lo/core/sc/source/core/data/documen3.cxx:86
> #20 0x00007f2c13ab6bc9 in ScDocument::GetDataEntries(short, int, short, std::__debug::vector<ScTypedStrData, std::allocator<ScTypedStrData> >&, bool) (this=0x61e0000505c0, nCol=0, nRow=1, nTab=0, rStrings=std::__debug::vector of length 1, capacity 1 = {...}, bValidation=false) at /home/sbergman/lo/core/sc/source/core/data/documen3.cxx:1650
> #21 0x00007f2c1708a56e in ScInputHandler::GetColData() (this=0x614000068840) at /home/sbergman/lo/core/sc/source/ui/app/inputhdl.cxx:1943
> #22 0x00007f2c1709e132 in ScInputHandler::StartTable(char16_t, bool, bool, ScEditEngineDefaulter*) (this=0x614000068840, cTyped=66 u'B', bFromCommand=false, bInputActivated=false, pTopEngine=0x0) at /home/sbergman/lo/core/sc/source/ui/app/inputhdl.cxx:2501
> #23 0x00007f2c17057bc0 in ScInputHandler::DataChanging(char16_t, bool) (this=0x614000068840, cTyped=66 u'B', bFromCommand=false) at /home/sbergman/lo/core/sc/source/ui/app/inputhdl.cxx:2605
> #24 0x00007f2c170ad948 in ScInputHandler::KeyInput(KeyEvent const&, bool) (this=0x614000068840, rKEvt=..., bStartEdit=true) at /home/sbergman/lo/core/sc/source/ui/app/inputhdl.cxx:3714
> #25 0x00007f2c1723ac2b in ScModule::InputKeyEvent(KeyEvent const&, bool) (this=0x616000223880, rKEvt=..., bStartEdit=true) at /home/sbergman/lo/core/sc/source/ui/app/scmod.cxx:1356
> #26 0x00007f2c19ce48c9 in ScTabViewShell::TabKeyInput(KeyEvent const&) (this=0x61e000051080, rKEvt=...) at /home/sbergman/lo/core/sc/source/ui/view/tabvwsh4.cxx:1278
> #27 0x00007f2c196183ce in ScGridWindow::KeyInput(KeyEvent const&) (this=0x618000ee6880, rKEvt=...) at /home/sbergman/lo/core/sc/source/ui/view/gridwin.cxx:3414
> #28 0x00007f2c775e963f in WindowUIObject::execute(rtl::OUString const&, std::__debug::map<rtl::OUString, rtl::OUString, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, rtl::OUString> > > const&) at /home/sbergman/lo/core/vcl/source/uitest/uiobject.cxx:357
> #29 0x00007f2c186a5929 in ScGridWinUIObject::execute(rtl::OUString const&, std::__debug::map<rtl::OUString, rtl::OUString, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, rtl::OUString> > > const&) at /home/sbergman/lo/core/sc/source/ui/uitest/uiobject.cxx:317
> #30 0x00007f2c7766d9ba in UIObjectUnoObj::executeAction(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)::$_0::operator()() const (this=0x603000f61240) at /home/sbergman/lo/core/vcl/source/uitest/uno/uiobject_uno.cxx:137
> #31 0x00007f2c7766d0dd in std::__invoke_impl<void, UIObjectUnoObj::executeAction(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)::$_0&>(std::__invoke_other, UIObjectUnoObj::executeAction(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)::$_0&) (__f=...) at /home/sbergman/gcc/trunk/inst/include/c++/12.0.0/bits/invoke.h:61
> #32 0x00007f2c7766cf8d in std::__invoke_r<void, UIObjectUnoObj::executeAction(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)::$_0&>(UIObjectUnoObj::executeAction(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)::$_0&) (__fn=...) at /home/sbergman/gcc/trunk/inst/include/c++/12.0.0/bits/invoke.h:111
> #33 0x00007f2c7766ca9d in std::_Function_handler<void (), UIObjectUnoObj::executeAction(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)::$_0>::_M_invoke(std::_Any_data const&) (__functor=...) at /home/sbergman/gcc/trunk/inst/include/c++/12.0.0/bits/std_function.h:291
> #34 0x00007f2c744b3c22 in std::function<void ()>::operator()() const (this=0x6070001d4d80) at /home/sbergman/gcc/trunk/inst/include/c++/12.0.0/bits/std_function.h:560
> #35 0x00007f2c7766c35c in (anonymous namespace)::ExecuteWrapper::ExecuteActionHdl(Timer*) (this=0x6070001d4d80) at /home/sbergman/lo/core/vcl/source/uitest/uno/uiobject_uno.cxx:100
> #36 0x00007f2c77668e29 in (anonymous namespace)::ExecuteWrapper::LinkStubExecuteActionHdl(void*, Timer*) (instance=0x6070001d4d80, data=0x608000148e20) at /home/sbergman/lo/core/vcl/source/uitest/uno/uiobject_uno.cxx:95
> #37 0x00007f2c76c645de in Link<Timer*, void>::Call(Timer*) const (this=0x608000148e40, data=0x608000148e20) at /home/sbergman/lo/core/include/tools/link.hxx:111
> #38 0x00007f2c76c63b7d in Timer::Invoke() (this=0x608000148e20) at /home/sbergman/lo/core/vcl/source/app/timer.cxx:75
> #39 0x00007f2c76abfd6c in Scheduler::CallbackTaskScheduling() () at /home/sbergman/lo/core/vcl/source/app/scheduler.cxx:471
> #40 0x00007f2c77b9a1a4 in SalTimer::CallCallback() (this=0x6030002f0bc0) at /home/sbergman/lo/core/vcl/inc/saltimer.hxx:54
> #41 0x00007f2c77b8dda1 in SvpSalInstance::CheckTimeout(bool) (this=0x611000001bc0, bExecuteTimers=true) at /home/sbergman/lo/core/vcl/headless/svpinst.cxx:215
> #42 0x00007f2c77b949a0 in SvpSalInstance::DoYield(bool, bool) (this=0x611000001bc0, bWait=true, bHandleAllCurrentEvents=false) at /home/sbergman/lo/core/vcl/headless/svpinst.cxx:460
> #43 0x00007f2c76bb2462 in ImplYield(bool, bool) (i_bWait=true, i_bAllEvents=false) at /home/sbergman/lo/core/vcl/source/app/svapp.cxx:465
> #44 0x00007f2c76bb1588 in Application::Yield() () at /home/sbergman/lo/core/vcl/source/app/svapp.cxx:532
> #45 0x00007f2c76bb11bf in Application::Execute() () at /home/sbergman/lo/core/vcl/source/app/svapp.cxx:444
> #46 0x00007f2caae21016 in desktop::Desktop::Main() (this=0x7f2c472b8080) at /home/sbergman/lo/core/desktop/source/app/app.cxx:1602

having locked the osl global mutex in comphelper::doubleCheckedInit in frame 15
and trying to lock the cppu::getTypeEntries mutex, while thread 4 at

> Thread 4 (Thread 0x7f2c275b6640 (LWP 440147) "InitUpdateCheck"):
> #0  0x00007f2caa2b17b0 in __lll_lock_wait () at /lib64/libpthread.so.0
> #1  0x00007f2caa2aa5d0 in pthread_mutex_lock () at /lib64/libpthread.so.0
> #2  0x00007f2cabc21967 in osl_acquireMutex(oslMutex) (pMutex=0x604000090d50) at /home/sbergman/lo/core/sal/osl/unx/mutex.cxx:100
> #3  0x00007f2bf58684da in osl::Mutex::acquire() (this=0x7f2cabe45c60 <osl_getGlobalMutex::g_Mutex>) at /home/sbergman/lo/core/include/osl/mutex.hxx:61
> #4  0x00007f2bf586694a in osl::Guard<osl::Mutex>::Guard(osl::Mutex*) (this=0x7f2c262d7420, pT_=0x7f2cabe45c60 <osl_getGlobalMutex::g_Mutex>) at /home/sbergman/lo/core/include/osl/mutex.hxx:135
> #5  0x00007f2bf58762f9 in com::sun::star::lang::cppu_detail_getUnoType(com::sun::star::lang::XServiceInfo const*) () at /home/sbergman/lo/core/workdir/UnoApiHeadersTarget/udkapi/normal/com/sun/star/lang/XServiceInfo.hpp:73
> #6  0x00007f2bf5875f09 in cppu::UnoType<com::sun::star::lang::XServiceInfo>::get() () at /home/sbergman/lo/core/include/cppu/unotype.hxx:300
> #7  0x00007f2bf5875ce9 in com::sun::star::lang::XServiceInfo::static_type(void*) () at /home/sbergman/lo/core/workdir/UnoApiHeadersTarget/udkapi/normal/com/sun/star/lang/XServiceInfo.hpp:145
> #8  0x00007f2ca39913be in cppu::getTypeEntries(cppu::class_data*) (cd=0x7f2bf58c73a8 <cppu::detail::ImplClassData<cppu::WeakImplHelper<com::sun::star::deployment::XUpdateInformationProvider, com::sun::star::ucb::XWebDAVCommandEnvironment, com::sun::star::lang::XServiceInfo>, com::sun::star::deployment::XUpdateInformationProvider, com::sun::star::ucb::XWebDAVCommandEnvironment, com::sun::star::lang::XServiceInfo>::operator()()::s_cd>) at /home/sbergman/lo/core/cppuhelper/source/implbase_ex.cxx:78
> #9  0x00007f2ca398c616 in cppu::queryDeepNoXInterface(_typelib_TypeDescriptionReference const*, cppu::class_data*, void*) (pDemandedTDR=0x60f0001cf420, cd=0x7f2bf58c73a8 <cppu::detail::ImplClassData<cppu::WeakImplHelper<com::sun::star::deployment::XUpdateInformationProvider, com::sun::star::ucb::XWebDAVCommandEnvironment, com::sun::star::lang::XServiceInfo>, com::sun::star::deployment::XUpdateInformationProvider, com::sun::star::ucb::XWebDAVCommandEnvironment, com::sun::star::lang::XServiceInfo>::operator()()::s_cd>, that=0x60e00022e7c0) at /home/sbergman/lo/core/cppuhelper/source/implbase_ex.cxx:155
> #10 0x00007f2ca398ea93 in cppu::WeakImplHelper_query(com::sun::star::uno::Type const&, cppu::class_data*, void*, cppu::OWeakObject*) (rType=invalid uno::Type, cd=0x7f2bf58c73a8 <cppu::detail::ImplClassData<cppu::WeakImplHelper<com::sun::star::deployment::XUpdateInformationProvider, com::sun::star::ucb::XWebDAVCommandEnvironment, com::sun::star::lang::XServiceInfo>, com::sun::star::deployment::XUpdateInformationProvider, com::sun::star::ucb::XWebDAVCommandEnvironment, com::sun::star::lang::XServiceInfo>::operator()()::s_cd>, that=0x60e00022e7c0, pBase=0x60e00022e7c0) at /home/sbergman/lo/core/cppuhelper/source/implbase_ex.cxx:283
> #11 0x00007f2bf58629e5 in cppu::WeakImplHelper<com::sun::star::deployment::XUpdateInformationProvider, com::sun::star::ucb::XWebDAVCommandEnvironment, com::sun::star::lang::XServiceInfo>::queryInterface(com::sun::star::uno::Type const&) (this=0x60e00022e7c0, aType=invalid uno::Type) at /home/sbergman/lo/core/include/cppuhelper/implbase.hxx:111
> #12 0x00007f2c3015cf60 in com::sun::star::uno::BaseReference::iquery(com::sun::star::uno::XInterface*, com::sun::star::uno::Type const&) (pInterface=0x60e00022e7c0, rType=invalid uno::Type) at /home/sbergman/lo/core/include/com/sun/star/uno/Reference.hxx:59
> #13 0x00007f2c302419c5 in com::sun::star::uno::Reference<com::sun::star::deployment::XUpdateInformationProvider>::iquery(com::sun::star::uno::XInterface*) (pInterface=0x60e00022e7c0) at /home/sbergman/lo/core/include/com/sun/star/uno/Reference.hxx:74
> #14 0x00007f2c3024010e in com::sun::star::uno::Reference<com::sun::star::deployment::XUpdateInformationProvider>::Reference(com::sun::star::uno::BaseReference const&, com::sun::star::uno::UnoReference_Query) (this=0x7f2c262bd420, rRef=...) at /home/sbergman/lo/core/include/com/sun/star/uno/Reference.hxx:176
> #15 0x00007f2c3023e98a in com::sun::star::deployment::UpdateInformationProvider::create(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) (the_context=uno::Reference to (class cppu::(anonymous namespace)::ComponentContext *) 0x611000005e50) at /home/sbergman/lo/core/workdir/UnoApiHeadersTarget/offapi/normal/com/sun/star/deployment/UpdateInformationProvider.hpp:38
> #16 0x00007f2c30235e85 in dp_info::(anonymous namespace)::PackageInformationProvider::PackageInformationProvider(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) (this=0x607000afd3e0, xContext=uno::Reference to (class cppu::(anonymous namespace)::ComponentContext *) 0x611000005e50) at /home/sbergman/lo/core/desktop/source/deployment/manager/dp_informationprovider.cxx:92
> #17 0x00007f2c30235932 in com_sun_star_comp_deployment_PackageInformationProvider_get_implementation(com::sun::star::uno::XComponentContext*, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) (context=0x611000005e50) at /home/sbergman/lo/core/desktop/source/deployment/manager/dp_informationprovider.cxx:336
> #18 0x00007f2ca3c92795 in std::__invoke_impl<com::sun::star::uno::XInterface*, com::sun::star::uno::XInterface* (*&)(com::sun::star::uno::XComponentContext*, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&), com::sun::star::uno::XComponentContext*, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&>(std::__invoke_other, com::sun::star::uno::XInterface* (*&)(com::sun::star::uno::XComponentContext*, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&), com::sun::star::uno::XComponentContext*&&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) (__f=@0x612000035088: 0x7f2c302357f0 <com_sun_star_comp_deployment_PackageInformationProvider_get_implementation(com::sun::star::uno::XComponentContext*, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&)>, __args=@0x7f2c25ecd960: 0x611000005e50, __args=empty uno::Sequence) at /home/sbergman/gcc/trunk/inst/include/c++/12.0.0/bits/invoke.h:61
> #19 0x00007f2ca3c9248d in std::__invoke_r<com::sun::star::uno::XInterface*, com::sun::star::uno::XInterface* (*&)(com::sun::star::uno::XComponentContext*, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&), com::sun::star::uno::XComponentContext*, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&>(com::sun::star::uno::XInterface* (*&)(com::sun::star::uno::XComponentContext*, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&), com::sun::star::uno::XComponentContext*&&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) (__fn=@0x612000035088: 0x7f2c302357f0 <com_sun_star_comp_deployment_PackageInformationProvider_get_implementation(com::sun::star::uno::XComponentContext*, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&)>, __args=@0x7f2c25ecd960: 0x611000005e50, __args=empty uno::Sequence) at /home/sbergman/gcc/trunk/inst/include/c++/12.0.0/bits/invoke.h:114
> #20 0x00007f2ca3c91ebd in std::_Function_handler<com::sun::star::uno::XInterface* (com::sun::star::uno::XComponentContext*, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&), com::sun::star::uno::XInterface* (*)(com::sun::star::uno::XComponentContext*, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&)>::_M_invoke(std::_Any_data const&, com::sun::star::uno::XComponentContext*&&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) (__functor=..., __args=@0x7f2c25ecd960: 0x611000005e50, __args=empty uno::Sequence) at /home/sbergman/gcc/trunk/inst/include/c++/12.0.0/bits/std_function.h:291
> #21 0x00007f2ca3b7d419 in std::function<com::sun::star::uno::XInterface* (com::sun::star::uno::XComponentContext*, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&)>::operator()(com::sun::star::uno::XComponentContext*, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) const (this=0x612000035088, __args=0x611000005e50, __args=empty uno::Sequence) at /home/sbergman/gcc/trunk/inst/include/c++/12.0.0/bits/std_function.h:560
> #22 0x00007f2ca3b30861 in cppuhelper::ServiceManager::Data::Implementation::doCreateInstance(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) (this=0x612000034fd0, context=uno::Reference to (class cppu::(anonymous namespace)::ComponentContext *) 0x611000005e50) at /home/sbergman/lo/core/cppuhelper/source/servicemanager.cxx:703
> #23 0x00007f2ca3b30394 in cppuhelper::ServiceManager::Data::Implementation::createInstance(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, bool) (this=0x612000034fd0, context=uno::Reference to (class cppu::(anonymous namespace)::ComponentContext *) 0x611000005e50, singletonRequest=true) at /home/sbergman/lo/core/cppuhelper/source/servicemanager.cxx:672
> #24 0x00007f2ca3b6bb9c in (anonymous namespace)::SingletonFactory::createInstanceWithContext(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) (this=0x60700003a4e0, Context=uno::Reference to (class cppu::(anonymous namespace)::ComponentContext *) 0x611000005e50) at /home/sbergman/lo/core/cppuhelper/source/servicemanager.cxx:532
> #25 0x00007f2ca3b6c0af in non-virtual thunk to (anonymous namespace)::SingletonFactory::createInstanceWithContext(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) () at /home/sbergman/lo/core/cppuhelper/source/servicemanager.cxx:541
> #26 0x00007f2ca38c5545 in cppu::(anonymous namespace)::ComponentContext::lookupMap(rtl::OUString const&) (this=0x611000005e00, rName="/singletons/com.sun.star.deployment.PackageInformationProvider") at /home/sbergman/lo/core/cppuhelper/source/component_context.cxx:300
> #27 0x00007f2ca38ae9ab in cppu::(anonymous namespace)::ComponentContext::getValueByName(rtl::OUString const&) (this=0x611000005e00, rName="/singletons/com.sun.star.deployment.PackageInformationProvider") at /home/sbergman/lo/core/cppuhelper/source/component_context.cxx:374
> #28 0x00007f2ca38b279f in non-virtual thunk to cppu::(anonymous namespace)::ComponentContext::getValueByName(rtl::OUString const&) () at /home/sbergman/lo/core/cppuhelper/source/component_context.cxx:266
> #29 0x00007f2c2791c7e0 in checkForPendingUpdates(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) (rxContext=uno::Reference to (class cppu::(anonymous namespace)::ComponentContext *) 0x611000005e50) at /home/sbergman/lo/core/extensions/source/update/check/updateprotocol.cxx:289
> #30 0x00007f2c277d3db3 in UpdateCheck::initialize(com::sun::star::uno::Sequence<com::sun::star::beans::NamedValue> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) (this=0x6130001c9dc0, rValues=uno::Sequence of length 8 = {...}, xContext=uno::Reference to (class cppu::(anonymous namespace)::ComponentContext *) 0x611000005e50) at /home/sbergman/lo/core/extensions/source/update/check/updatecheck.cxx:776
> #31 0x00007f2c278acd2a in (anonymous namespace)::InitUpdateCheckJobThread::run() (this=0x608000163d20) at /home/sbergman/lo/core/extensions/source/update/check/updatecheckjob.cxx:143

having locked the cppu::getTypeEntries mutex in frame 1 and now trying to lock
the osl global mutex.

Of the many functions in sc/source/core/data/global.cxx that (implicitly, by
default) use the osl global mutex in comphelper::doubleCheckedInit, change at
least those two that call a CollatorWrapper (and are thus susceptible to the
described deadlock).

Change-Id: Ie41a1116518146bffcefab2373f1386afc03e544
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119319
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
tdf-gerrit pushed a commit that referenced this pull request Aug 9, 2021
...as had been the case prior to 12dce07
"loplugin:unusedfields - look for fields that can be const, in comphelper"
(which this commit partly reverts; the const'ness of
OInterfaceIteratorHelper2::bIsList had already been reverted, but for no
apparent reason, in 31b0be0 "improve pahole
script and pack a few classes").

That may or may not have been the cause of the apparently-sporadic
UITest_sw_table failure at <https://ci.libreoffice.org//job/lo_ubsan/2096/>,

> /comphelper/source/container/interfacecontainer2.cxx:54:29: runtime error: member call on address 0x606000ed5d20 which does not point to an object of type 'com::sun::star::uno::XInterface'
> 0x606000ed5d20: note: object has invalid vptr
>  22 04 00 14  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  01 00 00 00 be be be be  b0 11 46 00
>               ^~~~~~~~~~~~~~~~~~~~~~~
>               invalid vptr
>     #0 0x2ab564a71e15 in comphelper::OInterfaceIteratorHelper2::OInterfaceIteratorHelper2(comphelper::OInterfaceContainerHelper2&) /comphelper/source/container/interfacecontainer2.cxx:54:29
>     #1 0x2ab57614588f in void comphelper::OInterfaceContainerHelper2::forEach<com::sun::star::document::XDocumentEventListener, comphelper::OInterfaceContainerHelper2::NotifySingleListener<com::sun::star::document::XDocumentEventListener, com::sun::star::document::DocumentEvent> >(comphelper::OInterfaceContainerHelper2::NotifySingleListener<com::sun::star::document::XDocumentEventListener, com::sun::star::document::DocumentEvent> const&) /include/comphelper/interfacecontainer2.hxx:261:31
>     #2 0x2ab576144a95 in void comphelper::OInterfaceContainerHelper2::notifyEach<com::sun::star::document::XDocumentEventListener, com::sun::star::document::DocumentEvent>(void (com::sun::star::document::XDocumentEventListener::*)(com::sun::star::document::DocumentEvent const&), com::sun::star::document::DocumentEvent const&) /include/comphelper/interfacecontainer2.hxx:279:5
>     #3 0x2ab57613b277 in (anonymous namespace)::SfxGlobalEvents_Impl::implts_notifyListener(com::sun::star::document::DocumentEvent const&) /sfx2/source/notify/globalevents.cxx:505:26
>     #4 0x2ab576131faa in (anonymous namespace)::SfxGlobalEvents_Impl::documentEventOccured(com::sun::star::document::DocumentEvent const&) /sfx2/source/notify/globalevents.cxx:256:5
>     #5 0x2ab575f4abfc in (anonymous namespace)::NotifySingleListenerIgnoreRE<com::sun::star::document::XDocumentEventListener, com::sun::star::document::DocumentEvent>::operator()(com::sun::star::uno::Reference<com::sun::star::document::XDocumentEventListener> const&) const /sfx2/source/doc/sfxbasemodel.cxx:3200:13
>     #6 0x2ab575f002ec in void cppu::OInterfaceContainerHelper::forEach<com::sun::star::document::XDocumentEventListener, (anonymous namespace)::NotifySingleListenerIgnoreRE<com::sun::star::document::XDocumentEventListener, com::sun::star::document::DocumentEvent> >((anonymous namespace)::NotifySingleListenerIgnoreRE<com::sun::star::document::XDocumentEventListener, com::sun::star::document::DocumentEvent> const&) /include/cppuhelper/interfacecontainer.h:292:17
>     #7 0x2ab575efdd37 in SfxBaseModel::postEvent_Impl(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::frame::XController2> const&) /sfx2/source/doc/sfxbasemodel.cxx:3234:14
>     #8 0x2ab575efa257 in SfxBaseModel::Notify(SfxBroadcaster&, SfxHint const&) /sfx2/source/doc/sfxbasemodel.cxx:2883:9
>     #9 0x2ab57a796d83 in SfxBroadcaster::Broadcast(SfxHint const&) /svl/source/notify/SfxBroadcaster.cxx:39:24
>     #10 0x2ab6010f0e1f in SwLayIdle::SwLayIdle(SwRootFrame*, SwViewShellImp*) /sw/source/core/layout/layact.cxx:2375:24
>     #11 0x2ab60385d4e2 in SwViewShell::LayoutIdle() /sw/source/core/view/viewsh.cxx:723:19
>     #12 0x2ab5ff549ffa in sw::DocumentTimerManager::DoIdleJobs(Timer*) /sw/source/core/doc/DocumentTimerManager.cxx:177:42
>     #13 0x2ab5ff54552a in sw::DocumentTimerManager::LinkStubDoIdleJobs(void*, Timer*) /sw/source/core/doc/DocumentTimerManager.cxx:157:1
>     #14 0x2ab599cf5f41 in Link<Timer*, void>::Call(Timer*) const /include/tools/link.hxx:111:45
>     #15 0x2ab599cf5498 in Timer::Invoke() /vcl/source/app/timer.cxx:75:21
>     #16 0x2ab599b388ea in Scheduler::CallbackTaskScheduling() /vcl/source/app/scheduler.cxx:471:20
>     #17 0x2ab59ad34490 in SalTimer::CallCallback() /vcl/inc/saltimer.hxx:54:13
>     #18 0x2ab59ad2785c in SvpSalInstance::CheckTimeout(bool) /vcl/headless/svpinst.cxx:215:53
>     #19 0x2ab59ad2e67c in SvpSalInstance::DoYield(bool, bool) /vcl/headless/svpinst.cxx:460:21
>     #20 0x2ab599c35aa9 in ImplYield(bool, bool) /vcl/source/app/svapp.cxx:465:48
>     #21 0x2ab599c34c67 in Application::Yield() /vcl/source/app/svapp.cxx:532:5
>     #22 0x2ab599c348ae in Application::Execute() /vcl/source/app/svapp.cxx:444:9
>     #23 0x2ab55d699b4b in desktop::Desktop::Main() /desktop/source/app/app.cxx:1603:13
>     #24 0x2ab599cde4e9 in ImplSVMain() /vcl/source/app/svmain.cxx:199:35
>     #25 0x2ab599ce7510 in SVMain() /vcl/source/app/svmain.cxx:231:12
>     #26 0x2ab55d890775 in soffice_main /desktop/source/app/sofficemain.cxx:98:12
>     #27 0x4efc6c in sal_main /desktop/source/app/main.c:49:15
>     #28 0x4efc46 in main /desktop/source/app/main.c:47:1
>     #29 0x2ab55f48e554 in __libc_start_main (/lib64/libc.so.6+0x22554)
>     #30 0x41b5c1 in _start (/instdir/program/soffice.bin+0x41b5c1)

Change-Id: Iaa930f1612a3bb6ad0bcad12f3995b7dbb2e5fa7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120205
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins
tdf-gerrit pushed a commit that referenced this pull request Dec 14, 2022
 #5  0x00007fffee606a72 in ImplDbgTestSolarMutex() () at vcl/source/app/dbggui.cxx:35
 #6  0x00007ffff71186f0 in DbgTestSolarMutex() () at tools/source/debug/debug.cxx:54
 #7  0x00007ffff3273e39 in SfxBroadcaster::RemoveListener(SfxListener&) (this=0x1a38230, rListener=...) at svl/source/notify/SfxBroadcaster.cxx:105
 #8  0x00007ffff3296eb8 in SfxListener::~SfxListener() (this=0x33abce0) at svl/source/notify/lstner.cxx:53
 #9  0x00007fffaaa0a0a4 in ScAccessibleContextBase::~ScAccessibleContextBase() (this=0x33abc40) at sc/source/ui/Accessibility/AccessibleContextBase.cxx:59
 #10 0x00007fffaaaa6379 in ScAccessibleTableBase::~ScAccessibleTableBase() (this=0x33abc40) at sc/source/ui/Accessibility/AccessibleTableBase.cxx:52
 #11 0x00007fffaaa831da in ScAccessibleSpreadsheet::~ScAccessibleSpreadsheet() (this=0x33abc40) at sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx:274
 #12 0x00007fffaaa83229 in ScAccessibleSpreadsheet::~ScAccessibleSpreadsheet() (this=0x33abc40) at sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx:270
 #13 0x00007ffff5f87fc0 in cppu::OWeakObject::release() (this=0x33abc40) at cppuhelper/source/weak.cxx:230
 #14 0x00007ffff5f88690 in cppu::OWeakAggObject::release() (this=0x33abc40) at cppuhelper/source/weak.cxx:296
 #15 0x00007ffff5e7e4d5 in cppu::WeakAggComponentImplHelperBase::release() (this=0x33abc40) at cppuhelper/source/implbase.cxx:211
 #16 0x00007fffaaa0d875 in cppu::WeakAggComponentImplHelper5<com::sun::star::accessibility::XAccessible, com::sun::star::accessibility::XAccessibleComponent, com::sun::star::accessibility::XAccessibleContext, com::sun::star::accessibility::XAccessibleEventBroadcaster, com::sun::star::lang::XServiceInfo>::release() (this=0x33abc40)
     at include/cppuhelper/compbase5.hxx:142
 #17 0x00007fffaaa0ab15 in ScAccessibleContextBase::release() (this=0x33abc40) at sc/source/ui/Accessibility/AccessibleContextBase.cxx:119
 #18 0x00007fffaaaa6b75 in ScAccessibleTableBase::release() (this=0x33abc40) at sc/source/ui/Accessibility/AccessibleTableBase.cxx:86
 #19 0x00007fffd8f4f11a in com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessible>::clear()
     (this=<error reading variable: Unhandled DWARF expression opcode 0x0>) at include/com/sun/star/uno/Reference.hxx:231
 #20 0x00007fffd8f4c41d in atk_object_wrapper_finalize(_GObject*) (obj=0x7f71930) at vcl/unx/gtk3/a11y/atkwrapper.cxx:662
 #21 0x00007ffff3538d32 in g_object_unref (_object=<optimized out>) at ../gobject/gobject.c:3678
 #22 g_object_unref (_object=0x7f71930) at ../gobject/gobject.c:3553
 #23 0x00007fffd9571fc5 in expiry_func () at /lib64/libatk-bridge-2.0.so.0
 #24 0x00007fffea7197b1 in g_timeout_dispatch (source=0x313d360, callback=0x7fffd9571f60 <expiry_func>, user_data=0x7fffbc01bec0) at ../glib/gmain.c:4971
 #25 0x00007fffea718faf in g_main_dispatch (context=0x5f8230) at ../glib/gmain.c:3417

Change-Id: If527f1cf1bfc59bb8df586afaf5da62bbcb08eea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142691
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
tdf-gerrit pushed a commit that referenced this pull request Dec 29, 2022
...avoiding

> /writerfilter/source/dmapper/PropertyMap.cxx:324:71: runtime error: -2539 is outside the range of representable values of type 'unsigned int'
>     #0 0x7f80e9a3b6c3 in writerfilter::dmapper::PropertyMap::dumpXml() const /writerfilter/source/dmapper/PropertyMap.cxx:324:71
>     #1 0x7f80e928eccb in writerfilter::dmapper::DomainMapperTableHandler::endTableGetTableStyle(writerfilter::dmapper::TableInfo&, std::__debug::vector<com::sun::star::beans::PropertyValue, std::allocator<com::sun::star::beans::PropertyValue> >&, bool) /writerfilter/source/dmapper/DomainMapperTableHandler.cxx:434:40
>     #2 0x7f80e92b4b8f in writerfilter::dmapper::DomainMapperTableHandler::endTable(unsigned int, bool) /writerfilter/source/dmapper/DomainMapperTableHandler.cxx:1377:30
>     #3 0x7f80e9c289de in writerfilter::dmapper::TableManager::resolveCurrentTable() /writerfilter/source/dmapper/TableManager.cxx:409:33
>     #4 0x7f80e9c297a1 in writerfilter::dmapper::TableManager::endLevel() /writerfilter/source/dmapper/TableManager.cxx:427:9
>     #5 0x7f80e936a997 in writerfilter::dmapper::DomainMapperTableManager::endLevel() /writerfilter/source/dmapper/DomainMapperTableManager.cxx:497:19
>     #6 0x7f80e9c256d1 in writerfilter::dmapper::TableManager::endParagraphGroup() /writerfilter/source/dmapper/TableManager.cxx:338:9
>     #7 0x7f80e9205974 in writerfilter::dmapper::DomainMapper::lcl_endParagraphGroup() /writerfilter/source/dmapper/DomainMapper.cxx:3511:35
>     #8 0x7f80e984598e in writerfilter::LoggedStream::endParagraphGroup() /writerfilter/source/dmapper/LoggedResources.cxx:108:5
>     #9 0x7f80e9d9addf in writerfilter::ooxml::OOXMLFastContextHandler::endParagraphGroup() /writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:452:23
>     #10 0x7f80ea042658 in writerfilter::ooxml::OOXMLFactory_wml::endAction(writerfilter::ooxml::OOXMLFastContextHandler*) /workdir/CustomTarget/writerfilter/source/ooxml/OOXMLFactory_wml.cxx:7574:19
>     #11 0x7f80e9d8822a in writerfilter::ooxml::OOXMLFactory::endAction(writerfilter::ooxml::OOXMLFastContextHandler*) /writerfilter/source/ooxml/OOXMLFactory.cxx:157:19
>     #12 0x7f80e9d944eb in writerfilter::ooxml::OOXMLFastContextHandler::lcl_endFastElement(int) /writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:242:5
>     #13 0x7f80e9d941da in writerfilter::ooxml::OOXMLFastContextHandler::endFastElement(int) /writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:225:9
>     #14 0x7f80f44ffe2a in (anonymous namespace)::Entity::endElement() /sax/source/fastparser/fastparser.cxx:515:27
>     #15 0x7f80f44ff818 in sax_fastparser::FastSaxParserImpl::callbackEndElement() /sax/source/fastparser/fastparser.cxx:1343:17
>     #16 0x7f80f44ef554 in (anonymous namespace)::call_callbackEndElement(void*, unsigned char const*, unsigned char const*, unsigned char const*) /sax/source/fastparser/fastparser.cxx:339:18
>     #17 0x7f8179cde54a in xmlParseEndTag2 /workdir/UnpackedTarball/libxml2/parser.c:9742:2
>     #18 0x7f8179c8ced0 in xmlParseTryOrFinish /workdir/UnpackedTarball/libxml2/parser.c:11642:14
>     #19 0x7f8179c7acc9 in xmlParseChunk /workdir/UnpackedTarball/libxml2/parser.c:12351:13
>     #20 0x7f80f44ea4f1 in sax_fastparser::FastSaxParserImpl::parse() /sax/source/fastparser/fastparser.cxx:1099:21
>     #21 0x7f80f44e4146 in sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:904:9
>     #22 0x7f80f4505300 in sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:1482:13
>     #23 0x7f80e9d46e98 in writerfilter::ooxml::OOXMLDocumentImpl::resolve(writerfilter::Stream&) /writerfilter/source/ooxml/OOXMLDocumentImpl.cxx:508:18
>     #24 0x7f80e9cfed05 in (anonymous namespace)::WriterFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /writerfilter/source/filter/WriterFilter.cxx:208:24
>     #25 0x7f8149202866 in SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) /sfx2/source/doc/objstor.cxx:2272:34
>     #26 0x7f81491c2434 in SfxObjectShell::DoLoad(SfxMedium*) /sfx2/source/doc/objstor.cxx:739:23
>     #27 0x7f81493c9870 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/sfxbasemodel.cxx:1937:36
>     #28 0x7f8149b20d71 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&) /sfx2/source/view/frmload.cxx:720:28
>     #29 0x7f810e00256b in framework::LoadEnv::impl_loadContent() /framework/source/loadenv/loadenv.cxx:1167:37
>     #30 0x7f810dff896b in framework::LoadEnv::start() /framework/source/loadenv/loadenv.cxx:403:20
>     #31 0x7f810dff0dec 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) /framework/source/loadenv/loadenv.cxx:308:5
>     #32 0x7f810dfec180 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&) /framework/source/loadenv/loadenv.cxx:168:14
>     #33 0x7f810e0b541d in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/services/desktop.cxx:604:16
>     #34 0x7f810e0b5646 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&) /framework/source/services/desktop.cxx
>     #35 0x7f812a050c25 in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /unotest/source/cpp/macros_test.cxx:70:62
>     #36 0x7f81444fcad9 in UnoApiTest::load(rtl::OUString const&, char const*) /test/source/unoapi_test.cxx:115:11
>     #37 0x7f812a8ae042 in SwModelTestBase::loadURL(rtl::OUString const&, char const*, char const*) /sw/qa/unit/swmodeltestbase.cxx:449:20
>     #38 0x7f812a8b9452 in SwModelTestBase::load(char const*, char const*) /sw/qa/inc/swmodeltestbase.hxx:351:16
>     #39 0x7f812a8af516 in SwModelTestBase::loadAndSave(char const*) /sw/qa/unit/swmodeltestbase.cxx:502:5
>     #40 0x7f814fcfe242 in testTableThemePreservation::TestBody() /sw/qa/extras/ooxmlexport/ooxmlexport3.cxx:888:5

during CppunitTest_sw_ooxmlexport3
(<https://ci.libreoffice.org//job/lo_ubsan/2629/>).

(The overload for is_integral parameters is needed now to avoid ambiguity errors
when integer types other than sal_uInt32 could also match the newly added float
overload.)

Change-Id: I6482bccef2442655359c71e13f0c9bfe7e4d9dd4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144855
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
tdf-gerrit pushed a commit that referenced this pull request Jan 12, 2023
make -j 24 -rs -f /home/noel/libo-tsan/Makefile.gbuild
CppunitTest_filter_svg
[build CUT] filter_svg
==================
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
(pid=1138169)
Cycle in lock order graph: M0 (0x7b0c0043c8c0) => M1 (0x7b0c00459090)
=> M0

  Mutex M1 acquired here while holding mutex M0 in main thread:
/home/noel/llvm-project/compiler-rt/lib/tsan/rtl/../../sanitizer_common/sanitizer_common_interceptors.inc:4481
(cppunittester+0x9b4c2)
    #1 osl_acquireMutex ??:? (libuno_sal.so.3+0x783ca)
namespace)::AnimationNode::setParent(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>
const&) animcore.cxx:? (libanimcorelo.so+0x1d34f)
        M1 try to lock
namespace)::AnimationNode::setParent(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>
const&) animcore.cxx:? (libanimcorelo.so+0x33bf2)
namespace)::AnimationNode::appendChild(com::sun::star::uno::Reference<com::sun::star::animations::XAnimationNode>
const&) animcore.cxx:? (libanimcorelo.so+0x27312)
        M0 locked
namespace)::AnimationNode::appendChild(com::sun::star::uno::Reference<com::sun::star::animations::XAnimationNode>
const&) animcore.cxx:? (libanimcorelo.so+0x34d29)
xmloff::AnimationNodeContext::AnimationNodeContext(com::sun::star::uno::Reference<com::sun::star::animations::XAnimationNode>
const&, SvXMLImport&, int,
com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList>
const&, std::shared_ptr<xmloff::AnimationsImportHelperImpl> const&)
animationimport.cxx:? (libxolo.so+0x338060)
com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList>
const&) animationimport.cxx:? (libxolo.so+0x33e010)
com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList>
const&) ??:? (libxolo.so+0x2ca188)
com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList>
const&) ??:? (libxolo.so+0x2cb106)
namespace)::Event const*) fastparser.cxx:? (libexpwraplo.so+0x4731a)
sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource
const&) fastparser.cxx:? (libexpwraplo.so+0x407fa)
sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource
const&) ??:? (libexpwraplo.so+0x48d08)
const&) ??:? (libxolo.so+0x2c7296)
SvXMLImport::parseStream(com::sun::star::xml::sax::InputSource const&)
??:? (libxolo.so+0x2c74e2)
namespace)::ReadThroughComponent(com::sun::star::uno::Reference<com::sun::star::embed::XStorage>
const&, com::sun::star::uno::Reference<com::sun::star::lang::XComponent>
const&, char const*,
com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>
const&, char const*,
com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&,
rtl::OUString const&, bool) sdxmlwrp.cxx:? (libsdlo.so+0x4f2088)
(libsdlo.so+0x4ef8ed)
    #17 sd::DrawDocShell::Load(SfxMedium&) ??:? (libsdlo.so+0x5bdbeb)
(libsfxlo.so+0x596b65)
    #19 SfxObjectShell::DoLoad(SfxMedium*) ??:? (libsfxlo.so+0x598732)
SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
const&) ??:? (libsfxlo.so+0x5e5222)
SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
const&) ??:? (libsfxlo.so+0x5e6135)
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&) frmload.cxx:? (libsfxlo.so+0x6ca8fb)
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&) frmload.cxx:? (libsfxlo.so+0x6cd749)
(libfwklo.so+0x30000f)
    #25 framework::LoadEnv::start() loadenv.cxx:? (libfwklo.so+0x2fb828)
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) loadenv.cxx:?
(libfwklo.so+0x2f98d0)
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&) loadenv.cxx:? (libfwklo.so+0x2f8905)
rtl::OUString const&, int,
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
const&) ??:? (libfwklo.so+0x322cbf)
framework::Desktop::loadComponentFromURL(rtl::OUString const&,
rtl::OUString const&, int,
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
const&) ??:? (libfwklo.so+0x322f11)
rtl::OUString const&,
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
const&) ??:? (libunotest.so+0x13f41)
(libsubsequenttest.so+0x5fc93)
std::char_traits<char16_t> >, char const*) ??:?
(libsubsequenttest.so+0x60570)
(libtest_filter_svg.so+0x161bd)

  Mutex M0 acquired here while holding mutex M1 in main thread:
/home/noel/llvm-project/compiler-rt/lib/tsan/rtl/../../sanitizer_common/sanitizer_common_interceptors.inc:4481
(cppunittester+0x9b4c2)
    #1 osl_acquireMutex ??:? (libuno_sal.so.3+0x783ca)
namespace)::AnimationNode::fireChangeListener() animcore.cxx:?
(libanimcorelo.so+0x3832f)
        M0 try to lock
namespace)::AnimationNode::fireChangeListener() animcore.cxx:?
(libanimcorelo.so+0x38814)
namespace)::AnimationNode::fireChangeListener() animcore.cxx:?
(libanimcorelo.so+0x38814)
namespace)::AnimationNode::setParent(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>
const&) animcore.cxx:? (libanimcorelo.so+0x1d514)
namespace)::AnimationNode::setParent(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>
const&) animcore.cxx:? (libanimcorelo.so+0x33bf2)
namespace)::AnimationNode::appendChild(com::sun::star::uno::Reference<com::sun::star::animations::XAnimationNode>
const&) animcore.cxx:? (libanimcorelo.so+0x27312)
        M1 locked
namespace)::AnimationNode::appendChild(com::sun::star::uno::Reference<com::sun::star::animations::XAnimationNode>
const&) animcore.cxx:? (libanimcorelo.so+0x34d29)
xmloff::AnimationNodeContext::AnimationNodeContext(com::sun::star::uno::Reference<com::sun::star::animations::XAnimationNode>
const&, SvXMLImport&, int,
com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList>
const&, std::shared_ptr<xmloff::AnimationsImportHelperImpl> const&)
animationimport.cxx:? (libxolo.so+0x338060)
com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList>
const&) animationimport.cxx:? (libxolo.so+0x33e010)
com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList>
const&) ??:? (libxolo.so+0x2ca188)
com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList>
const&) ??:? (libxolo.so+0x2cb106)
namespace)::Event const*) fastparser.cxx:? (libexpwraplo.so+0x4731a)
sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource
const&) fastparser.cxx:? (libexpwraplo.so+0x407fa)
sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource
const&) ??:? (libexpwraplo.so+0x48d08)
const&) ??:? (libxolo.so+0x2c7296)
SvXMLImport::parseStream(com::sun::star::xml::sax::InputSource const&)
??:? (libxolo.so+0x2c74e2)
namespace)::ReadThroughComponent(com::sun::star::uno::Reference<com::sun::star::embed::XStorage>
const&, com::sun::star::uno::Reference<com::sun::star::lang::XComponent>
const&, char const*,
com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>
const&, char const*,
com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&,
rtl::OUString const&, bool) sdxmlwrp.cxx:? (libsdlo.so+0x4f2088)
(libsdlo.so+0x4ef8ed)
    #20 sd::DrawDocShell::Load(SfxMedium&) ??:? (libsdlo.so+0x5bdbeb)
(libsfxlo.so+0x596b65)
    #22 SfxObjectShell::DoLoad(SfxMedium*) ??:? (libsfxlo.so+0x598732)
SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
const&) ??:? (libsfxlo.so+0x5e5222)
SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
const&) ??:? (libsfxlo.so+0x5e6135)
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&) frmload.cxx:? (libsfxlo.so+0x6ca8fb)
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&) frmload.cxx:? (libsfxlo.so+0x6cd749)
(libfwklo.so+0x30000f)
    #28 framework::LoadEnv::start() loadenv.cxx:? (libfwklo.so+0x2fb828)
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) loadenv.cxx:?
(libfwklo.so+0x2f98d0)
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&) loadenv.cxx:? (libfwklo.so+0x2f8905)
rtl::OUString const&, int,
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
const&) ??:? (libfwklo.so+0x322cbf)
framework::Desktop::loadComponentFromURL(rtl::OUString const&,
rtl::OUString const&, int,
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
const&) ??:? (libfwklo.so+0x322f11)
rtl::OUString const&,
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
const&) ??:? (libunotest.so+0x13f41)

Change-Id: Iecb3f5c1e553d8f4278c7caf7e81f6cb1f589e9a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145335
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
tdf-gerrit pushed a commit that referenced this pull request Jan 18, 2023
...introduced with 18f1e7a "sc: Use
FormulaGrammarSwitch" (which gets partially reverted here),

> ==7079==ERROR: AddressSanitizer: heap-use-after-free on address 0x61d0002d6cac at pc 0x7f3635905f9e bp 0x7ffdd2107b60 sp 0x7ffdd2107b58
> WRITE of size 4 at 0x61d0002d6cac thread T0
>     #0 0x7f3635905f9d in ScDocument::SetGrammar(formula::FormulaGrammar::Grammar) /sc/source/core/data/documen3.cxx:507:14
>     #1 0x7f362ce3da0c in FormulaGrammarSwitch::~FormulaGrammarSwitch() /sc/qa/unit/helper/qahelper.cxx:56:12
>     #2 0x7f36529ad332 in ScExportTest2::testRefStringUnspecified() /sc/qa/unit/subsequent_export_test2.cxx:436:1
>
> 0x61d0002d6cac is located 2092 bytes inside of 2280-byte region [0x61d0002d6480,0x61d0002d6d68)
> freed by thread T0 here:
>     #0 0x4fe180 in operator delete(void*) /home/tdf/lode/packages/llvm-llvmorg-12.0.1.src/compiler-rt/lib/asan/asan_new_delete.cpp:160
>     #1 0x7f36398e1b9e in __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<ScDocument, std::allocator<ScDocument>, (__gnu_cxx::_Lock_policy)2> >::deallocate(std::_Sp_counted_ptr_inplace<ScDocument, std::allocator<ScDocument>, (__gnu_cxx::_Lock_policy)2>*, unsigned long) /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/ext/new_allocator.h:125:2
>     #2 0x7f36398e1b4e in std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<ScDocument, std::allocator<ScDocument>, (__gnu_cxx::_Lock_policy)2> > >::deallocate(std::allocator<std::_Sp_counted_ptr_inplace<ScDocument, std::allocator<ScDocument>, (__gnu_cxx::_Lock_policy)2> >&, std::_Sp_counted_ptr_inplace<ScDocument, std::allocator<ScDocument>, (__gnu_cxx::_Lock_policy)2>*, unsigned long) /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/alloc_traits.h:462:13
>     #3 0x7f36398e0691 in std::__allocated_ptr<std::allocator<std::_Sp_counted_ptr_inplace<ScDocument, std::allocator<ScDocument>, (__gnu_cxx::_Lock_policy)2> > >::~__allocated_ptr() /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/allocated_ptr.h:73:4
>     #4 0x7f36398e12b3 in std::_Sp_counted_ptr_inplace<ScDocument, std::allocator<ScDocument>, (__gnu_cxx::_Lock_policy)2>::_M_destroy() /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr_base.h:545:7
>     #5 0x7f3635077f59 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr_base.h:170:10
>     #6 0x7f3635077bf9 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr_base.h:684:11
>     #7 0x7f36388ea06c in std::__shared_ptr<ScDocument, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr_base.h:1123:31
>     #8 0x7f36388e02b8 in std::shared_ptr<ScDocument>::~shared_ptr() /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr.h:93:11
>     #9 0x7f36398a45c7 in ScDocShell::~ScDocShell() /sc/source/ui/docshell/docsh.cxx:2941:1
>     #10 0x7f36398a475f in ScDocShell::~ScDocShell() /sc/source/ui/docshell/docsh.cxx:2910:1
>     #11 0x7f36398a4908 in ScDocShell::~ScDocShell() /sc/source/ui/docshell/docsh.cxx:2910:1
>     #12 0x7f3627bd3f11 in SvRefBase::ReleaseRef() /include/tools/ref.hxx:163:29
>     #13 0x7f3627bd350c in tools::SvRef<SfxObjectShell>::~SvRef() /include/tools/ref.hxx:56:36
>     #14 0x7f3629662ce1 in IMPL_SfxBaseModel_DataContainer::~IMPL_SfxBaseModel_DataContainer() /sfx2/source/doc/sfxbasemodel.cxx:249:5
>     #15 0x7f362966598a in void __gnu_cxx::new_allocator<IMPL_SfxBaseModel_DataContainer>::destroy<IMPL_SfxBaseModel_DataContainer>(IMPL_SfxBaseModel_DataContainer*) /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/ext/new_allocator.h:140:28
>     #16 0x7f3629665746 in void std::allocator_traits<std::allocator<IMPL_SfxBaseModel_DataContainer> >::destroy<IMPL_SfxBaseModel_DataContainer>(std::allocator<IMPL_SfxBaseModel_DataContainer>&, IMPL_SfxBaseModel_DataContainer*) /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/alloc_traits.h:487:8
>     #17 0x7f3629660583 in std::_Sp_counted_ptr_inplace<IMPL_SfxBaseModel_DataContainer, std::allocator<IMPL_SfxBaseModel_DataContainer>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr_base.h:535:2
>     #18 0x7f3627b7b1fc in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr_base.h:154:6
>     #19 0x7f3627b7b029 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr_base.h:684:11
>     #20 0x7f362966a9cc in std::__shared_ptr<IMPL_SfxBaseModel_DataContainer, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr_base.h:1123:31
>     #21 0x7f362962f893 in std::__shared_ptr<IMPL_SfxBaseModel_DataContainer, (__gnu_cxx::_Lock_policy)2>::reset() /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr_base.h:1235:9
>     #22 0x7f3629572b96 in SfxBaseModel::dispose() /sfx2/source/doc/sfxbasemodel.cxx:765:13
>     #23 0x7f3629591550 in SfxBaseModel::close(unsigned char) /sfx2/source/doc/sfxbasemodel.cxx:1496:5
>     #24 0x7f36295702fd in SfxBaseModel::dispose() /sfx2/source/doc/sfxbasemodel.cxx:722:13
>     #25 0x7f36247062aa in UnoApiTest::load(rtl::OUString const&, char const*) /test/source/unoapi_test.cxx:87:22
>     #26 0x7f362470bb09 in UnoApiTest::saveAndReload(rtl::OUString const&, char const*) /test/source/unoapi_test.cxx:207:5
>     #27 0x7f36529ad04f in ScExportTest2::testRefStringUnspecified() /sc/qa/unit/subsequent_export_test2.cxx:428:5

(<https://ci.libreoffice.org/job/lo_ubsan/2653/>)

Change-Id: I34adf135a4ec79935295a21b34277324c531291b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145706
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
tdf-gerrit pushed a commit that referenced this pull request Feb 1, 2023
An ASan UITest_writer_tests7
UITEST_TEST_NAME=tdf135938.tdf135938.test_tdf135938_cross_reference_update
occasionally failed for me with

> ==1994973==ERROR: AddressSanitizer: heap-use-after-free on address 0x60f00014d718 at pc 0x7f95f4946ffa bp 0x7f95907fd720 sp 0x7f95907fd718
> READ of size 8 at 0x60f00014d718 thread T33
>  #0 in std::__cxx1998::vector<std::unique_ptr<SvLBoxItem, std::default_delete<SvLBoxItem>>, std::allocator<std::unique_ptr<SvLBoxItem, std::default_delete<SvLBoxItem>>>>::size() const at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/stl_vector.h:988:40
>  #1 in SvTreeListEntry::ItemCount() const at vcl/source/treelist/treelistentry.cxx:110:20
>  #2 in SvTabListBox::GetEntryText(SvTreeListEntry const*, unsigned short) at vcl/source/treelist/svtabbx.cxx:289:37
>  #3 in SvTabListBox::GetEntryText(SvTreeListEntry*) const at vcl/source/treelist/svtabbx.cxx:280:12
>  #4 in TreeListEntryUIObject::get_state() at vcl/source/treelist/uiobject.cxx:119:32
>  #5 in UIObjectUnoObj::getState() at vcl/source/uitest/uno/uiobject_uno.cxx:164:29
>  #6 in non-virtual thunk to UIObjectUnoObj::getState() at vcl/source/uitest/uno/uiobject_uno.cxx
>  #7 in gcc3::callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, double*) at bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:77:5
>  #8 in cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void*, void**, _uno_Any**) at bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:233:13
>  #9 in unoInterfaceProxyDispatch at bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:413:13
>  #10 in binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::__debug::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny>>*) const at binaryurp/source/incomingrequest.cxx:236:13
>  #11 in binaryurp::IncomingRequest::execute() const at binaryurp/source/incomingrequest.cxx:79:26
>  #12 in request at binaryurp/source/reader.cxx:86:9
>  #13 in cppu_threadpool::JobQueue::enter(void const*, bool) at cppu/source/threadpool/jobqueue.cxx:100:17
>  #14 in cppu_threadpool::ORequestThread::run() at cppu/source/threadpool/thread.cxx:165:31
>
> 0x60f00014d718 is located 120 bytes inside of 168-byte region [0x60f00014d6a0,0x60f00014d748)
> freed by thread T0 here:
>  #0 in operator delete(void*, unsigned long) at ~/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:164:3
>  #1 in SvTreeListEntry::~SvTreeListEntry() at vcl/source/treelist/treelistentry.cxx:62:1
>  #2 in std::default_delete<SvTreeListEntry>::operator()(SvTreeListEntry*) const at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/unique_ptr.h:102:2
>  #3 in std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>::~unique_ptr() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/unique_ptr.h:407:4
>  #4 in void std::destroy_at<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>>(std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/stl_construct.h:88:15
>  #5 in void std::_Destroy<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>>(std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/stl_construct.h:149:7
>  #6 in void std::_Destroy_aux<false>::__destroy<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*>(std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*, std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/stl_construct.h:163:6
>  #7 in void std::_Destroy<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*>(std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*, std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/stl_construct.h:195:7
>  #8 in void std::_Destroy<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*, std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>>(std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*, std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*, std::allocator<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>>&) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/alloc_traits.h:947:7
>  #9 in std::__cxx1998::vector<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>, std::allocator<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>>>::_M_erase_at_end(std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/stl_vector.h:1932:6
>  #10 in std::__cxx1998::vector<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>, std::allocator<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>>>::clear() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/stl_vector.h:1601:9
>  #11 in std::__debug::vector<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>, std::allocator<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>>>::clear() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/debug/vector:729:9
>  #12 in SvTreeListEntry::ClearChildren() at vcl/source/treelist/treelistentry.cxx:28:16
>  #13 in SvTreeList::Clear() at vcl/source/treelist/treelist.cxx:123:16
>  #14 in SvTreeListBox::Clear() at vcl/source/treelist/treelistbox.cxx:422:17
>  #15 in SalInstanceTreeView::clear() at vcl/source/app/salvtables.cxx:4240:18
>  #16 in SwFieldRefPage::Reset(SfxItemSet const*) at sw/source/ui/fldui/fldref.cxx:175:16
>  #17 in SwFieldPage::EditNewField(bool) at sw/source/ui/fldui/fldpage.cxx:111:5
>  #18 in SwFieldDlg::ReInitTabPage(std::basic_string_view<char, std::char_traits<char>>, bool) at sw/source/ui/fldui/fldtdlg.cxx:218:16
>  #19 in SwFieldDlg::Activate() at sw/source/ui/fldui/fldtdlg.cxx:239:9
>  #20 in SwChildWinWrapper::UpdateHdl(Timer*) at sw/source/uibase/fldui/fldwrap.cxx:42:26
>  #21 in SwChildWinWrapper::LinkStubUpdateHdl(void*, Timer*) at sw/source/uibase/fldui/fldwrap.cxx:39:1
>  #22 in Link<Timer*, void>::Call(Timer*) const at include/tools/link.hxx:111:45
>  #23 in Timer::Invoke() at vcl/source/app/timer.cxx:75:21
>  #24 in Scheduler::CallbackTaskScheduling() at vcl/source/app/scheduler.cxx:481:20
>  #25 in SalTimer::CallCallback() at vcl/inc/saltimer.hxx:54:13
>  #26 in SvpSalInstance::CheckTimeout(bool) at vcl/headless/svpinst.cxx:161:53
>  #27 in SvpSalInstance::ImplYield(bool, bool) at vcl/headless/svpinst.cxx:399:17
>  #28 in SvpSalInstance::DoYield(bool, bool) at vcl/headless/svpinst.cxx:471:21
>  #29 in ImplYield(bool, bool) at vcl/source/app/svapp.cxx:475:48
>  #30 in Application::Yield() at vcl/source/app/svapp.cxx:559:5
>  #31 in Application::Execute() at vcl/source/app/svapp.cxx:453:13
>  #32 in desktop::Desktop::Main() at desktop/source/app/app.cxx:1604:13

causing

> ERROR: test_tdf135938_cross_reference_update (tdf135938.tdf135938)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "uitest/uitest/test.py", line 125, in execute_dialog_through_command
>     yield xDialog
>   File "uitest/uitest/test.py", line 140, in execute_modeless_dialog_through_command
>     yield xDialog
>   File "sw/qa/uitest/writer_tests7/tdf135938.py", line 40, in test_tdf135938_cross_reference_update
>     self.assertEqual("ABC", get_state_as_dict(xSelect.getChild(0))["Text"])
>   File "uitest/uitest/uihelper/common.py", line 13, in get_state_as_dict
>     return convert_property_values_to_dict(ui_object.getState())
> uitest.uihelper.common.com.sun.star.lang.DisposedException: Binary URP bridge disposed during call at binaryurp/source/bridge.cxx:613

The issue apparently is that TreeListEntryUIObject UNO objects, introduced in
71f562f "uitest: support tree lists", reference
SvTreeListEntry instances by pointers that can apparently go stale while those
UNO objects are still alive.  I'm not sure there would be an easy fix for this,
short of making those SvTreeListEntry instances ref-counted, or ripping out
UITest support for those TreeListEntryUIObjects again.

However, that underlying issue would presumably not be of practical concern if
the test_tdf135938_cross_reference_update Python code would have waited for
processEventsToIdle between its

>                 xInsert.executeAction("CLICK", tuple())

and the following block

>                 self.assertEqual("2", get_state_as_dict(xSelect)["Children"])
>                 self.assertEqual("ABC", get_state_as_dict(xSelect.getChild(0))["Text"])
>                 self.assertEqual("DEF", get_state_as_dict(xSelect.getChild(1))["Text"])

That way, there should be no more opportunity for the pointers in the passed-out
TreeListEntryUIObjects to become stale while the Python code accesses them.

And in Python UITest code, having to follow a call to executeAction by a call to
processEventsToIdle appears to be a common and recurring requirement, just look
at the most recent af1ca68 "another stab at
making this test reliable", d183dae
"tdf#153161: (Ab)use a call to XTextRange::getString to flush edits",
3cc6b87 "make an effort to fix the
UITest_inputLine intermittent failure", f466854
"tdf#150443 sw: fix crash of rejecting table row deletion".

So make executeAction always call ProcessEventsToIdle, to simplify this and
hopefully make UITests more robust.  (Removing any now-redundant calls to
processEventsToIdle, following calls to executeAction, from Python test code is
left as follow-up clean up for now.)

(I /think/ that the implementation of UIObjectUnoObj::executeAction could be
simplified now, as waiting for Scheduler::ProcessEventsToIdle() should already
make sure that aIdle has been processed, removing the need for the Notifier.
But lets leave that as a follow-up TODO for now.)

Change-Id: I41a5d51515dedaae44fb810b0ad3b0264c90abf3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146434
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
tdf-gerrit pushed a commit that referenced this pull request Feb 1, 2023
sporadically reproducible with tsan and
./instdir/program/soffice.bin --headless --convert-to pdf ~/forum-mso-en4-802501.xlsx

move getTables().applyAutoFilters(), which wants to query tab 1 while
tab 1 is still getting imported, until after the threaded import has
completed.

This call was moved before in:

commit edd51b8
Date:   Thu Aug 15 16:23:46 2013 +0100

    fix for bnc#834705 missing drop downs for autofilter

==================
WARNING: ThreadSanitizer: data race (pid=3791886)
  Read of size 8 at 0x7b5000040f20 by thread T7 (mutexes: write M0, write M1):
    #0 __gnu_cxx::__normal_iterator<unsigned long const*, std::vector<unsigned long, std::allocator<unsigned long>>>::__normal_iterator(unsigned long const* const&) /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_iterator.h:1073:20 (libsclo.so+0x3d31c4) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def)
    #1 std::vector<unsigned long, std::allocator<unsigned long>>::cend() const /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_vector.h:960:16 (libsclo.so+0x3d31c4)
    #2 mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::cbegin() const core/workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:3771:34 (libsclo.so+0x3d31c4)
    #3 mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::begin() const core/workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:3753:12 (libsclo.so+0x3d31c4)
    #4 ScColumn::InitBlockPosition(sc::ColumnBlockConstPosition&) const core/sc/source/core/data/column3.cxx:1135:35 (libsclo.so+0x3d31c4)
    #5 ScTable::GetDataArea(short&, int&, short&, int&, bool, bool) const core/sc/source/core/data/table1.cxx:908:19 (libsclo.so+0x637b39) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def)
    #6 ScDocument::GetDataArea(short, short&, int&, short&, int&, bool, bool) const core/sc/source/core/data/document.cxx:1104:23 (libsclo.so+0x49b696) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def)
    #7 ScDBData::ExtendDataArea(ScDocument const&) core/sc/source/core/tool/dbdata.cxx:654:10 (libsclo.so+0x741e77) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def)
    #8 ScDocument::GetFilterEntries(short, int, short, ScFilterEntries&) core/sc/source/core/data/documen3.cxx:1577:14 (libsclo.so+0x46e7a6) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def)
    #9 (anonymous namespace)::fillQueryParam(ScQueryParam&, ScDocument*, com::sun::star::uno::Sequence<com::sun::star::sheet::TableFilterField3> const&) core/sc/source/ui/unoobj/datauno.cxx:1164:27 (libsclo.so+0xf7dd72) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def)
    #10 ScFilterDescriptorBase::setFilterFields3(com::sun::star::uno::Sequence<com::sun::star::sheet::TableFilterField3> const&) core/sc/source/ui/unoobj/datauno.cxx:1380:5 (libsclo.so+0xf7dd72)
    #11 non-virtual thunk to ScFilterDescriptorBase::setFilterFields3(com::sun::star::uno::Sequence<com::sun::star::sheet::TableFilterField3> const&) core/sc/source/ui/unoobj/datauno.cxx (libsclo.so+0xf7e2c2) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def)
    #12 oox::xls::AutoFilter::finalizeImport(com::sun::star::uno::Reference<com::sun::star::sheet::XDatabaseRange> const&, short) core/sc/source/filter/oox/autofilterbuffer.cxx:803:22 (libscfiltlo.so+0x3cca2c) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba)
    #13 oox::xls::AutoFilterBuffer::finalizeImport(com::sun::star::uno::Reference<com::sun::star::sheet::XDatabaseRange> const&, short) core/sc/source/filter/oox/autofilterbuffer.cxx:950:22 (libscfiltlo.so+0x3cdc0b) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba)
    #14 oox::xls::Table::applyAutoFilters() core/sc/source/filter/oox/tablebuffer.cxx:143:23 (libscfiltlo.so+0x4b9268) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba)
    #15 void std::__invoke_impl<void, void (oox::xls::Table::*&)(), oox::xls::Table&>(std::__invoke_memfun_ref, void (oox::xls::Table::*&)(), oox::xls::Table&) /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/invoke.h:67:14 (libscfiltlo.so+0x4b9d96) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba)
    #16 std::__invoke_result<void (oox::xls::Table::*&)(), oox::xls::Table&>::type std::__invoke<void (oox::xls::Table::*&)(), oox::xls::Table&>(void (oox::xls::Table::*&)(), oox::xls::Table&) /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/invoke.h:96:14 (libscfiltlo.so+0x4b9d96)
    #17 void std::_Bind<void (oox::xls::Table::* (std::_Placeholder<1>))()>::__call<void, oox::xls::Table&, 0ul>(std::tuple<oox::xls::Table&>&&, std::_Index_tuple<0ul>) /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/functional:495:11 (libscfiltlo.so+0x4b9d96)
    #18 void std::_Bind<void (oox::xls::Table::* (std::_Placeholder<1>))()>::operator()<oox::xls::Table&, void>(oox::xls::Table&) /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/functional:580:17 (libscfiltlo.so+0x4b9d96)
    #19 oox::RefMap<int, oox::xls::Table, std::less<int>>::ForEachFunctor<std::_Bind<void (oox::xls::Table::* (std::_Placeholder<1>))()>>::operator()(std::pair<int const, std::shared_ptr<oox::xls::Table>> const&) core/include/oox/helper/refmap.hxx:122:89 (libscfiltlo.so+0x4b9d96)
    #20 oox::RefMap<int, oox::xls::Table, std::less<int>>::ForEachFunctor<std::_Bind<void (oox::xls::Table::* (std::_Placeholder<1>))()>> std::for_each<std::_Rb_tree_const_iterator<std::pair<int const, std::shared_ptr<oox::xls::Table>>>, oox::RefMap<int, oox::xls::Table, std::less<int>>::ForEachFunctor<std::_Bind<void (oox::xls::Table::* (std::_Placeholder<1>))()>>>(std::_Rb_tree_const_iterator<std::pair<int const, std::shared_ptr<oox::xls::Table>>>, std::_Rb_tree_const_iterator<std::pair<int const, std::shared_ptr<oox::xls::Table>>>, oox::RefMap<int, oox::xls::Table, std::less<int>>::ForEachFunctor<std::_Bind<void (oox::xls::Table::* (std::_Placeholder<1>))()>>) /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algo.h:3787:2 (libscfiltlo.so+0x4b9d96)
    #21 void oox::RefMap<int, oox::xls::Table, std::less<int>>::forEach<std::_Bind<void (oox::xls::Table::* (std::_Placeholder<1>))()>>(std::_Bind<void (oox::xls::Table::* (std::_Placeholder<1>))()> const&) const core/include/oox/helper/refmap.hxx:71:29 (libscfiltlo.so+0x4b9d96)
    #22 void oox::RefMap<int, oox::xls::Table, std::less<int>>::forEachMem<void (oox::xls::Table::*)()>(void (oox::xls::Table::*)()) const core/include/oox/helper/refmap.hxx:79:29 (libscfiltlo.so+0x4b9d96)
    #23 oox::xls::TableBuffer::applyAutoFilters() core/sc/source/filter/oox/tablebuffer.cxx:179:16 (libscfiltlo.so+0x4b9d96)
    #24 oox::xls::WorksheetGlobals::finalizeWorksheetImport() core/sc/source/filter/oox/worksheethelper.cxx:943:17 (libscfiltlo.so+0x4ee58e) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba)
    #25 oox::xls::WorksheetHelper::finalizeWorksheetImport() core/sc/source/filter/oox/worksheethelper.cxx:1625:17 (libscfiltlo.so+0x4f2cff) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba)
    #26 oox::xls::WorksheetFragment::finalizeImport() core/sc/source/filter/oox/worksheetfragment.cxx:632:5 (libscfiltlo.so+0x4e91cc) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba)
    #27 oox::core::FragmentHandler2::endDocument() core/oox/source/core/fragmenthandler2.cxx:53:5 (libooxlo.so+0x1c20d9) (BuildId: eba40a8f6e1e986eafb2008b5a61a9060f9b6c0b)
    #28 non-virtual thunk to oox::core::FragmentHandler2::endDocument() core/oox/source/core/fragmenthandler2.cxx (libooxlo.so+0x1c20d9)
    #29 sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) core/sax/source/fastparser/fastparser.cxx:910:36 (libexpwraplo.so+0x2a06a) (BuildId: 4c8d8739ce3b93f891afa1e160f975a2892a4af4)
    #30 sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) core/sax/source/fastparser/fastparser.cxx:1482:13 (libexpwraplo.so+0x31738) (BuildId: 4c8d8739ce3b93f891afa1e160f975a2892a4af4)
    #31 oox::core::FastParser::parseStream(com::sun::star::xml::sax::InputSource const&, bool) core/oox/source/core/fastparser.cxx:121:15 (libooxlo.so+0x1ae980) (BuildId: eba40a8f6e1e986eafb2008b5a61a9060f9b6c0b)
    #32 oox::core::FastParser::parseStream(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, rtl::OUString const&) core/oox/source/core/fastparser.cxx:129:5 (libooxlo.so+0x1aebdf) (BuildId: eba40a8f6e1e986eafb2008b5a61a9060f9b6c0b)
    #33 oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&) core/oox/source/core/xmlfilterbase.cxx:412:21 (libooxlo.so+0x1d01ac) (BuildId: eba40a8f6e1e986eafb2008b5a61a9060f9b6c0b)
    #34 oox::xls::WorkbookHelper::importOoxFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&) core/sc/source/filter/oox/workbookhelper.cxx:1024:27 (libscfiltlo.so+0x4dbbd2) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba)
    #35 oox::xls::(anonymous namespace)::WorkerThread::doWork() core/sc/source/filter/oox/workbookfragment.cxx:249:27 (libscfiltlo.so+0x4d3347) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba)
    #36 comphelper::ThreadTask::exec() core/comphelper/source/misc/threadpool.cxx:319:9 (libcomphelper.so+0x17dbc1) (BuildId: 30a9bf106ea764f860a55d99b75dd87a0f268335)
    #37 comphelper::ThreadPool::ThreadWorker::execute() core/comphelper/source/misc/threadpool.cxx:85:24 (libcomphelper.so+0x17dbc1)
    #38 salhelper::Thread::run() core/salhelper/source/thread.cxx:39:5 (libuno_salhelpergcc3.so.3+0x5267) (BuildId: d146f721ac5d8da923b02df0d671788655b81eb6)
    #39 non-virtual thunk to salhelper::Thread::run() core/salhelper/source/thread.cxx (libuno_salhelpergcc3.so.3+0x5267)
    #40 threadFunc core/include/osl/thread.hxx:189:15 (libuno_salhelpergcc3.so.3+0x551e) (BuildId: d146f721ac5d8da923b02df0d671788655b81eb6)
    #41 osl_thread_start_Impl(void*) core/sal/osl/unx/thread.cxx:265:9 (libuno_sal.so.3+0x6a9d5) (BuildId: 767a6cd7c58bf820064a10cf0ab0f15b30c2f4ac)

  Previous write of size 8 at 0x7b5000040f20 by thread T6 (mutexes: write M2):
    #0 std::vector<unsigned long, std::allocator<unsigned long>>::_M_fill_insert(__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>, unsigned long, unsigned long const&) /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/vector.tcc:556:29 (libsclo.so+0x2f6766) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def)
    #1 std::vector<unsigned long, std::allocator<unsigned long>>::insert(__gnu_cxx::__normal_iterator<unsigned long const*, std::vector<unsigned long, std::allocator<unsigned long>>>, unsigned long, unsigned long const&) /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_vector.h:1435:2 (libsclo.so+0x2ffd3a) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def)
    #2 mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::blocks_type::insert(unsigned long, unsigned long) core/workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:99:15 (libsclo.so+0x2ffd3a)
    #3 mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::set_new_block_to_middle(unsigned long, unsigned long, unsigned long, bool) core/workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:4326:19 (libsclo.so+0x2ffd3a)
    #4 mdds::mtv::soa::detail::iterator_base<mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::iterator_trait> mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::set_cell_to_middle_of_block<double>(unsigned long, unsigned long, double const&) core/workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:3999:19 (libsclo.so+0x3259fe) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def)
    #5 mdds::mtv::soa::detail::iterator_base<mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::iterator_trait> mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::set_cell_to_empty_block<double>(unsigned long, unsigned long, double const&) core/workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:3313:12 (libsclo.so+0x3259fe)
    #6 mdds::mtv::soa::detail::iterator_base<mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::iterator_trait> mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::set_impl<double>(unsigned long, unsigned long, double const&) core/workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:1260:16 (libsclo.so+0x32492f) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def)
    #7 mdds::mtv::soa::detail::iterator_base<mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::iterator_trait> mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::set<double>(mdds::mtv::soa::detail::iterator_base<mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::iterator_trait> const&, unsigned long, double const&) core/workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:754:20 (libsclo.so+0x4cc138) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def)
    #8 ScDocumentImport::setNumericCell(ScAddress const&, double) core/sc/source/core/data/documentimport.cxx:259:35 (libsclo.so+0x4cc138)
    #9 oox::xls::SheetDataBuffer::setValueCell(oox::xls::CellModel const&, double) core/sc/source/filter/oox/sheetdatabuffer.cxx:107:20 (libscfiltlo.so+0x4833c0) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba)
    #10 oox::xls::SheetDataContext::onEndElement() core/sc/source/filter/oox/sheetdatacontext.cxx:185:25 (libscfiltlo.so+0x48fed2) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba)
    #11 non-virtual thunk to oox::xls::SheetDataContext::onEndElement() core/sc/source/filter/oox/sheetdatacontext.cxx (libscfiltlo.so+0x48fff9) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba)
    #12 oox::core::ContextHandler2Helper::implEndElement(int) core/oox/source/core/contexthandler2.cxx:125:9 (libooxlo.so+0x1ac82b) (BuildId: eba40a8f6e1e986eafb2008b5a61a9060f9b6c0b)
    #13 oox::core::ContextHandler2::endFastElement(int) core/oox/source/core/contexthandler2.cxx:220:5 (libooxlo.so+0x1ac82b)
    #14 non-virtual thunk to oox::core::ContextHandler2::endFastElement(int) core/oox/source/core/contexthandler2.cxx (libooxlo.so+0x1ac82b)
    #15 (anonymous namespace)::Entity::endElement() core/sax/source/fastparser/fastparser.cxx:515:27 (libexpwraplo.so+0x3042f) (BuildId: 4c8d8739ce3b93f891afa1e160f975a2892a4af4)
    #16 sax_fastparser::FastSaxParserImpl::consume((anonymous namespace)::EventList&) core/sax/source/fastparser/fastparser.cxx:1029:25 (libexpwraplo.so+0x29d37) (BuildId: 4c8d8739ce3b93f891afa1e160f975a2892a4af4)
    #17 sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) core/sax/source/fastparser/fastparser.cxx:869:22 (libexpwraplo.so+0x29d37)
    #18 sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) core/sax/source/fastparser/fastparser.cxx:1482:13 (libexpwraplo.so+0x31738) (BuildId: 4c8d8739ce3b93f891afa1e160f975a2892a4af4)
    #19 oox::core::FastParser::parseStream(com::sun::star::xml::sax::InputSource const&, bool) core/oox/source/core/fastparser.cxx:121:15 (libooxlo.so+0x1ae980) (BuildId: eba40a8f6e1e986eafb2008b5a61a9060f9b6c0b)
    #20 oox::core::FastParser::parseStream(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, rtl::OUString const&) core/oox/source/core/fastparser.cxx:129:5 (libooxlo.so+0x1aebdf) (BuildId: eba40a8f6e1e986eafb2008b5a61a9060f9b6c0b)
    #21 oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&) core/oox/source/core/xmlfilterbase.cxx:412:21 (libooxlo.so+0x1d01ac) (BuildId: eba40a8f6e1e986eafb2008b5a61a9060f9b6c0b)
    #22 oox::xls::WorkbookHelper::importOoxFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&) core/sc/source/filter/oox/workbookhelper.cxx:1024:27 (libscfiltlo.so+0x4dbbd2) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba)
    #23 oox::xls::(anonymous namespace)::WorkerThread::doWork() core/sc/source/filter/oox/workbookfragment.cxx:249:27 (libscfiltlo.so+0x4d3347) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba)
    #24 comphelper::ThreadTask::exec() core/comphelper/source/misc/threadpool.cxx:319:9 (libcomphelper.so+0x17dbc1) (BuildId: 30a9bf106ea764f860a55d99b75dd87a0f268335)
    #25 comphelper::ThreadPool::ThreadWorker::execute() core/comphelper/source/misc/threadpool.cxx:85:24 (libcomphelper.so+0x17dbc1)
    #26 salhelper::Thread::run() core/salhelper/source/thread.cxx:39:5 (libuno_salhelpergcc3.so.3+0x5267) (BuildId: d146f721ac5d8da923b02df0d671788655b81eb6)
    #27 non-virtual thunk to salhelper::Thread::run() core/salhelper/source/thread.cxx (libuno_salhelpergcc3.so.3+0x5267)
    #28 threadFunc core/include/osl/thread.hxx:189:15 (libuno_salhelpergcc3.so.3+0x551e) (BuildId: d146f721ac5d8da923b02df0d671788655b81eb6)
    #29 osl_thread_start_Impl(void*) core/sal/osl/unx/thread.cxx:265:9 (libuno_sal.so.3+0x6a9d5) (BuildId: 767a6cd7c58bf820064a10cf0ab0f15b30c2f4ac)

Change-Id: I7542432749fded8ab5e35f79cb221ad712f7802d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146430
Tested-by: Jenkins
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
tdf-gerrit pushed a commit that referenced this pull request Feb 1, 2023
An ASan UITest_writer_tests7
UITEST_TEST_NAME=tdf135938.tdf135938.test_tdf135938_cross_reference_update
occasionally failed for me with

> ==1994973==ERROR: AddressSanitizer: heap-use-after-free on address 0x60f00014d718 at pc 0x7f95f4946ffa bp 0x7f95907fd720 sp 0x7f95907fd718
> READ of size 8 at 0x60f00014d718 thread T33
>  #0 in std::__cxx1998::vector<std::unique_ptr<SvLBoxItem, std::default_delete<SvLBoxItem>>, std::allocator<std::unique_ptr<SvLBoxItem, std::default_delete<SvLBoxItem>>>>::size() const at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/stl_vector.h:988:40
>  #1 in SvTreeListEntry::ItemCount() const at vcl/source/treelist/treelistentry.cxx:110:20
>  #2 in SvTabListBox::GetEntryText(SvTreeListEntry const*, unsigned short) at vcl/source/treelist/svtabbx.cxx:289:37
>  #3 in SvTabListBox::GetEntryText(SvTreeListEntry*) const at vcl/source/treelist/svtabbx.cxx:280:12
>  #4 in TreeListEntryUIObject::get_state() at vcl/source/treelist/uiobject.cxx:119:32
>  #5 in UIObjectUnoObj::getState() at vcl/source/uitest/uno/uiobject_uno.cxx:164:29
>  #6 in non-virtual thunk to UIObjectUnoObj::getState() at vcl/source/uitest/uno/uiobject_uno.cxx
>  #7 in gcc3::callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, double*) at bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:77:5
>  #8 in cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void*, void**, _uno_Any**) at bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:233:13
>  #9 in unoInterfaceProxyDispatch at bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:413:13
>  #10 in binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::__debug::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny>>*) const at binaryurp/source/incomingrequest.cxx:236:13
>  #11 in binaryurp::IncomingRequest::execute() const at binaryurp/source/incomingrequest.cxx:79:26
>  #12 in request at binaryurp/source/reader.cxx:86:9
>  #13 in cppu_threadpool::JobQueue::enter(void const*, bool) at cppu/source/threadpool/jobqueue.cxx:100:17
>  #14 in cppu_threadpool::ORequestThread::run() at cppu/source/threadpool/thread.cxx:165:31
>
> 0x60f00014d718 is located 120 bytes inside of 168-byte region [0x60f00014d6a0,0x60f00014d748)
> freed by thread T0 here:
>  #0 in operator delete(void*, unsigned long) at ~/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:164:3
>  #1 in SvTreeListEntry::~SvTreeListEntry() at vcl/source/treelist/treelistentry.cxx:62:1
>  #2 in std::default_delete<SvTreeListEntry>::operator()(SvTreeListEntry*) const at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/unique_ptr.h:102:2
>  #3 in std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>::~unique_ptr() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/unique_ptr.h:407:4
>  #4 in void std::destroy_at<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>>(std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/stl_construct.h:88:15
>  #5 in void std::_Destroy<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>>(std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/stl_construct.h:149:7
>  #6 in void std::_Destroy_aux<false>::__destroy<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*>(std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*, std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/stl_construct.h:163:6
>  #7 in void std::_Destroy<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*>(std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*, std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/stl_construct.h:195:7
>  #8 in void std::_Destroy<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*, std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>>(std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*, std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*, std::allocator<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>>&) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/alloc_traits.h:947:7
>  #9 in std::__cxx1998::vector<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>, std::allocator<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>>>::_M_erase_at_end(std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/stl_vector.h:1932:6
>  #10 in std::__cxx1998::vector<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>, std::allocator<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>>>::clear() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/stl_vector.h:1601:9
>  #11 in std::__debug::vector<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>, std::allocator<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>>>::clear() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/debug/vector:729:9
>  #12 in SvTreeListEntry::ClearChildren() at vcl/source/treelist/treelistentry.cxx:28:16
>  #13 in SvTreeList::Clear() at vcl/source/treelist/treelist.cxx:123:16
>  #14 in SvTreeListBox::Clear() at vcl/source/treelist/treelistbox.cxx:422:17
>  #15 in SalInstanceTreeView::clear() at vcl/source/app/salvtables.cxx:4240:18
>  #16 in SwFieldRefPage::Reset(SfxItemSet const*) at sw/source/ui/fldui/fldref.cxx:175:16
>  #17 in SwFieldPage::EditNewField(bool) at sw/source/ui/fldui/fldpage.cxx:111:5
>  #18 in SwFieldDlg::ReInitTabPage(std::basic_string_view<char, std::char_traits<char>>, bool) at sw/source/ui/fldui/fldtdlg.cxx:218:16
>  #19 in SwFieldDlg::Activate() at sw/source/ui/fldui/fldtdlg.cxx:239:9
>  #20 in SwChildWinWrapper::UpdateHdl(Timer*) at sw/source/uibase/fldui/fldwrap.cxx:42:26
>  #21 in SwChildWinWrapper::LinkStubUpdateHdl(void*, Timer*) at sw/source/uibase/fldui/fldwrap.cxx:39:1
>  #22 in Link<Timer*, void>::Call(Timer*) const at include/tools/link.hxx:111:45
>  #23 in Timer::Invoke() at vcl/source/app/timer.cxx:75:21
>  #24 in Scheduler::CallbackTaskScheduling() at vcl/source/app/scheduler.cxx:481:20
>  #25 in SalTimer::CallCallback() at vcl/inc/saltimer.hxx:54:13
>  #26 in SvpSalInstance::CheckTimeout(bool) at vcl/headless/svpinst.cxx:161:53
>  #27 in SvpSalInstance::ImplYield(bool, bool) at vcl/headless/svpinst.cxx:399:17
>  #28 in SvpSalInstance::DoYield(bool, bool) at vcl/headless/svpinst.cxx:471:21
>  #29 in ImplYield(bool, bool) at vcl/source/app/svapp.cxx:475:48
>  #30 in Application::Yield() at vcl/source/app/svapp.cxx:559:5
>  #31 in Application::Execute() at vcl/source/app/svapp.cxx:453:13
>  #32 in desktop::Desktop::Main() at desktop/source/app/app.cxx:1604:13

causing

> ERROR: test_tdf135938_cross_reference_update (tdf135938.tdf135938)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "uitest/uitest/test.py", line 125, in execute_dialog_through_command
>     yield xDialog
>   File "uitest/uitest/test.py", line 140, in execute_modeless_dialog_through_command
>     yield xDialog
>   File "sw/qa/uitest/writer_tests7/tdf135938.py", line 40, in test_tdf135938_cross_reference_update
>     self.assertEqual("ABC", get_state_as_dict(xSelect.getChild(0))["Text"])
>   File "uitest/uitest/uihelper/common.py", line 13, in get_state_as_dict
>     return convert_property_values_to_dict(ui_object.getState())
> uitest.uihelper.common.com.sun.star.lang.DisposedException: Binary URP bridge disposed during call at binaryurp/source/bridge.cxx:613

The issue apparently is that TreeListEntryUIObject UNO objects, introduced in
71f562f "uitest: support tree lists", reference
SvTreeListEntry instances by pointers that can apparently go stale while those
UNO objects are still alive.  I'm not sure there would be an easy fix for this,
short of making those SvTreeListEntry instances ref-counted, or ripping out
UITest support for those TreeListEntryUIObjects again.

However, that underlying issue would presumably not be of practical concern if
the test_tdf135938_cross_reference_update Python code would have waited for
processEventsToIdle between its

>                 xInsert.executeAction("CLICK", tuple())

and the following block

>                 self.assertEqual("2", get_state_as_dict(xSelect)["Children"])
>                 self.assertEqual("ABC", get_state_as_dict(xSelect.getChild(0))["Text"])
>                 self.assertEqual("DEF", get_state_as_dict(xSelect.getChild(1))["Text"])

That way, there should be no more opportunity for the pointers in the passed-out
TreeListEntryUIObjects to become stale while the Python code accesses them.

And in Python UITest code, having to follow a call to executeAction by a call to
processEventsToIdle appears to be a common and recurring requirement, just look
at the most recent af1ca68 "another stab at
making this test reliable", d183dae
"tdf#153161: (Ab)use a call to XTextRange::getString to flush edits",
3cc6b87 "make an effort to fix the
UITest_inputLine intermittent failure", f466854
"tdf#150443 sw: fix crash of rejecting table row deletion".

So make executeAction always call ProcessEventsToIdle, to simplify this and
hopefully make UITests more robust.  (Removing any now-redundant calls to
processEventsToIdle, following calls to executeAction, from Python test code is
left as follow-up clean up for now.)

(I /think/ that the implementation of UIObjectUnoObj::executeAction could be
simplified now, as waiting for Scheduler::ProcessEventsToIdle() should already
make sure that aIdle has been processed, removing the need for the Notifier.
But lets leave that as a follow-up TODO for now.)

Change-Id: I41a5d51515dedaae44fb810b0ad3b0264c90abf3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146434
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
(cherry picked from commit 51a2e1a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146404
tdf-gerrit pushed a commit that referenced this pull request Feb 2, 2023
An ASan UITest_writer_tests7
UITEST_TEST_NAME=tdf135938.tdf135938.test_tdf135938_cross_reference_update
occasionally failed for me with

> ==1994973==ERROR: AddressSanitizer: heap-use-after-free on address 0x60f00014d718 at pc 0x7f95f4946ffa bp 0x7f95907fd720 sp 0x7f95907fd718
> READ of size 8 at 0x60f00014d718 thread T33
>  #0 in std::__cxx1998::vector<std::unique_ptr<SvLBoxItem, std::default_delete<SvLBoxItem>>, std::allocator<std::unique_ptr<SvLBoxItem, std::default_delete<SvLBoxItem>>>>::size() const at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/stl_vector.h:988:40
>  #1 in SvTreeListEntry::ItemCount() const at vcl/source/treelist/treelistentry.cxx:110:20
>  #2 in SvTabListBox::GetEntryText(SvTreeListEntry const*, unsigned short) at vcl/source/treelist/svtabbx.cxx:289:37
>  #3 in SvTabListBox::GetEntryText(SvTreeListEntry*) const at vcl/source/treelist/svtabbx.cxx:280:12
>  #4 in TreeListEntryUIObject::get_state() at vcl/source/treelist/uiobject.cxx:119:32
>  #5 in UIObjectUnoObj::getState() at vcl/source/uitest/uno/uiobject_uno.cxx:164:29
>  #6 in non-virtual thunk to UIObjectUnoObj::getState() at vcl/source/uitest/uno/uiobject_uno.cxx
>  #7 in gcc3::callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, double*) at bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:77:5
>  #8 in cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void*, void**, _uno_Any**) at bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:233:13
>  #9 in unoInterfaceProxyDispatch at bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:413:13
>  #10 in binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::__debug::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny>>*) const at binaryurp/source/incomingrequest.cxx:236:13
>  #11 in binaryurp::IncomingRequest::execute() const at binaryurp/source/incomingrequest.cxx:79:26
>  #12 in request at binaryurp/source/reader.cxx:86:9
>  #13 in cppu_threadpool::JobQueue::enter(void const*, bool) at cppu/source/threadpool/jobqueue.cxx:100:17
>  #14 in cppu_threadpool::ORequestThread::run() at cppu/source/threadpool/thread.cxx:165:31
>
> 0x60f00014d718 is located 120 bytes inside of 168-byte region [0x60f00014d6a0,0x60f00014d748)
> freed by thread T0 here:
>  #0 in operator delete(void*, unsigned long) at ~/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:164:3
>  #1 in SvTreeListEntry::~SvTreeListEntry() at vcl/source/treelist/treelistentry.cxx:62:1
>  #2 in std::default_delete<SvTreeListEntry>::operator()(SvTreeListEntry*) const at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/unique_ptr.h:102:2
>  #3 in std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>::~unique_ptr() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/unique_ptr.h:407:4
>  #4 in void std::destroy_at<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>>(std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/stl_construct.h:88:15
>  #5 in void std::_Destroy<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>>(std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/stl_construct.h:149:7
>  #6 in void std::_Destroy_aux<false>::__destroy<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*>(std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*, std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/stl_construct.h:163:6
>  #7 in void std::_Destroy<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*>(std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*, std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/stl_construct.h:195:7
>  #8 in void std::_Destroy<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*, std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>>(std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*, std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*, std::allocator<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>>&) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/alloc_traits.h:947:7
>  #9 in std::__cxx1998::vector<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>, std::allocator<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>>>::_M_erase_at_end(std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>*) at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/stl_vector.h:1932:6
>  #10 in std::__cxx1998::vector<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>, std::allocator<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>>>::clear() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/bits/stl_vector.h:1601:9
>  #11 in std::__debug::vector<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>, std::allocator<std::unique_ptr<SvTreeListEntry, std::default_delete<SvTreeListEntry>>>>::clear() at ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/13.0.0/../../../../include/c++/13.0.0/debug/vector:729:9
>  #12 in SvTreeListEntry::ClearChildren() at vcl/source/treelist/treelistentry.cxx:28:16
>  #13 in SvTreeList::Clear() at vcl/source/treelist/treelist.cxx:123:16
>  #14 in SvTreeListBox::Clear() at vcl/source/treelist/treelistbox.cxx:422:17
>  #15 in SalInstanceTreeView::clear() at vcl/source/app/salvtables.cxx:4240:18
>  #16 in SwFieldRefPage::Reset(SfxItemSet const*) at sw/source/ui/fldui/fldref.cxx:175:16
>  #17 in SwFieldPage::EditNewField(bool) at sw/source/ui/fldui/fldpage.cxx:111:5
>  #18 in SwFieldDlg::ReInitTabPage(std::basic_string_view<char, std::char_traits<char>>, bool) at sw/source/ui/fldui/fldtdlg.cxx:218:16
>  #19 in SwFieldDlg::Activate() at sw/source/ui/fldui/fldtdlg.cxx:239:9
>  #20 in SwChildWinWrapper::UpdateHdl(Timer*) at sw/source/uibase/fldui/fldwrap.cxx:42:26
>  #21 in SwChildWinWrapper::LinkStubUpdateHdl(void*, Timer*) at sw/source/uibase/fldui/fldwrap.cxx:39:1
>  #22 in Link<Timer*, void>::Call(Timer*) const at include/tools/link.hxx:111:45
>  #23 in Timer::Invoke() at vcl/source/app/timer.cxx:75:21
>  #24 in Scheduler::CallbackTaskScheduling() at vcl/source/app/scheduler.cxx:481:20
>  #25 in SalTimer::CallCallback() at vcl/inc/saltimer.hxx:54:13
>  #26 in SvpSalInstance::CheckTimeout(bool) at vcl/headless/svpinst.cxx:161:53
>  #27 in SvpSalInstance::ImplYield(bool, bool) at vcl/headless/svpinst.cxx:399:17
>  #28 in SvpSalInstance::DoYield(bool, bool) at vcl/headless/svpinst.cxx:471:21
>  #29 in ImplYield(bool, bool) at vcl/source/app/svapp.cxx:475:48
>  #30 in Application::Yield() at vcl/source/app/svapp.cxx:559:5
>  #31 in Application::Execute() at vcl/source/app/svapp.cxx:453:13
>  #32 in desktop::Desktop::Main() at desktop/source/app/app.cxx:1604:13

causing

> ERROR: test_tdf135938_cross_reference_update (tdf135938.tdf135938)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "uitest/uitest/test.py", line 125, in execute_dialog_through_command
>     yield xDialog
>   File "uitest/uitest/test.py", line 140, in execute_modeless_dialog_through_command
>     yield xDialog
>   File "sw/qa/uitest/writer_tests7/tdf135938.py", line 40, in test_tdf135938_cross_reference_update
>     self.assertEqual("ABC", get_state_as_dict(xSelect.getChild(0))["Text"])
>   File "uitest/uitest/uihelper/common.py", line 13, in get_state_as_dict
>     return convert_property_values_to_dict(ui_object.getState())
> uitest.uihelper.common.com.sun.star.lang.DisposedException: Binary URP bridge disposed during call at binaryurp/source/bridge.cxx:613

The issue apparently is that TreeListEntryUIObject UNO objects, introduced in
71f562f "uitest: support tree lists", reference
SvTreeListEntry instances by pointers that can apparently go stale while those
UNO objects are still alive.  I'm not sure there would be an easy fix for this,
short of making those SvTreeListEntry instances ref-counted, or ripping out
UITest support for those TreeListEntryUIObjects again.

However, that underlying issue would presumably not be of practical concern if
the test_tdf135938_cross_reference_update Python code would have waited for
processEventsToIdle between its

>                 xInsert.executeAction("CLICK", tuple())

and the following block

>                 self.assertEqual("2", get_state_as_dict(xSelect)["Children"])
>                 self.assertEqual("ABC", get_state_as_dict(xSelect.getChild(0))["Text"])
>                 self.assertEqual("DEF", get_state_as_dict(xSelect.getChild(1))["Text"])

That way, there should be no more opportunity for the pointers in the passed-out
TreeListEntryUIObjects to become stale while the Python code accesses them.

And in Python UITest code, having to follow a call to executeAction by a call to
processEventsToIdle appears to be a common and recurring requirement, just look
at the most recent af1ca68 "another stab at
making this test reliable", d183dae
"tdf#153161: (Ab)use a call to XTextRange::getString to flush edits",
3cc6b87 "make an effort to fix the
UITest_inputLine intermittent failure", f466854
"tdf#150443 sw: fix crash of rejecting table row deletion".

So make executeAction always call ProcessEventsToIdle, to simplify this and
hopefully make UITests more robust.  (Removing any now-redundant calls to
processEventsToIdle, following calls to executeAction, from Python test code is
left as follow-up clean up for now.)

(I /think/ that the implementation of UIObjectUnoObj::executeAction could be
simplified now, as waiting for Scheduler::ProcessEventsToIdle() should already
make sure that aIdle has been processed, removing the need for the Notifier.
But lets leave that as a follow-up TODO for now.)

Change-Id: I41a5d51515dedaae44fb810b0ad3b0264c90abf3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146434
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
(cherry picked from commit 51a2e1a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146404
tdf-gerrit pushed a commit that referenced this pull request Feb 8, 2023
UITest_writer_macro_tests occasionally failed with

> ==3730889==ERROR: AddressSanitizer: heap-use-after-free on address 0x60d00057d080 at pc 0x7f75353d933c bp 0x7ffcedf8de90 sp 0x7ffcedf8de88
> READ of size 8 at 0x60d00057d080 thread T0
>  #0 in basctl::ModulWindow::GetState(SfxItemSet&) at basctl/source/basicide/baside2.cxx:1088:22
>  #1 in basctl::Shell::GetState(SfxItemSet&) at basctl/source/basicide/basides1.cxx:1160:18
>  #2 in SfxStubbasctl_ShellGetState(SfxShell*, SfxItemSet&) at workdir/SdiTarget/basctl/sdi/basslots.hxx:164:1
>  #3 in SfxDispatcher::FillState_(SfxSlotServer const&, SfxItemSet&, SfxSlot const*) at sfx2/source/control/dispatch.cxx:1658:9
>  #4 in SfxBindings::Update_Impl(SfxStateCache&) at sfx2/source/control/bindings.cxx:260:22
>  #5 in SfxBindings::NextJob_Impl(Timer const*) at sfx2/source/control/bindings.cxx:1275:17
>  #6 in SfxBindings::NextJob(Timer*) at sfx2/source/control/bindings.cxx:1220:5
>  #7 in SfxBindings::LinkStubNextJob(void*, Timer*) at sfx2/source/control/bindings.cxx:1218:1
>  #8 in Link<Timer*, void>::Call(Timer*) const at include/tools/link.hxx:111:45
>  #9 in Timer::Invoke() at vcl/source/app/timer.cxx:75:21
>  #10 in Scheduler::CallbackTaskScheduling() at vcl/source/app/scheduler.cxx:481:20
>  #11 in SalTimer::CallCallback() at vcl/inc/saltimer.hxx:54:13
>  #12 in SvpSalInstance::CheckTimeout(bool) at vcl/headless/svpinst.cxx:161:53
>  #13 in SvpSalInstance::ImplYield(bool, bool) at vcl/headless/svpinst.cxx:399:17
>  #14 in SvpSalInstance::DoYield(bool, bool) at vcl/headless/svpinst.cxx:471:21
>  #15 in ImplYield(bool, bool) at vcl/source/app/svapp.cxx:475:48
>  #16 in Application::Yield() at vcl/source/app/svapp.cxx:559:5
>  #17 in Application::Execute() at vcl/source/app/svapp.cxx:453:13
>  #18 in desktop::Desktop::Main() at desktop/source/app/app.cxx:1604:13
>  #19 in ImplSVMain() at vcl/source/app/svmain.cxx:203:35
>  #20 in SVMain() at vcl/source/app/svmain.cxx:235:12
>  #21 in soffice_main at desktop/source/app/sofficemain.cxx:94:12
>  #22 in sal_main at desktop/source/app/main.c:51:15
>  #23 in main at desktop/source/app/main.c:49:1
>
> 0x60d00057d080 is located 0 bytes inside of 144-byte region [0x60d00057d080,0x60d00057d110)
> freed by thread T20 here:
>  #0 in operator delete(void*, unsigned long) at /home/sbergman/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:164:3
>  #1 in basctl::ModulWindow::~ModulWindow() at basctl/source/basicide/baside2.cxx:235:1
>  #2 in VclReferenceBase::release() const at include/vcl/vclreferencebase.hxx:43:13
>  #3 in rtl::Reference<basctl::BaseWindow>::~Reference() at include/rtl/ref.hxx:129:22
>  #4 in VclPtr<basctl::BaseWindow>::disposeAndClear() at include/vcl/vclptr.hxx:209:5
>  #5 in basctl::Shell::~Shell() at basctl/source/basicide/basidesh.cxx:246:23
>  #6 in basctl::Shell::~Shell() at basctl/source/basicide/basidesh.cxx:228:1
>  #7 in SfxViewFrame::ReleaseObjectShell_Impl() at sfx2/source/view/viewfrm.cxx:1114:9
>  #8 in SfxViewFrame::~SfxViewFrame() at sfx2/source/view/viewfrm.cxx:1905:5
>  #9 in SfxViewFrame::Close() at sfx2/source/view/viewfrm.cxx:1166:5
>  #10 in SfxFrame::DoClose_Impl() at sfx2/source/view/frame.cxx:138:37
>  #11 in SfxBaseController::dispose() at sfx2/source/view/sfxbasecontroller.cxx:931:28
>  #12 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&) at framework/source/services/frame.cxx:1493:33
>  #13 in (anonymous namespace)::XFrameImpl::close(unsigned char) at framework/source/services/frame.cxx:1704:12
>  #14 in SfxFrame::DoClose() at sfx2/source/view/frame.cxx:104:29
>  #15 in SfxViewFrame::Notify(SfxBroadcaster&, SfxHint const&) at sfx2/source/view/viewfrm.cxx:1703:28
>  #16 in SfxBroadcaster::Broadcast(SfxHint const&) at svl/source/notify/SfxBroadcaster.cxx:40:24
>  #17 in (anonymous namespace)::SfxModelListener_Impl::notifyClosing(com::sun::star::lang::EventObject const&) at sfx2/source/doc/objxtor.cxx:145:12
>  #18 in SfxBaseModel::close(unsigned char) at sfx2/source/doc/sfxbasemodel.cxx:1487:76
>  #19 in SfxBaseModel::dispose() at sfx2/source/doc/sfxbasemodel.cxx:725:13
>  #20 in gcc3::callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, double*) at bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:77:5
>  #21 in cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void*, void**, _uno_Any**) at bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:233:13
>  #22 in unoInterfaceProxyDispatch at bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:413:13
>  #23 in binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::__debug::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny>>*) const at binaryurp/source/incomingrequest.cxx:236:13
>  #24 in binaryurp::IncomingRequest::execute() const at binaryurp/source/incomingrequest.cxx:79:26
>  #25 in request at binaryurp/source/reader.cxx:86:9
>  #26 in cppu_threadpool::JobQueue::enter(void const*, bool) at cppu/source/threadpool/jobqueue.cxx:100:17
>  #27 in cppu_threadpool::ORequestThread::run() at cppu/source/threadpool/thread.cxx:165:31
>  #28 in threadFunc at include/osl/thread.hxx:189:15
>  #29 in osl_thread_start_Impl(void*) at sal/osl/unx/thread.cxx:265:9

where the ModulWindow apparently happens to get deleted by the UNO worker thread
in the window of time when ModuleWindow::IsPasteAllowed temporarily dropped the
SolarMutex on the main thread.

Temporarily dropping the SolarMutex around the xClipboard->getContents() call
had been there ever since the code got introduced in
c29c7a8 "#92173# Reimplement Basic password
protection UI in Basic IDE", and at least theoretically it is of course the
right thing to do to not call that UNO API with the SolarMutex locked.  But it
is of course also not a good idea to use SolarMutexReleaser, and that
xClipboard->getContents() call doesn't look like it leads to deadlock.

Change-Id: I3660065508d37801125f675440071d61e41906d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146650
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
tdf-gerrit pushed a commit that referenced this pull request Feb 9, 2023
sporadically reproducible with tsan and
./instdir/program/soffice.bin --headless --convert-to pdf ~/forum-mso-en4-802501.xlsx

move getTables().applyAutoFilters(), which wants to query tab 1 while
tab 1 is still getting imported, until after the threaded import has
completed.

This call was moved before in:

commit edd51b8
Date:   Thu Aug 15 16:23:46 2013 +0100

    fix for bnc#834705 missing drop downs for autofilter

==================
WARNING: ThreadSanitizer: data race (pid=3791886)
  Read of size 8 at 0x7b5000040f20 by thread T7 (mutexes: write M0, write M1):
    #0 __gnu_cxx::__normal_iterator<unsigned long const*, std::vector<unsigned long, std::allocator<unsigned long>>>::__normal_iterator(unsigned long const* const&) /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_iterator.h:1073:20 (libsclo.so+0x3d31c4) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def)
    #1 std::vector<unsigned long, std::allocator<unsigned long>>::cend() const /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_vector.h:960:16 (libsclo.so+0x3d31c4)
    #2 mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::cbegin() const core/workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:3771:34 (libsclo.so+0x3d31c4)
    #3 mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::begin() const core/workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:3753:12 (libsclo.so+0x3d31c4)
    #4 ScColumn::InitBlockPosition(sc::ColumnBlockConstPosition&) const core/sc/source/core/data/column3.cxx:1135:35 (libsclo.so+0x3d31c4)
    #5 ScTable::GetDataArea(short&, int&, short&, int&, bool, bool) const core/sc/source/core/data/table1.cxx:908:19 (libsclo.so+0x637b39) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def)
    #6 ScDocument::GetDataArea(short, short&, int&, short&, int&, bool, bool) const core/sc/source/core/data/document.cxx:1104:23 (libsclo.so+0x49b696) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def)
    #7 ScDBData::ExtendDataArea(ScDocument const&) core/sc/source/core/tool/dbdata.cxx:654:10 (libsclo.so+0x741e77) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def)
    #8 ScDocument::GetFilterEntries(short, int, short, ScFilterEntries&) core/sc/source/core/data/documen3.cxx:1577:14 (libsclo.so+0x46e7a6) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def)
    #9 (anonymous namespace)::fillQueryParam(ScQueryParam&, ScDocument*, com::sun::star::uno::Sequence<com::sun::star::sheet::TableFilterField3> const&) core/sc/source/ui/unoobj/datauno.cxx:1164:27 (libsclo.so+0xf7dd72) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def)
    #10 ScFilterDescriptorBase::setFilterFields3(com::sun::star::uno::Sequence<com::sun::star::sheet::TableFilterField3> const&) core/sc/source/ui/unoobj/datauno.cxx:1380:5 (libsclo.so+0xf7dd72)
    #11 non-virtual thunk to ScFilterDescriptorBase::setFilterFields3(com::sun::star::uno::Sequence<com::sun::star::sheet::TableFilterField3> const&) core/sc/source/ui/unoobj/datauno.cxx (libsclo.so+0xf7e2c2) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def)
    #12 oox::xls::AutoFilter::finalizeImport(com::sun::star::uno::Reference<com::sun::star::sheet::XDatabaseRange> const&, short) core/sc/source/filter/oox/autofilterbuffer.cxx:803:22 (libscfiltlo.so+0x3cca2c) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba)
    #13 oox::xls::AutoFilterBuffer::finalizeImport(com::sun::star::uno::Reference<com::sun::star::sheet::XDatabaseRange> const&, short) core/sc/source/filter/oox/autofilterbuffer.cxx:950:22 (libscfiltlo.so+0x3cdc0b) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba)
    #14 oox::xls::Table::applyAutoFilters() core/sc/source/filter/oox/tablebuffer.cxx:143:23 (libscfiltlo.so+0x4b9268) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba)
    #15 void std::__invoke_impl<void, void (oox::xls::Table::*&)(), oox::xls::Table&>(std::__invoke_memfun_ref, void (oox::xls::Table::*&)(), oox::xls::Table&) /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/invoke.h:67:14 (libscfiltlo.so+0x4b9d96) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba)
    #16 std::__invoke_result<void (oox::xls::Table::*&)(), oox::xls::Table&>::type std::__invoke<void (oox::xls::Table::*&)(), oox::xls::Table&>(void (oox::xls::Table::*&)(), oox::xls::Table&) /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/invoke.h:96:14 (libscfiltlo.so+0x4b9d96)
    #17 void std::_Bind<void (oox::xls::Table::* (std::_Placeholder<1>))()>::__call<void, oox::xls::Table&, 0ul>(std::tuple<oox::xls::Table&>&&, std::_Index_tuple<0ul>) /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/functional:495:11 (libscfiltlo.so+0x4b9d96)
    #18 void std::_Bind<void (oox::xls::Table::* (std::_Placeholder<1>))()>::operator()<oox::xls::Table&, void>(oox::xls::Table&) /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/functional:580:17 (libscfiltlo.so+0x4b9d96)
    #19 oox::RefMap<int, oox::xls::Table, std::less<int>>::ForEachFunctor<std::_Bind<void (oox::xls::Table::* (std::_Placeholder<1>))()>>::operator()(std::pair<int const, std::shared_ptr<oox::xls::Table>> const&) core/include/oox/helper/refmap.hxx:122:89 (libscfiltlo.so+0x4b9d96)
    #20 oox::RefMap<int, oox::xls::Table, std::less<int>>::ForEachFunctor<std::_Bind<void (oox::xls::Table::* (std::_Placeholder<1>))()>> std::for_each<std::_Rb_tree_const_iterator<std::pair<int const, std::shared_ptr<oox::xls::Table>>>, oox::RefMap<int, oox::xls::Table, std::less<int>>::ForEachFunctor<std::_Bind<void (oox::xls::Table::* (std::_Placeholder<1>))()>>>(std::_Rb_tree_const_iterator<std::pair<int const, std::shared_ptr<oox::xls::Table>>>, std::_Rb_tree_const_iterator<std::pair<int const, std::shared_ptr<oox::xls::Table>>>, oox::RefMap<int, oox::xls::Table, std::less<int>>::ForEachFunctor<std::_Bind<void (oox::xls::Table::* (std::_Placeholder<1>))()>>) /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_algo.h:3787:2 (libscfiltlo.so+0x4b9d96)
    #21 void oox::RefMap<int, oox::xls::Table, std::less<int>>::forEach<std::_Bind<void (oox::xls::Table::* (std::_Placeholder<1>))()>>(std::_Bind<void (oox::xls::Table::* (std::_Placeholder<1>))()> const&) const core/include/oox/helper/refmap.hxx:71:29 (libscfiltlo.so+0x4b9d96)
    #22 void oox::RefMap<int, oox::xls::Table, std::less<int>>::forEachMem<void (oox::xls::Table::*)()>(void (oox::xls::Table::*)()) const core/include/oox/helper/refmap.hxx:79:29 (libscfiltlo.so+0x4b9d96)
    #23 oox::xls::TableBuffer::applyAutoFilters() core/sc/source/filter/oox/tablebuffer.cxx:179:16 (libscfiltlo.so+0x4b9d96)
    #24 oox::xls::WorksheetGlobals::finalizeWorksheetImport() core/sc/source/filter/oox/worksheethelper.cxx:943:17 (libscfiltlo.so+0x4ee58e) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba)
    #25 oox::xls::WorksheetHelper::finalizeWorksheetImport() core/sc/source/filter/oox/worksheethelper.cxx:1625:17 (libscfiltlo.so+0x4f2cff) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba)
    #26 oox::xls::WorksheetFragment::finalizeImport() core/sc/source/filter/oox/worksheetfragment.cxx:632:5 (libscfiltlo.so+0x4e91cc) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba)
    #27 oox::core::FragmentHandler2::endDocument() core/oox/source/core/fragmenthandler2.cxx:53:5 (libooxlo.so+0x1c20d9) (BuildId: eba40a8f6e1e986eafb2008b5a61a9060f9b6c0b)
    #28 non-virtual thunk to oox::core::FragmentHandler2::endDocument() core/oox/source/core/fragmenthandler2.cxx (libooxlo.so+0x1c20d9)
    #29 sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) core/sax/source/fastparser/fastparser.cxx:910:36 (libexpwraplo.so+0x2a06a) (BuildId: 4c8d8739ce3b93f891afa1e160f975a2892a4af4)
    #30 sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) core/sax/source/fastparser/fastparser.cxx:1482:13 (libexpwraplo.so+0x31738) (BuildId: 4c8d8739ce3b93f891afa1e160f975a2892a4af4)
    #31 oox::core::FastParser::parseStream(com::sun::star::xml::sax::InputSource const&, bool) core/oox/source/core/fastparser.cxx:121:15 (libooxlo.so+0x1ae980) (BuildId: eba40a8f6e1e986eafb2008b5a61a9060f9b6c0b)
    #32 oox::core::FastParser::parseStream(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, rtl::OUString const&) core/oox/source/core/fastparser.cxx:129:5 (libooxlo.so+0x1aebdf) (BuildId: eba40a8f6e1e986eafb2008b5a61a9060f9b6c0b)
    #33 oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&) core/oox/source/core/xmlfilterbase.cxx:412:21 (libooxlo.so+0x1d01ac) (BuildId: eba40a8f6e1e986eafb2008b5a61a9060f9b6c0b)
    #34 oox::xls::WorkbookHelper::importOoxFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&) core/sc/source/filter/oox/workbookhelper.cxx:1024:27 (libscfiltlo.so+0x4dbbd2) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba)
    #35 oox::xls::(anonymous namespace)::WorkerThread::doWork() core/sc/source/filter/oox/workbookfragment.cxx:249:27 (libscfiltlo.so+0x4d3347) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba)
    #36 comphelper::ThreadTask::exec() core/comphelper/source/misc/threadpool.cxx:319:9 (libcomphelper.so+0x17dbc1) (BuildId: 30a9bf106ea764f860a55d99b75dd87a0f268335)
    #37 comphelper::ThreadPool::ThreadWorker::execute() core/comphelper/source/misc/threadpool.cxx:85:24 (libcomphelper.so+0x17dbc1)
    #38 salhelper::Thread::run() core/salhelper/source/thread.cxx:39:5 (libuno_salhelpergcc3.so.3+0x5267) (BuildId: d146f721ac5d8da923b02df0d671788655b81eb6)
    #39 non-virtual thunk to salhelper::Thread::run() core/salhelper/source/thread.cxx (libuno_salhelpergcc3.so.3+0x5267)
    #40 threadFunc core/include/osl/thread.hxx:189:15 (libuno_salhelpergcc3.so.3+0x551e) (BuildId: d146f721ac5d8da923b02df0d671788655b81eb6)
    #41 osl_thread_start_Impl(void*) core/sal/osl/unx/thread.cxx:265:9 (libuno_sal.so.3+0x6a9d5) (BuildId: 767a6cd7c58bf820064a10cf0ab0f15b30c2f4ac)

  Previous write of size 8 at 0x7b5000040f20 by thread T6 (mutexes: write M2):
    #0 std::vector<unsigned long, std::allocator<unsigned long>>::_M_fill_insert(__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>, unsigned long, unsigned long const&) /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/vector.tcc:556:29 (libsclo.so+0x2f6766) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def)
    #1 std::vector<unsigned long, std::allocator<unsigned long>>::insert(__gnu_cxx::__normal_iterator<unsigned long const*, std::vector<unsigned long, std::allocator<unsigned long>>>, unsigned long, unsigned long const&) /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_vector.h:1435:2 (libsclo.so+0x2ffd3a) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def)
    #2 mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::blocks_type::insert(unsigned long, unsigned long) core/workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:99:15 (libsclo.so+0x2ffd3a)
    #3 mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::set_new_block_to_middle(unsigned long, unsigned long, unsigned long, bool) core/workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:4326:19 (libsclo.so+0x2ffd3a)
    #4 mdds::mtv::soa::detail::iterator_base<mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::iterator_trait> mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::set_cell_to_middle_of_block<double>(unsigned long, unsigned long, double const&) core/workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:3999:19 (libsclo.so+0x3259fe) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def)
    #5 mdds::mtv::soa::detail::iterator_base<mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::iterator_trait> mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::set_cell_to_empty_block<double>(unsigned long, unsigned long, double const&) core/workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:3313:12 (libsclo.so+0x3259fe)
    #6 mdds::mtv::soa::detail::iterator_base<mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::iterator_trait> mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::set_impl<double>(unsigned long, unsigned long, double const&) core/workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:1260:16 (libsclo.so+0x32492f) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def)
    #7 mdds::mtv::soa::detail::iterator_base<mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::iterator_trait> mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::set<double>(mdds::mtv::soa::detail::iterator_base<mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>>, sc::CellStoreTrait>::iterator_trait> const&, unsigned long, double const&) core/workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:754:20 (libsclo.so+0x4cc138) (BuildId: 4582437348063bd1c461478348ce37a0dbd28def)
    #8 ScDocumentImport::setNumericCell(ScAddress const&, double) core/sc/source/core/data/documentimport.cxx:259:35 (libsclo.so+0x4cc138)
    #9 oox::xls::SheetDataBuffer::setValueCell(oox::xls::CellModel const&, double) core/sc/source/filter/oox/sheetdatabuffer.cxx:107:20 (libscfiltlo.so+0x4833c0) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba)
    #10 oox::xls::SheetDataContext::onEndElement() core/sc/source/filter/oox/sheetdatacontext.cxx:185:25 (libscfiltlo.so+0x48fed2) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba)
    #11 non-virtual thunk to oox::xls::SheetDataContext::onEndElement() core/sc/source/filter/oox/sheetdatacontext.cxx (libscfiltlo.so+0x48fff9) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba)
    #12 oox::core::ContextHandler2Helper::implEndElement(int) core/oox/source/core/contexthandler2.cxx:125:9 (libooxlo.so+0x1ac82b) (BuildId: eba40a8f6e1e986eafb2008b5a61a9060f9b6c0b)
    #13 oox::core::ContextHandler2::endFastElement(int) core/oox/source/core/contexthandler2.cxx:220:5 (libooxlo.so+0x1ac82b)
    #14 non-virtual thunk to oox::core::ContextHandler2::endFastElement(int) core/oox/source/core/contexthandler2.cxx (libooxlo.so+0x1ac82b)
    #15 (anonymous namespace)::Entity::endElement() core/sax/source/fastparser/fastparser.cxx:515:27 (libexpwraplo.so+0x3042f) (BuildId: 4c8d8739ce3b93f891afa1e160f975a2892a4af4)
    #16 sax_fastparser::FastSaxParserImpl::consume((anonymous namespace)::EventList&) core/sax/source/fastparser/fastparser.cxx:1029:25 (libexpwraplo.so+0x29d37) (BuildId: 4c8d8739ce3b93f891afa1e160f975a2892a4af4)
    #17 sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) core/sax/source/fastparser/fastparser.cxx:869:22 (libexpwraplo.so+0x29d37)
    #18 sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) core/sax/source/fastparser/fastparser.cxx:1482:13 (libexpwraplo.so+0x31738) (BuildId: 4c8d8739ce3b93f891afa1e160f975a2892a4af4)
    #19 oox::core::FastParser::parseStream(com::sun::star::xml::sax::InputSource const&, bool) core/oox/source/core/fastparser.cxx:121:15 (libooxlo.so+0x1ae980) (BuildId: eba40a8f6e1e986eafb2008b5a61a9060f9b6c0b)
    #20 oox::core::FastParser::parseStream(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, rtl::OUString const&) core/oox/source/core/fastparser.cxx:129:5 (libooxlo.so+0x1aebdf) (BuildId: eba40a8f6e1e986eafb2008b5a61a9060f9b6c0b)
    #21 oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&) core/oox/source/core/xmlfilterbase.cxx:412:21 (libooxlo.so+0x1d01ac) (BuildId: eba40a8f6e1e986eafb2008b5a61a9060f9b6c0b)
    #22 oox::xls::WorkbookHelper::importOoxFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&) core/sc/source/filter/oox/workbookhelper.cxx:1024:27 (libscfiltlo.so+0x4dbbd2) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba)
    #23 oox::xls::(anonymous namespace)::WorkerThread::doWork() core/sc/source/filter/oox/workbookfragment.cxx:249:27 (libscfiltlo.so+0x4d3347) (BuildId: 798032f9cb60957d86e47827d9e882b8931326ba)
    #24 comphelper::ThreadTask::exec() core/comphelper/source/misc/threadpool.cxx:319:9 (libcomphelper.so+0x17dbc1) (BuildId: 30a9bf106ea764f860a55d99b75dd87a0f268335)
    #25 comphelper::ThreadPool::ThreadWorker::execute() core/comphelper/source/misc/threadpool.cxx:85:24 (libcomphelper.so+0x17dbc1)
    #26 salhelper::Thread::run() core/salhelper/source/thread.cxx:39:5 (libuno_salhelpergcc3.so.3+0x5267) (BuildId: d146f721ac5d8da923b02df0d671788655b81eb6)
    #27 non-virtual thunk to salhelper::Thread::run() core/salhelper/source/thread.cxx (libuno_salhelpergcc3.so.3+0x5267)
    #28 threadFunc core/include/osl/thread.hxx:189:15 (libuno_salhelpergcc3.so.3+0x551e) (BuildId: d146f721ac5d8da923b02df0d671788655b81eb6)
    #29 osl_thread_start_Impl(void*) core/sal/osl/unx/thread.cxx:265:9 (libuno_sal.so.3+0x6a9d5) (BuildId: 767a6cd7c58bf820064a10cf0ab0f15b30c2f4ac)

Change-Id: I7542432749fded8ab5e35f79cb221ad712f7802d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146430
Tested-by: Jenkins
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 6652768)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146531
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
tdf-gerrit pushed a commit that referenced this pull request Jan 29, 2024
In `AccessibleShape::disposing`, call the same method
of the base class, i.e. `AccessibleContextBase::disposing`,
not `AccessibleContextBase::dispose`.

The code was moved from `AccessibleShape::dispose` to
`AccessibleShape::disposing` in

    commit f11b151
    Date:   Tue Apr 30 13:30:10 2002 +0000

        #95585# Moved code from dispose to disposing().

and it seems likely that adjusting the base class method to call
was just forgotten/missed.

This resulted in the accessible getting disposed without listeners
getting notified (since `AccessibleContextBase::disposing` takes
care of that).

This resulted in a crash for the following scenario with the qt6
VCL plugin when the Orca screen reader is running:

1) start LO Writer
2) click on the "Basic shapes" toolbar button
3) click + drag to insert a shape into the document
4) click somewhere else

Backtrace is below.
`AtSpiAdaptor::handleMessage` (frame #12 in the bt) checks
whether the accessible is valid and returns early otherwise.
But since listeners were not notified when the object got disposed,
`QtAccessibleEventListener::disposing` wasn't called, which would
have taken care of invalidating the `QtAccessibleWidget`, in which
case this early return would have happened instead of the crash.

This behaves as expected now with this commit in place.

stderr output of the crash:

    terminate called after throwing an instance of 'com::sun::star::lang::DisposedException'

Backtrace:

    Thread 1 received signal SIGABRT, Aborted.
    __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  0x00007f5bc1ca815f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
    #2  0x00007f5bc1c5a472 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
    #3  0x00007f5bc1c444b2 in __GI_abort () at ./stdlib/abort.c:79
    #4  0x00007f5bc18a09eb in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
    #5  0x00007f5bc18affca in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
    #6  0x00007f5bc18b0035 in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
    #7  0x00007f5bc18b0288 in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
    #8  0x00007f5bc02b4550 in accessibility::AccessibleContextBase::ThrowIfDisposed() (this=0x55a6fc7e7da0) at .../libreoffice/editeng/source/accessibility/AccessibleContextBase.cxx:494
    #9  0x00007f5bbcf7d54e in accessibility::AccessibleShape::getAccessibleName() (this=0x55a6fc7e7da0) at .../libreoffice/svx/source/accessibility/AccessibleShape.cxx:280
    #10 0x00007f5bada62107 in QtAccessibleWidget::text(QAccessible::Text) const (this=0x55a6fad4fe20, text=QAccessible::Name) at .../libreoffice/vcl/qt6/../qt5/QtAccessibleWidget.cxx:362
    #11 0x00007f5bac5552d2 in AtSpiAdaptor::accessibleInterface(QAccessibleInterface*, QString const&, QDBusMessage const&, QDBusConnection const&) (this=0x55a6f769bce0, interface=0x55a6fad4fe20, function=..., message=..., connection=...)
        at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1545
    #12 0x00007f5bac553cce in AtSpiAdaptor::handleMessage(QDBusMessage const&, QDBusConnection const&) (this=0x55a6f769bce0, message=..., connection=...)
        at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1432
    #13 0x00007f5baaa88943 in QDBusConnectionPrivate::activateObject(QDBusConnectionPrivate::ObjectTreeNode&, QDBusMessage const&, int) (this=0x7f5ba4010f30, node=..., msg=..., pathStartPos=27)
        at .../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1448
    #14 0x00007f5baaa89628 in QDBusActivateObjectEvent::placeMetaCall(QObject*) (this=0x7f5ba4026980) at .../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1604
    #15 0x00007f5bad044013 in QObject::event(QEvent*) (this=0x55a6f769bce0, e=0x7f5ba4026980) at .../qt5/qtbase/src/corelib/kernel/qobject.cpp:1447
    #16 0x00007f5bab1a6986 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=0x55a6f631c3e0, receiver=0x55a6f769bce0, e=0x7f5ba4026980) at .../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3298
    #17 0x00007f5bab1a6797 in QApplication::notify(QObject*, QEvent*) (this=0x55a6f63bb840, receiver=0x55a6f769bce0, e=0x7f5ba4026980) at .../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3249
    #18 0x00007f5bacfb0212 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x55a6f769bce0, event=0x7f5ba4026980) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1138
    #19 0x00007f5bacfb0dbb in QCoreApplication::sendEvent(QObject*, QEvent*) (receiver=0x55a6f769bce0, event=0x7f5ba4026980) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1581
    #20 0x00007f5bacfb2474 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (receiver=0x0, event_type=0, data=0x55a6f6337df0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1936
    #21 0x00007f5bacfb160e in QCoreApplication::sendPostedEvents(QObject*, int) (receiver=0x0, event_type=0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1770
    #22 0x00007f5bad43441c in postEventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=0x55a6f642f710) at .../qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:244
    #23 0x00007f5bb47111f4 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #24 0x00007f5bb4714317 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #25 0x00007f5bb4714930 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #26 0x00007f5bad434cb1 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x55a6f6435dc0, flags=...) at .../qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:394
    #27 0x00007f5baa929e18 in QXcbGlibEventDispatcher::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x55a6f6435dc0, flags=...) at .../qt5/qtbase/src/plugins/platforms/xcb/qxcbeventdispatcher.cpp:96
    #28 0x00007f5badad8bea in QtInstance::ImplYield(bool, bool) (this=0x55a6f6442080, bWait=true, bHandleAllCurrentEvents=false) at .../libreoffice/vcl/qt6/../qt5/QtInstance.cxx:424
    #29 0x00007f5badad8d13 in QtInstance::DoYield(bool, bool) (this=0x55a6f6442080, bWait=true, bHandleAllCurrentEvents=false) at .../libreoffice/vcl/qt6/../qt5/QtInstance.cxx:435
    #30 0x00007f5bb8734af6 in ImplYield(bool, bool) (i_bWait=true, i_bAllEvents=false) at .../libreoffice/vcl/source/app/svapp.cxx:386
    #31 0x00007f5bb8735894 in Application::Yield() () at .../libreoffice/vcl/source/app/svapp.cxx:470
    #32 0x00007f5bb87347e9 in Application::Execute() () at .../libreoffice/vcl/source/app/svapp.cxx:364
    #33 0x00007f5bc1e36e66 in desktop::Desktop::Main() (this=0x7ffc62160570) at .../libreoffice/desktop/source/app/app.cxx:1614
    #34 0x00007f5bb8753ca0 in ImplSVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:229
    #35 0x00007f5bb8753fb5 in SVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:261
    #36 0x00007f5bc1ea4101 in soffice_main() () at .../libreoffice/desktop/source/app/sofficemain.cxx:94
    #37 0x000055a6f46e19d4 in sal_main () at .../libreoffice/desktop/source/app/main.c:51
    #38 0x000055a6f46e19ba in main (argc=2, argv=0x7ffc62160798) at .../libreoffice/desktop/source/app/main.c:49

Change-Id: Iae8a9ff61df99094b4cd73da895d1f6ac850c0c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162493
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
(cherry picked from commit 77874b76c50d704b26543175375dcfa65c4fd620)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162537
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
tdf-gerrit pushed a commit that referenced this pull request Jan 31, 2024
…n assert

so disable the SolarMutex checks during dumpState and restore afterwards

	#8  0x00007fa179e287f3 in abort () at /lib/x86_64-linux-gnu/libc.so.6
	#9  0x00007fa179e2871b in  () at /lib/x86_64-linux-gnu/libc.so.6
	#10 0x00007fa179e39e96 in  () at /lib/x86_64-linux-gnu/libc.so.6
	#11 0x00007fa1706904de in ImplDbgTestSolarMutex() () at libreoffice/vcl/source/app/dbggui.cxx:35
		__PRETTY_FUNCTION__ = "void ImplDbgTestSolarMutex()"
	#12 0x00007fa1782cb713 in DbgTestSolarMutex() () at libreoffice/tools/source/debug/debug.cxx:54
	#13 0x00007fa170559ebb in VirtualDevice::AcquireGraphics() const (this=0x5589006636b0) at libreoffice/vcl/source/gdi/virdev.cxx:49
		pSVData = 0x7fff8a2386d0
	#14 0x00007fa17020d849 in OutputDevice::DrawRect(tools::Rectangle const&) (this=0x5589006636b0, rRect=...) at libreoffice/vcl/source/outdev/rect.cxx:67
		__PRETTY_FUNCTION__ = "void OutputDevice::DrawRect(const tools::Rectangle&)"
		aRect = {static RECT_EMPTY = -32767, mnLeft = 0, mnTop = 0, mnRight = 10244, mnBottom = 269}
	#15 0x00007fa17021d997 in OutputDevice::DrawColorWallpaper(long, long, long, long, Wallpaper const&) (this=0x5589006636b0, nX=0, nY=0, nWidth=10245, nHeight=270, rWallpaper=...) at libreoffice/vcl/source/outdev/wallpaper.cxx:90
		__PRETTY_FUNCTION__ = "void OutputDevice::DrawColorWallpaper(tools::Long, tools::Long, tools::Long, tools::Long, const Wallpaper&)"
		aOldLineColor = {{mValue = 0, {B = 0 '\000', G = 0 '\000', R = 0 '\000', T = 0 '\000'}}}
		aOldFillColor = {{mValue = 16777215, {B = 255 '\377', G = 255 '\377', R = 255 '\377', T = 0 '\000'}}}
		bMap = false
	#16 0x00007fa17021d851 in OutputDevice::DrawWallpaper(long, long, long, long, Wallpaper const&) (this=0x5589006636b0, nX=0, nY=0, nWidth=10245, nHeight=270, rWallpaper=...) at libreoffice/vcl/source/outdev/wallpaper.cxx:73
		__PRETTY_FUNCTION__ = "void OutputDevice::DrawWallpaper(tools::Long, tools::Long, tools::Long, tools::Long, const Wallpaper&)"
	#17 0x00007fa17021daa8 in OutputDevice::Erase() (this=0x5589006636b0) at libreoffice/vcl/source/outdev/wallpaper.cxx:106
		eRasterOp = RasterOp::OverPaint
	#18 0x00007fa17055c716 in VirtualDevice::InnerImplSetOutputSizePixel(Size const&, bool, unsigned char*) (this=0x5589006636b0, rNewSize=..., bErase=true, pBuffer=0x0) at libreoffice/vcl/source/gdi/virdev.cxx:292
		bRet = true
		nNewWidth = 10245
		nNewHeight = 270
		__PRETTY_FUNCTION__ = "bool VirtualDevice::InnerImplSetOutputSizePixel(const Size&, bool, sal_uInt8*)"
	#19 0x00007fa17055cbf5 in VirtualDevice::ImplSetOutputSizePixel(Size const&, bool, unsigned char*) (this=0x5589006636b0, rNewSize=..., bErase=true, pBuffer=0x0) at libreoffice/vcl/source/gdi/virdev.cxx:360
	#20 0x00007fa17055ceba in VirtualDevice::SetOutputSizePixel(Size const&, bool) (this=0x5589006636b0, rNewSize=..., bErase=true) at libreoffice/vcl/source/gdi/virdev.cxx:408
	#21 0x00007fa16fea3ca4 in VirtualDevice::SetOutputSize(Size const&) (this=0x5589006636b0, rNewSize=...) at libreoffice/include/vcl/virdev.hxx:163
	#22 0x00007fa16fe96388 in VclDrawingArea::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588fe9ba320, rJsonWriter=...) at libreoffice/vcl/source/window/layout.cxx:3092
		pDevice = {<ScopedVclPtr<VirtualDevice>> = {<VclPtr<VirtualDevice>> = {m_rInnerRef = {m_pBody = 0x5589006636b0}}, <No data fields>}, <No data fields>}
		pRefDevice = 0x5588ff474fd0
		aRenderSize = {<Pair> = {mnA = 10245, mnB = 270}, <No data fields>}
		aOutputSize = {<Pair> = {mnA = 683, mnB = 18}, <No data fields>}
		aRect = {static RECT_EMPTY = -32767, mnLeft = 140735510973440, mnTop = 140331342376707, mnRight = 140735510973456, mnBottom = 94046886702440}
		aImage = {maBitmap = {_vptr.Bitmap = 0x7fff8a238c20, mxSalBmp = std::shared_ptr<class SalBitmap> (empty) = {get() = 0x7fa16fd029cc <std::__uniq_ptr_impl<WindowImpl, std::default_delete<WindowImpl> >::_M_ptr() const+28>}, maPrefMapMode = {mpImplMapMode = {m_pimpl = 0x7fff8a238d60}}, maPrefSize = {<Pair> = {mnA = 94046793857224, mnB = 140331516265348}, <No data fields>}}, maAlphaMask = {_vptr.Bitmap = 0x0, mxSalBmp = std::shared_ptr<class SalBitmap> (use count 1875914999, weak count 32672) = {get() = 0x5588ff46fa98}, maPrefMapMode = {mpImplMapMode = {m_pimpl = 0x7fa16fd030f7 <std::_Tuple_impl<0ul, WindowImpl*, std::default_delete<WindowImpl> >::_M_head(std::_Tuple_impl<0ul, WindowImpl*, std::default_delete<WindowImpl> > const&)+28>}}, maPrefSize = {<Pair> = {mnA = 94046793857224, mnB = 94046886754968}, <No data fields>}}, maBitmapSize = {<Pair> = {mnA = 140735510973568, mnB = 140331342377207}, <No data fields>}}
		aOStm = {<SvStream> = {_vptr.SvStream = 0x2ab, m_xLockBytes = {pObj = 0x12}, m_nActPos = 140735510973600, m_pRWBuf = std::unique_ptr<unsigned char []> = {get() = 0x7fa16fd03026 <std::__get_helper<0ul, WindowImpl*, std::default_delete<WindowImpl> >(std::_Tuple_impl<0ul, WindowImpl*, std::default_delete<WindowImpl> > const&)+28> "\311\303\363\017\036\372UH\211\345H\203\354\020H\211}\370H\213E\370H\211\307", <incomplete sequence \350\265>}, m_pBufPos = 0x7fff8a238cb0 "\340\214#\212\024", m_nBufSize = 64152, m_nBufActualLen = 65350, m_nBufActualPos = 21896, m_nBufFree = 0, m_isIoRead = 192, m_isIoWrite = 140, m_isDirty = 35, m_isSwap = 138, m_isEof = 255, m_nError = {m_value = 1875914499}, m_nCompressMode = (SvStreamCompressFlags::ZBITMAP | unknown: 0x7fa0), m_eLineDelimiter = (unknown: 0x8a238ce0), m_eStreamCharSet = 20, m_aCryptMaskKey = {pData = 0x5588ff46fa98}, m_nCryptMask = 224 '\340', m_nVersion = 16, m_nBufFilePos = 140735510975776, m_eStreamMode = 2317587744, m_isWritable = 255}, nSize = 140735510973776, nResize = 28087389472, nPos = 140735510975776, nEndOfData = 140735510975776, pBuf = 0x7fff8a238d58 " \225#\212\377\177", bOwnsData = 32}
	#23 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff46fa90, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 20
		nTop = -12124904
		nWidth = 21896
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588fe9ba320
		pAccLabelFor = 0x7fff8a238de0
		pAccLabelledBy = 0x68a238db0
	#24 0x00007fa16fe86709 in VclBox::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff46fa90, rJsonWriter=...) at libreoffice/vcl/source/window/layout.cxx:398
	#25 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff46fd10, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 32767
		nTop = -12221224
		nWidth = 21896
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588ff46fa90
		pAccLabelFor = 0x7fff8a238e58
		pAccLabelledBy = 0x7fff8a238e20
	#26 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff462d60, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = -1
		nTop = -1
		nWidth = 1
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588ff46fd10
		pAccLabelFor = 0x5588ff458838
		pAccLabelledBy = 0x7fff8a238e90
	#27 0x00007fa16fe8fecd in VclScrolledWindow::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff462d60, rJsonWriter=...) at libreoffice/vcl/source/window/layout.cxx:2184
	#28 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff458830, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 20
		nTop = -12220472
		nWidth = 21896
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588ff462d60
		pAccLabelFor = 0x7fff8a238fb0
		pAccLabelledBy = 0x68a238f80
	#29 0x00007fa16fe86709 in VclBox::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff458830, rJsonWriter=...) at libreoffice/vcl/source/window/layout.cxx:398
	#30 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff4587c0, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 20
		nTop = -18974136
		nWidth = 21896
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588ff458830
		pAccLabelFor = 0x7fff8a239040
		pAccLabelledBy = 0x68a239010
	#31 0x00007fa16fe8becd in VclGrid::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff4587c0, rJsonWriter=...) at libreoffice/vcl/source/window/layout.cxx:1406
	#32 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588fede7a40, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 20
		nTop = -22893640
		nWidth = 21896
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588ff4587c0
		pAccLabelFor = 0x7fff8a2390d0
		pAccLabelledBy = 0x68a2390a0
	#33 0x00007fa16fe86709 in VclBox::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588fede7a40, rJsonWriter=...) at libreoffice/vcl/source/window/layout.cxx:398
	#34 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588fea2abb0, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 32767
		nTop = -1977380544
		nWidth = 32767
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588fede7a40
		pAccLabelFor = 0x7fff8a239148
		pAccLabelledBy = 0x7fff8a239110
	#35 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588feddd8a0, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 0
		nTop = 2049803913
		nWidth = 32673
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588fea2abb0
		pAccLabelFor = 0x7fa16fcdc774 <__gnu_debug::_Safe_sequence_base::~_Safe_sequence_base()+28>
		pAccLabelledBy = 0x0
	#36 0x00007fa16ff6e15e in ToolBox::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588feddd8a0, rJsonWriter=...) at libreoffice/vcl/source/window/toolbox2.cxx:1713
		childrenNode = {mrWriter = @0x7fa16fd6409c}
	#37 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588fee04430, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = -1
		nTop = -1
		nWidth = 1
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588feddd8a0
		pAccLabelFor = 0x7fff8a2393c8
		pAccLabelledBy = 0x7fff8a239390
	#38 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff2738a0, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 32767
		nTop = -1977379792
		nWidth = 32767
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588fee04430
		pAccLabelFor = 0x7fff8a239438
		pAccLabelledBy = 0x7fff8a239400
	#39 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588fedbafd0, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 32767
		nTop = -1977379680
		nWidth = 32767
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588ff2738a0
		pAccLabelFor = 0x7fff8a2394a8
		pAccLabelledBy = 0x7fff8a239470
	#40 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588fedc2d50, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 21896
		nTop = 2045399353
		nWidth = 32673
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588fedbafd0
		pAccLabelFor = 0x7fff8a239520
		pAccLabelledBy = 0x7fff8a2394e0
	#41 0x00007fa170764efa in vcl::lok::dumpState(rtl::OStringBuffer&) (rState=...) at libreoffice/vcl/source/app/svapp.cxx:1868
		props = {mpBuffer = 0x5588ff911780 "{ \"id\": \"\", \"type\": \"borderwindow\", \"text\": \"hello-world.ods - Collabora OfficeDev Calc 23.05 [ebacfb1]\", \"enabled\": true, \"children\": [ { \"id\": \"\", \"type\": \"workwindo"..., mPos = 0x5588ff912c3c "", mSpaceAllocated = 8244, mStartNodeCount = 24, mbFirstFieldInNode = false, static JSON_WRITER_DEBUG_MARKER = 222 '\336'}
		pSVData = 0x7fa171f3aea0 <rtl::Static<ImplSVData, (anonymous namespace)::private_aImplSVData>::get()::instance>
		pWin = 0x5588fedc2d50
	#42 0x00007fa179b08219 in desktop::LibLibreOffice_Impl::dumpState(rtl::OStringBuffer&) (this=0x5588fa5a7710, rState=...) at libreoffice/desktop/source/lib/init.cxx:5105
	#43 0x00007fa179b08002 in lo_dumpState(LibreOfficeKit*, char const*, char**) (pThis=0x5588fa5a7710, pState=0x7fff8a239630) at libreoffice/desktop/source/lib/init.cxx:5086
		aState = {pData = 0x5588ffa27670, nCapacity = 1048576}
		pLib = 0x5588fa5a7710
		aStr = {pData = 0x5588ff9bfd30}
	#44 0x00005588f9b2e947 in lok::Office::dumpState(char const*, char**) (pState=0x7fff8a239630, pOption=0x5588f9bd5e4d "", this=<optimized out>) at libreoffice/include/LibreOfficeKit/LibreOfficeKit.hxx:1149
		pState = 0x0

Change-Id: Icc5910238656566479ea0796c25779866ff8ec7f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162794
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
tdf-gerrit pushed a commit that referenced this pull request Jan 31, 2024
…n assert

so disable the SolarMutex checks during dumpState and restore afterwards

	#8  0x00007fa179e287f3 in abort () at /lib/x86_64-linux-gnu/libc.so.6
	#9  0x00007fa179e2871b in  () at /lib/x86_64-linux-gnu/libc.so.6
	#10 0x00007fa179e39e96 in  () at /lib/x86_64-linux-gnu/libc.so.6
	#11 0x00007fa1706904de in ImplDbgTestSolarMutex() () at libreoffice/vcl/source/app/dbggui.cxx:35
		__PRETTY_FUNCTION__ = "void ImplDbgTestSolarMutex()"
	#12 0x00007fa1782cb713 in DbgTestSolarMutex() () at libreoffice/tools/source/debug/debug.cxx:54
	#13 0x00007fa170559ebb in VirtualDevice::AcquireGraphics() const (this=0x5589006636b0) at libreoffice/vcl/source/gdi/virdev.cxx:49
		pSVData = 0x7fff8a2386d0
	#14 0x00007fa17020d849 in OutputDevice::DrawRect(tools::Rectangle const&) (this=0x5589006636b0, rRect=...) at libreoffice/vcl/source/outdev/rect.cxx:67
		__PRETTY_FUNCTION__ = "void OutputDevice::DrawRect(const tools::Rectangle&)"
		aRect = {static RECT_EMPTY = -32767, mnLeft = 0, mnTop = 0, mnRight = 10244, mnBottom = 269}
	#15 0x00007fa17021d997 in OutputDevice::DrawColorWallpaper(long, long, long, long, Wallpaper const&) (this=0x5589006636b0, nX=0, nY=0, nWidth=10245, nHeight=270, rWallpaper=...) at libreoffice/vcl/source/outdev/wallpaper.cxx:90
		__PRETTY_FUNCTION__ = "void OutputDevice::DrawColorWallpaper(tools::Long, tools::Long, tools::Long, tools::Long, const Wallpaper&)"
		aOldLineColor = {{mValue = 0, {B = 0 '\000', G = 0 '\000', R = 0 '\000', T = 0 '\000'}}}
		aOldFillColor = {{mValue = 16777215, {B = 255 '\377', G = 255 '\377', R = 255 '\377', T = 0 '\000'}}}
		bMap = false
	#16 0x00007fa17021d851 in OutputDevice::DrawWallpaper(long, long, long, long, Wallpaper const&) (this=0x5589006636b0, nX=0, nY=0, nWidth=10245, nHeight=270, rWallpaper=...) at libreoffice/vcl/source/outdev/wallpaper.cxx:73
		__PRETTY_FUNCTION__ = "void OutputDevice::DrawWallpaper(tools::Long, tools::Long, tools::Long, tools::Long, const Wallpaper&)"
	#17 0x00007fa17021daa8 in OutputDevice::Erase() (this=0x5589006636b0) at libreoffice/vcl/source/outdev/wallpaper.cxx:106
		eRasterOp = RasterOp::OverPaint
	#18 0x00007fa17055c716 in VirtualDevice::InnerImplSetOutputSizePixel(Size const&, bool, unsigned char*) (this=0x5589006636b0, rNewSize=..., bErase=true, pBuffer=0x0) at libreoffice/vcl/source/gdi/virdev.cxx:292
		bRet = true
		nNewWidth = 10245
		nNewHeight = 270
		__PRETTY_FUNCTION__ = "bool VirtualDevice::InnerImplSetOutputSizePixel(const Size&, bool, sal_uInt8*)"
	#19 0x00007fa17055cbf5 in VirtualDevice::ImplSetOutputSizePixel(Size const&, bool, unsigned char*) (this=0x5589006636b0, rNewSize=..., bErase=true, pBuffer=0x0) at libreoffice/vcl/source/gdi/virdev.cxx:360
	#20 0x00007fa17055ceba in VirtualDevice::SetOutputSizePixel(Size const&, bool) (this=0x5589006636b0, rNewSize=..., bErase=true) at libreoffice/vcl/source/gdi/virdev.cxx:408
	#21 0x00007fa16fea3ca4 in VirtualDevice::SetOutputSize(Size const&) (this=0x5589006636b0, rNewSize=...) at libreoffice/include/vcl/virdev.hxx:163
	#22 0x00007fa16fe96388 in VclDrawingArea::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588fe9ba320, rJsonWriter=...) at libreoffice/vcl/source/window/layout.cxx:3092
		pDevice = {<ScopedVclPtr<VirtualDevice>> = {<VclPtr<VirtualDevice>> = {m_rInnerRef = {m_pBody = 0x5589006636b0}}, <No data fields>}, <No data fields>}
		pRefDevice = 0x5588ff474fd0
		aRenderSize = {<Pair> = {mnA = 10245, mnB = 270}, <No data fields>}
		aOutputSize = {<Pair> = {mnA = 683, mnB = 18}, <No data fields>}
		aRect = {static RECT_EMPTY = -32767, mnLeft = 140735510973440, mnTop = 140331342376707, mnRight = 140735510973456, mnBottom = 94046886702440}
		aImage = {maBitmap = {_vptr.Bitmap = 0x7fff8a238c20, mxSalBmp = std::shared_ptr<class SalBitmap> (empty) = {get() = 0x7fa16fd029cc <std::__uniq_ptr_impl<WindowImpl, std::default_delete<WindowImpl> >::_M_ptr() const+28>}, maPrefMapMode = {mpImplMapMode = {m_pimpl = 0x7fff8a238d60}}, maPrefSize = {<Pair> = {mnA = 94046793857224, mnB = 140331516265348}, <No data fields>}}, maAlphaMask = {_vptr.Bitmap = 0x0, mxSalBmp = std::shared_ptr<class SalBitmap> (use count 1875914999, weak count 32672) = {get() = 0x5588ff46fa98}, maPrefMapMode = {mpImplMapMode = {m_pimpl = 0x7fa16fd030f7 <std::_Tuple_impl<0ul, WindowImpl*, std::default_delete<WindowImpl> >::_M_head(std::_Tuple_impl<0ul, WindowImpl*, std::default_delete<WindowImpl> > const&)+28>}}, maPrefSize = {<Pair> = {mnA = 94046793857224, mnB = 94046886754968}, <No data fields>}}, maBitmapSize = {<Pair> = {mnA = 140735510973568, mnB = 140331342377207}, <No data fields>}}
		aOStm = {<SvStream> = {_vptr.SvStream = 0x2ab, m_xLockBytes = {pObj = 0x12}, m_nActPos = 140735510973600, m_pRWBuf = std::unique_ptr<unsigned char []> = {get() = 0x7fa16fd03026 <std::__get_helper<0ul, WindowImpl*, std::default_delete<WindowImpl> >(std::_Tuple_impl<0ul, WindowImpl*, std::default_delete<WindowImpl> > const&)+28> "\311\303\363\017\036\372UH\211\345H\203\354\020H\211}\370H\213E\370H\211\307", <incomplete sequence \350\265>}, m_pBufPos = 0x7fff8a238cb0 "\340\214#\212\024", m_nBufSize = 64152, m_nBufActualLen = 65350, m_nBufActualPos = 21896, m_nBufFree = 0, m_isIoRead = 192, m_isIoWrite = 140, m_isDirty = 35, m_isSwap = 138, m_isEof = 255, m_nError = {m_value = 1875914499}, m_nCompressMode = (SvStreamCompressFlags::ZBITMAP | unknown: 0x7fa0), m_eLineDelimiter = (unknown: 0x8a238ce0), m_eStreamCharSet = 20, m_aCryptMaskKey = {pData = 0x5588ff46fa98}, m_nCryptMask = 224 '\340', m_nVersion = 16, m_nBufFilePos = 140735510975776, m_eStreamMode = 2317587744, m_isWritable = 255}, nSize = 140735510973776, nResize = 28087389472, nPos = 140735510975776, nEndOfData = 140735510975776, pBuf = 0x7fff8a238d58 " \225#\212\377\177", bOwnsData = 32}
	#23 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff46fa90, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 20
		nTop = -12124904
		nWidth = 21896
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588fe9ba320
		pAccLabelFor = 0x7fff8a238de0
		pAccLabelledBy = 0x68a238db0
	#24 0x00007fa16fe86709 in VclBox::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff46fa90, rJsonWriter=...) at libreoffice/vcl/source/window/layout.cxx:398
	#25 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff46fd10, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 32767
		nTop = -12221224
		nWidth = 21896
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588ff46fa90
		pAccLabelFor = 0x7fff8a238e58
		pAccLabelledBy = 0x7fff8a238e20
	#26 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff462d60, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = -1
		nTop = -1
		nWidth = 1
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588ff46fd10
		pAccLabelFor = 0x5588ff458838
		pAccLabelledBy = 0x7fff8a238e90
	#27 0x00007fa16fe8fecd in VclScrolledWindow::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff462d60, rJsonWriter=...) at libreoffice/vcl/source/window/layout.cxx:2184
	#28 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff458830, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 20
		nTop = -12220472
		nWidth = 21896
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588ff462d60
		pAccLabelFor = 0x7fff8a238fb0
		pAccLabelledBy = 0x68a238f80
	#29 0x00007fa16fe86709 in VclBox::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff458830, rJsonWriter=...) at libreoffice/vcl/source/window/layout.cxx:398
	#30 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff4587c0, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 20
		nTop = -18974136
		nWidth = 21896
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588ff458830
		pAccLabelFor = 0x7fff8a239040
		pAccLabelledBy = 0x68a239010
	#31 0x00007fa16fe8becd in VclGrid::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff4587c0, rJsonWriter=...) at libreoffice/vcl/source/window/layout.cxx:1406
	#32 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588fede7a40, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 20
		nTop = -22893640
		nWidth = 21896
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588ff4587c0
		pAccLabelFor = 0x7fff8a2390d0
		pAccLabelledBy = 0x68a2390a0
	#33 0x00007fa16fe86709 in VclBox::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588fede7a40, rJsonWriter=...) at libreoffice/vcl/source/window/layout.cxx:398
	#34 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588fea2abb0, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 32767
		nTop = -1977380544
		nWidth = 32767
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588fede7a40
		pAccLabelFor = 0x7fff8a239148
		pAccLabelledBy = 0x7fff8a239110
	#35 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588feddd8a0, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 0
		nTop = 2049803913
		nWidth = 32673
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588fea2abb0
		pAccLabelFor = 0x7fa16fcdc774 <__gnu_debug::_Safe_sequence_base::~_Safe_sequence_base()+28>
		pAccLabelledBy = 0x0
	#36 0x00007fa16ff6e15e in ToolBox::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588feddd8a0, rJsonWriter=...) at libreoffice/vcl/source/window/toolbox2.cxx:1713
		childrenNode = {mrWriter = @0x7fa16fd6409c}
	#37 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588fee04430, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = -1
		nTop = -1
		nWidth = 1
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588feddd8a0
		pAccLabelFor = 0x7fff8a2393c8
		pAccLabelledBy = 0x7fff8a239390
	#38 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff2738a0, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 32767
		nTop = -1977379792
		nWidth = 32767
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588fee04430
		pAccLabelFor = 0x7fff8a239438
		pAccLabelledBy = 0x7fff8a239400
	#39 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588fedbafd0, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 32767
		nTop = -1977379680
		nWidth = 32767
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588ff2738a0
		pAccLabelFor = 0x7fff8a2394a8
		pAccLabelledBy = 0x7fff8a239470
	#40 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588fedc2d50, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 21896
		nTop = 2045399353
		nWidth = 32673
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588fedbafd0
		pAccLabelFor = 0x7fff8a239520
		pAccLabelledBy = 0x7fff8a2394e0
	#41 0x00007fa170764efa in vcl::lok::dumpState(rtl::OStringBuffer&) (rState=...) at libreoffice/vcl/source/app/svapp.cxx:1868
		props = {mpBuffer = 0x5588ff911780 "{ \"id\": \"\", \"type\": \"borderwindow\", \"text\": \"hello-world.ods - Collabora OfficeDev Calc 23.05 [ebacfb1]\", \"enabled\": true, \"children\": [ { \"id\": \"\", \"type\": \"workwindo"..., mPos = 0x5588ff912c3c "", mSpaceAllocated = 8244, mStartNodeCount = 24, mbFirstFieldInNode = false, static JSON_WRITER_DEBUG_MARKER = 222 '\336'}
		pSVData = 0x7fa171f3aea0 <rtl::Static<ImplSVData, (anonymous namespace)::private_aImplSVData>::get()::instance>
		pWin = 0x5588fedc2d50
	#42 0x00007fa179b08219 in desktop::LibLibreOffice_Impl::dumpState(rtl::OStringBuffer&) (this=0x5588fa5a7710, rState=...) at libreoffice/desktop/source/lib/init.cxx:5105
	#43 0x00007fa179b08002 in lo_dumpState(LibreOfficeKit*, char const*, char**) (pThis=0x5588fa5a7710, pState=0x7fff8a239630) at libreoffice/desktop/source/lib/init.cxx:5086
		aState = {pData = 0x5588ffa27670, nCapacity = 1048576}
		pLib = 0x5588fa5a7710
		aStr = {pData = 0x5588ff9bfd30}
	#44 0x00005588f9b2e947 in lok::Office::dumpState(char const*, char**) (pState=0x7fff8a239630, pOption=0x5588f9bd5e4d "", this=<optimized out>) at libreoffice/include/LibreOfficeKit/LibreOfficeKit.hxx:1149
		pState = 0x0

Change-Id: Icc5910238656566479ea0796c25779866ff8ec7f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162794
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
(cherry picked from commit f4fa41c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162815
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
tdf-gerrit pushed a commit that referenced this pull request Jan 31, 2024
…n assert

so disable the SolarMutex checks during dumpState and restore afterwards

	#8  0x00007fa179e287f3 in abort () at /lib/x86_64-linux-gnu/libc.so.6
	#9  0x00007fa179e2871b in  () at /lib/x86_64-linux-gnu/libc.so.6
	#10 0x00007fa179e39e96 in  () at /lib/x86_64-linux-gnu/libc.so.6
	#11 0x00007fa1706904de in ImplDbgTestSolarMutex() () at libreoffice/vcl/source/app/dbggui.cxx:35
		__PRETTY_FUNCTION__ = "void ImplDbgTestSolarMutex()"
	#12 0x00007fa1782cb713 in DbgTestSolarMutex() () at libreoffice/tools/source/debug/debug.cxx:54
	#13 0x00007fa170559ebb in VirtualDevice::AcquireGraphics() const (this=0x5589006636b0) at libreoffice/vcl/source/gdi/virdev.cxx:49
		pSVData = 0x7fff8a2386d0
	#14 0x00007fa17020d849 in OutputDevice::DrawRect(tools::Rectangle const&) (this=0x5589006636b0, rRect=...) at libreoffice/vcl/source/outdev/rect.cxx:67
		__PRETTY_FUNCTION__ = "void OutputDevice::DrawRect(const tools::Rectangle&)"
		aRect = {static RECT_EMPTY = -32767, mnLeft = 0, mnTop = 0, mnRight = 10244, mnBottom = 269}
	#15 0x00007fa17021d997 in OutputDevice::DrawColorWallpaper(long, long, long, long, Wallpaper const&) (this=0x5589006636b0, nX=0, nY=0, nWidth=10245, nHeight=270, rWallpaper=...) at libreoffice/vcl/source/outdev/wallpaper.cxx:90
		__PRETTY_FUNCTION__ = "void OutputDevice::DrawColorWallpaper(tools::Long, tools::Long, tools::Long, tools::Long, const Wallpaper&)"
		aOldLineColor = {{mValue = 0, {B = 0 '\000', G = 0 '\000', R = 0 '\000', T = 0 '\000'}}}
		aOldFillColor = {{mValue = 16777215, {B = 255 '\377', G = 255 '\377', R = 255 '\377', T = 0 '\000'}}}
		bMap = false
	#16 0x00007fa17021d851 in OutputDevice::DrawWallpaper(long, long, long, long, Wallpaper const&) (this=0x5589006636b0, nX=0, nY=0, nWidth=10245, nHeight=270, rWallpaper=...) at libreoffice/vcl/source/outdev/wallpaper.cxx:73
		__PRETTY_FUNCTION__ = "void OutputDevice::DrawWallpaper(tools::Long, tools::Long, tools::Long, tools::Long, const Wallpaper&)"
	#17 0x00007fa17021daa8 in OutputDevice::Erase() (this=0x5589006636b0) at libreoffice/vcl/source/outdev/wallpaper.cxx:106
		eRasterOp = RasterOp::OverPaint
	#18 0x00007fa17055c716 in VirtualDevice::InnerImplSetOutputSizePixel(Size const&, bool, unsigned char*) (this=0x5589006636b0, rNewSize=..., bErase=true, pBuffer=0x0) at libreoffice/vcl/source/gdi/virdev.cxx:292
		bRet = true
		nNewWidth = 10245
		nNewHeight = 270
		__PRETTY_FUNCTION__ = "bool VirtualDevice::InnerImplSetOutputSizePixel(const Size&, bool, sal_uInt8*)"
	#19 0x00007fa17055cbf5 in VirtualDevice::ImplSetOutputSizePixel(Size const&, bool, unsigned char*) (this=0x5589006636b0, rNewSize=..., bErase=true, pBuffer=0x0) at libreoffice/vcl/source/gdi/virdev.cxx:360
	#20 0x00007fa17055ceba in VirtualDevice::SetOutputSizePixel(Size const&, bool) (this=0x5589006636b0, rNewSize=..., bErase=true) at libreoffice/vcl/source/gdi/virdev.cxx:408
	#21 0x00007fa16fea3ca4 in VirtualDevice::SetOutputSize(Size const&) (this=0x5589006636b0, rNewSize=...) at libreoffice/include/vcl/virdev.hxx:163
	#22 0x00007fa16fe96388 in VclDrawingArea::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588fe9ba320, rJsonWriter=...) at libreoffice/vcl/source/window/layout.cxx:3092
		pDevice = {<ScopedVclPtr<VirtualDevice>> = {<VclPtr<VirtualDevice>> = {m_rInnerRef = {m_pBody = 0x5589006636b0}}, <No data fields>}, <No data fields>}
		pRefDevice = 0x5588ff474fd0
		aRenderSize = {<Pair> = {mnA = 10245, mnB = 270}, <No data fields>}
		aOutputSize = {<Pair> = {mnA = 683, mnB = 18}, <No data fields>}
		aRect = {static RECT_EMPTY = -32767, mnLeft = 140735510973440, mnTop = 140331342376707, mnRight = 140735510973456, mnBottom = 94046886702440}
		aImage = {maBitmap = {_vptr.Bitmap = 0x7fff8a238c20, mxSalBmp = std::shared_ptr<class SalBitmap> (empty) = {get() = 0x7fa16fd029cc <std::__uniq_ptr_impl<WindowImpl, std::default_delete<WindowImpl> >::_M_ptr() const+28>}, maPrefMapMode = {mpImplMapMode = {m_pimpl = 0x7fff8a238d60}}, maPrefSize = {<Pair> = {mnA = 94046793857224, mnB = 140331516265348}, <No data fields>}}, maAlphaMask = {_vptr.Bitmap = 0x0, mxSalBmp = std::shared_ptr<class SalBitmap> (use count 1875914999, weak count 32672) = {get() = 0x5588ff46fa98}, maPrefMapMode = {mpImplMapMode = {m_pimpl = 0x7fa16fd030f7 <std::_Tuple_impl<0ul, WindowImpl*, std::default_delete<WindowImpl> >::_M_head(std::_Tuple_impl<0ul, WindowImpl*, std::default_delete<WindowImpl> > const&)+28>}}, maPrefSize = {<Pair> = {mnA = 94046793857224, mnB = 94046886754968}, <No data fields>}}, maBitmapSize = {<Pair> = {mnA = 140735510973568, mnB = 140331342377207}, <No data fields>}}
		aOStm = {<SvStream> = {_vptr.SvStream = 0x2ab, m_xLockBytes = {pObj = 0x12}, m_nActPos = 140735510973600, m_pRWBuf = std::unique_ptr<unsigned char []> = {get() = 0x7fa16fd03026 <std::__get_helper<0ul, WindowImpl*, std::default_delete<WindowImpl> >(std::_Tuple_impl<0ul, WindowImpl*, std::default_delete<WindowImpl> > const&)+28> "\311\303\363\017\036\372UH\211\345H\203\354\020H\211}\370H\213E\370H\211\307", <incomplete sequence \350\265>}, m_pBufPos = 0x7fff8a238cb0 "\340\214#\212\024", m_nBufSize = 64152, m_nBufActualLen = 65350, m_nBufActualPos = 21896, m_nBufFree = 0, m_isIoRead = 192, m_isIoWrite = 140, m_isDirty = 35, m_isSwap = 138, m_isEof = 255, m_nError = {m_value = 1875914499}, m_nCompressMode = (SvStreamCompressFlags::ZBITMAP | unknown: 0x7fa0), m_eLineDelimiter = (unknown: 0x8a238ce0), m_eStreamCharSet = 20, m_aCryptMaskKey = {pData = 0x5588ff46fa98}, m_nCryptMask = 224 '\340', m_nVersion = 16, m_nBufFilePos = 140735510975776, m_eStreamMode = 2317587744, m_isWritable = 255}, nSize = 140735510973776, nResize = 28087389472, nPos = 140735510975776, nEndOfData = 140735510975776, pBuf = 0x7fff8a238d58 " \225#\212\377\177", bOwnsData = 32}
	#23 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff46fa90, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 20
		nTop = -12124904
		nWidth = 21896
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588fe9ba320
		pAccLabelFor = 0x7fff8a238de0
		pAccLabelledBy = 0x68a238db0
	#24 0x00007fa16fe86709 in VclBox::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff46fa90, rJsonWriter=...) at libreoffice/vcl/source/window/layout.cxx:398
	#25 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff46fd10, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 32767
		nTop = -12221224
		nWidth = 21896
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588ff46fa90
		pAccLabelFor = 0x7fff8a238e58
		pAccLabelledBy = 0x7fff8a238e20
	#26 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff462d60, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = -1
		nTop = -1
		nWidth = 1
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588ff46fd10
		pAccLabelFor = 0x5588ff458838
		pAccLabelledBy = 0x7fff8a238e90
	#27 0x00007fa16fe8fecd in VclScrolledWindow::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff462d60, rJsonWriter=...) at libreoffice/vcl/source/window/layout.cxx:2184
	#28 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff458830, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 20
		nTop = -12220472
		nWidth = 21896
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588ff462d60
		pAccLabelFor = 0x7fff8a238fb0
		pAccLabelledBy = 0x68a238f80
	#29 0x00007fa16fe86709 in VclBox::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff458830, rJsonWriter=...) at libreoffice/vcl/source/window/layout.cxx:398
	#30 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff4587c0, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 20
		nTop = -18974136
		nWidth = 21896
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588ff458830
		pAccLabelFor = 0x7fff8a239040
		pAccLabelledBy = 0x68a239010
	#31 0x00007fa16fe8becd in VclGrid::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff4587c0, rJsonWriter=...) at libreoffice/vcl/source/window/layout.cxx:1406
	#32 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588fede7a40, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 20
		nTop = -22893640
		nWidth = 21896
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588ff4587c0
		pAccLabelFor = 0x7fff8a2390d0
		pAccLabelledBy = 0x68a2390a0
	#33 0x00007fa16fe86709 in VclBox::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588fede7a40, rJsonWriter=...) at libreoffice/vcl/source/window/layout.cxx:398
	#34 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588fea2abb0, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 32767
		nTop = -1977380544
		nWidth = 32767
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588fede7a40
		pAccLabelFor = 0x7fff8a239148
		pAccLabelledBy = 0x7fff8a239110
	#35 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588feddd8a0, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 0
		nTop = 2049803913
		nWidth = 32673
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588fea2abb0
		pAccLabelFor = 0x7fa16fcdc774 <__gnu_debug::_Safe_sequence_base::~_Safe_sequence_base()+28>
		pAccLabelledBy = 0x0
	#36 0x00007fa16ff6e15e in ToolBox::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588feddd8a0, rJsonWriter=...) at libreoffice/vcl/source/window/toolbox2.cxx:1713
		childrenNode = {mrWriter = @0x7fa16fd6409c}
	#37 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588fee04430, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = -1
		nTop = -1
		nWidth = 1
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588feddd8a0
		pAccLabelFor = 0x7fff8a2393c8
		pAccLabelledBy = 0x7fff8a239390
	#38 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588ff2738a0, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 32767
		nTop = -1977379792
		nWidth = 32767
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588fee04430
		pAccLabelFor = 0x7fff8a239438
		pAccLabelledBy = 0x7fff8a239400
	#39 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588fedbafd0, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 32767
		nTop = -1977379680
		nWidth = 32767
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588ff2738a0
		pAccLabelFor = 0x7fff8a2394a8
		pAccLabelledBy = 0x7fff8a239470
	#40 0x00007fa16ffbcaba in vcl::Window::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588fedc2d50, rJsonWriter=...) at libreoffice/vcl/source/window/window.cxx:3388
		childNode = {mrWriter = @0x7fff8a239520}
		nLeft = 21896
		nTop = 2045399353
		nWidth = 32673
		childrenNode = {mrWriter = @0x7fff8a239520}
		pChild = 0x5588fedbafd0
		pAccLabelFor = 0x7fff8a239520
		pAccLabelledBy = 0x7fff8a2394e0
	#41 0x00007fa170764efa in vcl::lok::dumpState(rtl::OStringBuffer&) (rState=...) at libreoffice/vcl/source/app/svapp.cxx:1868
		props = {mpBuffer = 0x5588ff911780 "{ \"id\": \"\", \"type\": \"borderwindow\", \"text\": \"hello-world.ods - Collabora OfficeDev Calc 23.05 [ebacfb1]\", \"enabled\": true, \"children\": [ { \"id\": \"\", \"type\": \"workwindo"..., mPos = 0x5588ff912c3c "", mSpaceAllocated = 8244, mStartNodeCount = 24, mbFirstFieldInNode = false, static JSON_WRITER_DEBUG_MARKER = 222 '\336'}
		pSVData = 0x7fa171f3aea0 <rtl::Static<ImplSVData, (anonymous namespace)::private_aImplSVData>::get()::instance>
		pWin = 0x5588fedc2d50
	#42 0x00007fa179b08219 in desktop::LibLibreOffice_Impl::dumpState(rtl::OStringBuffer&) (this=0x5588fa5a7710, rState=...) at libreoffice/desktop/source/lib/init.cxx:5105
	#43 0x00007fa179b08002 in lo_dumpState(LibreOfficeKit*, char const*, char**) (pThis=0x5588fa5a7710, pState=0x7fff8a239630) at libreoffice/desktop/source/lib/init.cxx:5086
		aState = {pData = 0x5588ffa27670, nCapacity = 1048576}
		pLib = 0x5588fa5a7710
		aStr = {pData = 0x5588ff9bfd30}
	#44 0x00005588f9b2e947 in lok::Office::dumpState(char const*, char**) (pState=0x7fff8a239630, pOption=0x5588f9bd5e4d "", this=<optimized out>) at libreoffice/include/LibreOfficeKit/LibreOfficeKit.hxx:1149
		pState = 0x0

Change-Id: Icc5910238656566479ea0796c25779866ff8ec7f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162794
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
(cherry picked from commit f4fa41c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162816
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
tdf-gerrit pushed a commit that referenced this pull request Feb 10, 2024
In `SwTransferable::RemoveDDELinkFormat`, only update the
clipboard content with this `SwTransferable` after removing
the `SotClipboardFormatId::LINK` from the supported formats
if the `SwTransferable` was the clipboard content before
already.

Doing so always would unrelatedly overwrite what was previously
copied from another application to the clipboard for the
tdf#158947 scenario of pasting clipboard content of another
application over a selection when using the Qt-based VCL plugins
on Wayland (s. backtrace below that shows how the clipboard content
was overwritten, frame #17 is the method changed in this
commit).

My assumption why the clipboard content is explicitly overwritten
at all is to make sure that the system clipboard on some platforms
gets notified about the change in supported formats/mime
types after removing one. But that isn't necessary when the
transfer data modified here aren't the current clipboard content
in the first place.

Backtrace for how clipboard content was previously overwritten
for the tdf#158947 scenario with the qt6 VCL plugin on Wayland:

    ~"#0  QtClipboard::handleChanged(QClipboard::Mode) (this=0x557f90457770, aMode=QClipboard::Clipboard) at .../libreoffice/vcl/qt6/../qt5/QtClipboard.cxx:156\n"
    ~"#1  0x00007f26f08844ff in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QClipboard::Mode>, void, void (QtClipboard::*)(QClipboard::Mode)>::call(void (QtClipboard::*)(QClipboard::Mode), QtClipboard*, void**)::{lambda()#1}::operator()() const (__closure=0x7ffe889a2c20) at .../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:153\n"
    ~"#2  0x00007f26f0884ffb in QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QClipboard::Mode>, void, void (QtClipboard::*)(QClipboard::Mode)>::call(void (QtClipboard::*)(QClipboard::Mode), QtClipboard*, void**)::{lambda()#1}>(void**, QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QClipboard::Mode>, void, void (QtClipboard::*)(QClipboard::Mode)>::call(void (QtClipboard::*)(QClipboard::Mode), QtClipboard*, void**)::{lambda()#1}&&) (args=0x7ffe889a2ed0, fn=...) at .../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:72\n"
    ~"#3  0x00007f26f088456f in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QClipboard::Mode>, void, void (QtClipboard::*)(QClipboard::Mode)>::call(void (QtClipboard::*)(QClipboard::Mode), QtClipboard*, void**) (f=(void (QtClipboard::*)(QtClipboard * const, QClipboard::Mode)) 0x7f26f087a76e <QtClipboard::handleChanged(QClipboard::Mode)>, o=0x557f90457770, arg=0x7ffe889a2ed0) at .../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:152\n"
    ~"#4  0x00007f26f08833de in QtPrivate::FunctionPointer<void (QtClipboard::*)(QClipboard::Mode)>::call<QtPrivate::List<QClipboard::Mode>, void>(void (QtClipboard::*)(QClipboard::Mode), QtClipboard*, void**) (f=(void (QtClipboard::*)(QtClipboard * const, QClipboard::Mode)) 0x7f26f087a76e <QtClipboard::handleChanged(QClipboard::Mode)>, o=0x557f90457770, arg=0x7ffe889a2ed0) at .../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:200\n"
    ~"#5  0x00007f26f0881f71 in QtPrivate::QCallableObject<void (QtClipboard::*)(QClipboard::Mode), QtPrivate::List<QClipboard::Mode>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x557f904555f0, r=0x557f90457770, a=0x7ffe889a2ed0, ret=0x0) at .../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:571\n"
    ~"#6  0x00007f26efdb863f in QtPrivate::QSlotObjectBase::call(QObject*, void**) (this=0x557f904555f0, r=0x557f90457770, a=0x7ffe889a2ed0) at .../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:487\n"
    ~"#7  0x00007f26efe5772e in doActivate<false>(QObject*, int, void**) (sender=0x557f8d510fd0, signal_index=3, argv=0x7ffe889a2ed0) at .../qt5/qtbase/src/corelib/kernel/qobject.cpp:4116\n"
    ~"#8  0x00007f26efe4cdef in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=0x557f8d510fd0, m=0x7f26efa47cc0 <QClipboard::staticMetaObject>, local_signal_index=0, argv=0x7ffe889a2ed0) at .../qt5/qtbase/src/corelib/kernel/qobject.cpp:4176\n"
    ~"#9  0x00007f26eede9fcc in QClipboard::changed(QClipboard::Mode) (this=0x557f8d510fd0, _t1=QClipboard::Clipboard) at .../qt5/qtbase/src/gui/Gui_autogen/include/moc_qclipboard.cpp:182\n"
    ~"#10 0x00007f26eede9bc1 in QClipboard::emitChanged(QClipboard::Mode) (this=0x557f8d510fd0, mode=QClipboard::Clipboard) at .../qt5/qtbase/src/gui/kernel/qclipboard.cpp:558\n"
    ~"#11 0x00007f26eee4ed69 in QPlatformClipboard::emitChanged(QClipboard::Mode) (this=0x557f88019c20, mode=QClipboard::Clipboard) at .../qt5/qtbase/src/gui/kernel/qplatformclipboard.cpp:89\n"
    ~"#12 0x00007f26ed78809e in QtWaylandClient::QWaylandClipboard::setMimeData(QMimeData*, QClipboard::Mode) (this=0x557f88019c20, data=0x557f8fb87930, mode=QClipboard::Clipboard) at .../qt5/qtwayland/src/client/qwaylandclipboard.cpp:89\n"
    ~"#13 0x00007f26eede99de in QClipboard::setMimeData(QMimeData*, QClipboard::Mode) (this=0x557f8d510fd0, src=0x557f8fb87930, mode=QClipboard::Clipboard) at .../qt5/qtbase/src/gui/kernel/qclipboard.cpp:447\n"
    ~"#14 0x00007f26f087a5b5 in QtClipboard::setContents(com::sun::star::uno::Reference<com::sun::star::datatransfer::XTransferable> const&, com::sun::star::uno::Reference<com::sun::star::datatransfer::clipboard::XClipboardOwner> const&) (this=0x557f8d50cbb0, xTrans=uno::Reference to (SwTransferable *) 0x557f90440118, xClipboardOwner=uno::Reference to (SwTransferable *) 0x557f90440120) at .../libreoffice/vcl/qt6/../qt5/QtClipboard.cxx:137\n"
    ~"#15 0x00007f26fb05bacc in TransferableHelper::CopyToClipboard(com::sun::star::uno::Reference<com::sun::star::datatransfer::clipboard::XClipboard> const&) const (this=0x557f904400f0, rClipboard=uno::Reference to (QtClipboard *) 0x557f8d50cc10) at .../libreoffice/vcl/source/treelist/transfer.cxx:942\n"
    ~"#16 0x00007f26fb05bc77 in TransferableHelper::CopyToClipboard(vcl::Window*) const (this=0x557f904400f0, pWindow=0x557f8932d1f0) at .../libreoffice/vcl/source/treelist/transfer.cxx:957\n"
    ~"#17 0x00007f26b5130940 in SwTransferable::RemoveDDELinkFormat(vcl::Window&) (this=0x557f904400f0, rWin=...) at .../libreoffice/sw/source/uibase/dochdl/swdtflvr.cxx:385\n"
    ~"#18 0x00007f26b51440ab in SwTransferDdeLink::DataChanged(rtl::OUString const&, com::sun::star::uno::Any const&) (this=0x557f8fb864e0) at .../libreoffice/sw/source/uibase/dochdl/swdtflvr.cxx:4447\n"
    ~"#19 0x00007f270120fa0e in sfx2::SvLinkSource::NotifyDataChanged() (this=0x557f8fb8bbe0) at .../libreoffice/sfx2/source/appl/linksrc.cxx:291\n"
    ~"#20 0x00007f26b43210ba in SwServerObject::SendDataChanged(SwPaM const&) (this=0x557f8fb8bbe0, rRange=SwPaM = {...}) at .../libreoffice/sw/source/core/doc/swserv.cxx:177\n"
    ~"#21 0x00007f26b43217c2 in SwDataChanged::~SwDataChanged() (this=0x7ffe889a3520, __in_chrg=<optimized out>) at .../libreoffice/sw/source/core/doc/swserv.cxx:308\n"
    ~"#22 0x00007f26b4233c8b in sw::DocumentContentOperationsManager::DeleteRangeImplImpl(SwPaM&, SwDeleteFlags) (this=0x557f8d2b8000, rPam=SwPaM = {...}, flags=SwDeleteFlags::Default) at .../libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:4474\n"
    ~"#23 0x00007f26b4233826 in sw::DocumentContentOperationsManager::DeleteRangeImpl(SwPaM&, SwDeleteFlags) (this=0x557f8d2b8000, rPam=SwPaM = {...}, flags=SwDeleteFlags::Default) at .../libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:4419\n"
    ~"#24 0x00007f26b4233681 in sw::DocumentContentOperationsManager::DeleteAndJoinImpl(SwPaM&, SwDeleteFlags) (this=0x557f8d2b8000, rPam=SwPaM = {...}, flags=SwDeleteFlags::Default) at .../libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:4391\n"
    ~"#25 0x00007f26b421edb7 in (anonymous namespace)::lcl_DoWithBreaks(sw::DocumentContentOperationsManager&, SwPaM&, SwDeleteFlags, bool (sw::DocumentContentOperationsManager::*)(sw::DocumentContentOperationsManager* const, SwPaM&, SwDeleteFlags)) (rDocumentContentOperations=..., rPam=SwPaM = {...}, flags=SwDeleteFlags::Default, pFunc=(bool (sw::DocumentContentOperationsManager::*)(sw::DocumentContentOperationsManager * const, SwPaM &, SwDeleteFlags)) 0x7f26b4233632 <sw::DocumentContentOperationsManager::DeleteAndJoinImpl(SwPaM&, SwDeleteFlags)>) at .../libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:681\n"
    ~"#26 0x00007f26b42279df in sw::DocumentContentOperationsManager::DeleteAndJoin(SwPaM&, SwDeleteFlags) (this=0x557f8d2b8000, rPam=SwPaM = {...}, flags=SwDeleteFlags::Default) at .../libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:2367\n"
    ~"#27 0x00007f26b44a71f6 in SwEditShell::DeleteSel(SwPaM&, bool, bool, bool*) (this=0x557f8d51b300, rPam=SwPaM = {...}, isArtificialSelection=false, goLeft=false, pUndo=0x7ffe889a3be6) at .../libreoffice/sw/source/core/edit/eddel.cxx:122\n"
    ~"#28 0x00007f26b44a7671 in SwEditShell::Delete(bool, bool) (this=0x557f8d51b300, isArtificialSelection=false, goLeft=false) at .../libreoffice/sw/source/core/edit/eddel.cxx:164\n"
    ~"#29 0x00007f26b5604933 in SwWrtShell::DelRight(bool) (this=0x557f8d51b300, isReplaceHeuristic=false) at .../libreoffice/sw/source/uibase/wrtsh/delete.cxx:312\n"
    ~"#30 0x00007f26b512fe14 in (anonymous namespace)::SwTrnsfrActionAndUndo::SwTrnsfrActionAndUndo(SwWrtShell*, bool, SwPasteContext*) (this=0x557f9045b020, pS=0x557f8d51b300, bDelSel=true, pContext=0x7ffe889a4220) at .../libreoffice/sw/source/uibase/dochdl/swdtflvr.cxx:236\n"
    ~"#31 0x00007f26b51377c1 in SwTransferable::PasteData(TransferableDataHelper const&, SwWrtShell&, unsigned char, SotExchangeActionFlags, SotClipboardFormatId, SotExchangeDest, bool, bool, Point const*, signed char, bool, RndStdIds, bool, SwPasteContext*, PasteTableType) (rData=..., rSh=..., nAction=36 '$', nActionFlags=(SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl), nFormat=SotClipboardFormatId::HTML, nDestination=SotExchangeDest::SWDOC_FREE_AREA, bIsPasteFormat=false, bIsDefault=false, pPt=0x0, nDropAction=0 '\\000', bPasteSelection=false, nAnchorType=RndStdIds::FLY_AT_PARA, bIgnoreComments=false, pContext=0x7ffe889a4220, ePasteTable=PasteTableType::PASTE_DEFAULT) at .../libreoffice/sw/source/uibase/dochdl/swdtflvr.cxx:1768\n"
    ~"#32 0x00007f26b5137333 in SwTransferable::Paste(SwWrtShell&, TransferableDataHelper&, RndStdIds, bool, PasteTableType) (rSh=..., rData=..., nAnchorType=RndStdIds::FLY_AT_PARA, bIgnoreComments=false, ePasteTable=PasteTableType::PASTE_DEFAULT) at .../libreoffice/sw/source/uibase/dochdl/swdtflvr.cxx:1687\n"
    ~"#33 0x00007f26b52d29e9 in SwBaseShell::ExecClpbrd(SfxRequest&) (this=0x557f8db64330, rReq=...) at .../libreoffice/sw/source/uibase/shells/basesh.cxx:365\n"
    ~"#34 0x00007f26b52d1681 in SfxStubSwBaseShellExecClpbrd(SfxShell*, SfxRequest&) (pShell=0x557f8db64330, rReq=...) at .../libreoffice/workdir/SdiTarget/sw/sdi/swslots.hxx:2219\n"
    ~"#35 0x00007f27012d14dc in SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, SfxRequest&, bool) (this=0x557f8d4f46b0, rShell=..., rSlot=..., rReq=..., bRecord=true) at .../libreoffice/sfx2/source/control/dispatch.cxx:254\n"
    ~"#36 0x00007f27012d4b34 in SfxDispatcher::Execute_(SfxShell&, SfxSlot const&, SfxRequest&, SfxCallMode) (this=0x557f8d4f46b0, rShell=..., rSlot=..., rReq=..., eCallMode=SfxCallMode::RECORD) at .../libreoffice/sfx2/source/control/dispatch.cxx:753\n"
    ~"#37 0x00007f27012c05d4 in SfxBindings::Execute_Impl(SfxRequest&, SfxSlot const*, SfxShell*) (this=0x557f8d503240, aReq=..., pSlot=0x7f26b6cf5360 <aSwBaseShellSlots_Impl+1440>, pShell=0x557f8db64330) at .../libreoffice/sfx2/source/control/bindings.cxx:1057\n"
    ~"#38 0x00007f270139813d in SfxDispatchController_Impl::dispatch(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchResultListener> const&) (this=0x557f8db682a0, aURL=..., aArgs=empty uno::Sequence, rListener=empty uno::Reference) at .../libreoffice/sfx2/source/control/unoctitm.cxx:688\n"
    ~"#39 0x00007f2701395dbf in SfxOfficeDispatch::dispatch(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (this=0x557f8db68200, aURL=..., aArgs=empty uno::Sequence) at .../libreoffice/sfx2/source/control/unoctitm.cxx:250\n"
    ~"#40 0x00007f26fe03d948 in svt::(anonymous namespace)::AsyncAccelExec::impl_ts_asyncCallback(LinkParamNone*) (this=0x557f8fb8e070) at .../libreoffice/svtools/source/misc/acceleratorexecute.cxx:508\n"
    ~"#41 0x00007f26fe03d869 in svt::(anonymous namespace)::AsyncAccelExec::LinkStubimpl_ts_asyncCallback(void*, LinkParamNone*) (instance=0x557f8fb8e070, data=0x0) at .../libreoffice/svtools/source/misc/acceleratorexecute.cxx:500\n"
    ~"#42 0x00007f26fab0db3b in Link<LinkParamNone*, void>::Call(LinkParamNone*) const (this=0x557f8fb8e110, data=0x0) at .../libreoffice/include/tools/link.hxx:111\n"
    ~"#43 0x00007f26fb469f3d in vcl::EventPoster::DoEvent_Impl(void*) (this=0x557f8fb8e108) at .../libreoffice/vcl/source/helper/evntpost.cxx:52\n"
    ~"#44 0x00007f26fb469f05 in vcl::EventPoster::LinkStubDoEvent_Impl(void*, void*) (instance=0x557f8fb8e108, data=0x0) at .../libreoffice/vcl/source/helper/evntpost.cxx:48\n"
    ~"#45 0x00007f26fadc2373 in Link<void*, void>::Call(void*) const (this=0x7f26e80153b8, data=0x0) at .../libreoffice/include/tools/link.hxx:111\n"
    ~"#46 0x00007f26fadbf458 in ImplHandleUserEvent(ImplSVEvent*) (pSVEvent=0x7f26e80153b0) at .../libreoffice/vcl/source/window/winproc.cxx:2287\n"
    ~"#47 0x00007f26fadc1385 in ImplWindowFrameProc(vcl::Window*, SalEvent, void const*) (_pWindow=0x557f897d0e90, nEvent=SalEvent::UserEvent, pEvent=0x7f26e80153b0) at .../libreoffice/vcl/source/window/winproc.cxx:2851\n"
    ~"#48 0x00007f26f08b6bae in SalFrame::CallCallback(SalEvent, void const*) const (this=0x557f8800cf80, nEvent=SalEvent::UserEvent, pEvent=0x7f26e80153b0) at .../libreoffice/vcl/inc/salframe.hxx:310\n"
    ~"#49 0x00007f26f08d9dbf in QtInstance::ProcessEvent(SalUserEventList::SalUserEvent) (this=0x557f88020780, aEvent=...) at .../libreoffice/vcl/qt6/../qt5/QtInstance.cxx:516\n"
    ~"#50 0x00007f26fb47b97f in operator()() const (__closure=0x7ffe889a50e0) at .../libreoffice/vcl/source/app/salusereventlist.cxx:119\n"
    ~"#51 0x00007f26fb47bc53 in SalUserEventList::DispatchUserEvents(bool) (this=0x557f880207b8, bHandleAllCurrentEvents=false) at .../libreoffice/vcl/source/app/salusereventlist.cxx:120\n"
    ~"#52 0x00007f26f08d98a4 in QtInstance::ImplYield(bool, bool) (this=0x557f88020780, bWait=true, bHandleAllCurrentEvents=false) at .../libreoffice/vcl/qt6/../qt5/QtInstance.cxx:442\n"
    ~"#53 0x00007f26f08d9a4f in QtInstance::DoYield(bool, bool) (this=0x557f88020780, bWait=true, bHandleAllCurrentEvents=false) at .../libreoffice/vcl/qt6/../qt5/QtInstance.cxx:464\n"
    ~"#54 0x00007f26fb5390d0 in ImplYield(bool, bool) (i_bWait=true, i_bAllEvents=false) at .../libreoffice/vcl/source/app/svapp.cxx:390\n"
    ~"#55 0x00007f26fb539e6e in Application::Yield() () at .../libreoffice/vcl/source/app/svapp.cxx:474\n"
    ~"#56 0x00007f26fb538dc3 in Application::Execute() () at .../libreoffice/vcl/source/app/svapp.cxx:368\n"
    ~"#57 0x00007f2704e371b6 in desktop::Desktop::Main() (this=0x7ffe889a5c10) at .../libreoffice/desktop/source/app/app.cxx:1614\n"
    ~"#58 0x00007f26fb558292 in ImplSVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:229\n"
    ~"#59 0x00007f26fb5585a7 in SVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:261\n"
    ~"#60 0x00007f2704ea4307 in soffice_main() () at .../libreoffice/desktop/source/app/sofficemain.cxx:94\n"
    ~"#61 0x0000557f862d19d4 in sal_main () at .../libreoffice/desktop/source/app/main.c:51\n"
    ~"#62 0x0000557f862d19ba in main (argc=3, argv=0x7ffe889a5e38) at .../libreoffice/desktop/source/app/main.c:49\n"
    2906^done
    (gdb)

Change-Id: I1f517d441eeb3e77e969062b884d9a425038b22a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163202
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
tdf-gerrit pushed a commit that referenced this pull request Feb 12, 2024
In `SwTransferable::RemoveDDELinkFormat`, only update the
clipboard content with this `SwTransferable` after removing
the `SotClipboardFormatId::LINK` from the supported formats
if the `SwTransferable` was the clipboard content before
already.

Doing so always would unrelatedly overwrite what was previously
copied from another application to the clipboard for the
tdf#158947 scenario of pasting clipboard content of another
application over a selection when using the Qt-based VCL plugins
on Wayland (s. backtrace below that shows how the clipboard content
was overwritten, frame #17 is the method changed in this
commit).

My assumption why the clipboard content is explicitly overwritten
at all is to make sure that the system clipboard on some platforms
gets notified about the change in supported formats/mime
types after removing one. But that isn't necessary when the
transfer data modified here aren't the current clipboard content
in the first place.

Backtrace for how clipboard content was previously overwritten
for the tdf#158947 scenario with the qt6 VCL plugin on Wayland:

    ~"#0  QtClipboard::handleChanged(QClipboard::Mode) (this=0x557f90457770, aMode=QClipboard::Clipboard) at .../libreoffice/vcl/qt6/../qt5/QtClipboard.cxx:156\n"
    ~"#1  0x00007f26f08844ff in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QClipboard::Mode>, void, void (QtClipboard::*)(QClipboard::Mode)>::call(void (QtClipboard::*)(QClipboard::Mode), QtClipboard*, void**)::{lambda()#1}::operator()() const (__closure=0x7ffe889a2c20) at .../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:153\n"
    ~"#2  0x00007f26f0884ffb in QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QClipboard::Mode>, void, void (QtClipboard::*)(QClipboard::Mode)>::call(void (QtClipboard::*)(QClipboard::Mode), QtClipboard*, void**)::{lambda()#1}>(void**, QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QClipboard::Mode>, void, void (QtClipboard::*)(QClipboard::Mode)>::call(void (QtClipboard::*)(QClipboard::Mode), QtClipboard*, void**)::{lambda()#1}&&) (args=0x7ffe889a2ed0, fn=...) at .../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:72\n"
    ~"#3  0x00007f26f088456f in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QClipboard::Mode>, void, void (QtClipboard::*)(QClipboard::Mode)>::call(void (QtClipboard::*)(QClipboard::Mode), QtClipboard*, void**) (f=(void (QtClipboard::*)(QtClipboard * const, QClipboard::Mode)) 0x7f26f087a76e <QtClipboard::handleChanged(QClipboard::Mode)>, o=0x557f90457770, arg=0x7ffe889a2ed0) at .../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:152\n"
    ~"#4  0x00007f26f08833de in QtPrivate::FunctionPointer<void (QtClipboard::*)(QClipboard::Mode)>::call<QtPrivate::List<QClipboard::Mode>, void>(void (QtClipboard::*)(QClipboard::Mode), QtClipboard*, void**) (f=(void (QtClipboard::*)(QtClipboard * const, QClipboard::Mode)) 0x7f26f087a76e <QtClipboard::handleChanged(QClipboard::Mode)>, o=0x557f90457770, arg=0x7ffe889a2ed0) at .../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:200\n"
    ~"#5  0x00007f26f0881f71 in QtPrivate::QCallableObject<void (QtClipboard::*)(QClipboard::Mode), QtPrivate::List<QClipboard::Mode>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x557f904555f0, r=0x557f90457770, a=0x7ffe889a2ed0, ret=0x0) at .../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:571\n"
    ~"#6  0x00007f26efdb863f in QtPrivate::QSlotObjectBase::call(QObject*, void**) (this=0x557f904555f0, r=0x557f90457770, a=0x7ffe889a2ed0) at .../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:487\n"
    ~"#7  0x00007f26efe5772e in doActivate<false>(QObject*, int, void**) (sender=0x557f8d510fd0, signal_index=3, argv=0x7ffe889a2ed0) at .../qt5/qtbase/src/corelib/kernel/qobject.cpp:4116\n"
    ~"#8  0x00007f26efe4cdef in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=0x557f8d510fd0, m=0x7f26efa47cc0 <QClipboard::staticMetaObject>, local_signal_index=0, argv=0x7ffe889a2ed0) at .../qt5/qtbase/src/corelib/kernel/qobject.cpp:4176\n"
    ~"#9  0x00007f26eede9fcc in QClipboard::changed(QClipboard::Mode) (this=0x557f8d510fd0, _t1=QClipboard::Clipboard) at .../qt5/qtbase/src/gui/Gui_autogen/include/moc_qclipboard.cpp:182\n"
    ~"#10 0x00007f26eede9bc1 in QClipboard::emitChanged(QClipboard::Mode) (this=0x557f8d510fd0, mode=QClipboard::Clipboard) at .../qt5/qtbase/src/gui/kernel/qclipboard.cpp:558\n"
    ~"#11 0x00007f26eee4ed69 in QPlatformClipboard::emitChanged(QClipboard::Mode) (this=0x557f88019c20, mode=QClipboard::Clipboard) at .../qt5/qtbase/src/gui/kernel/qplatformclipboard.cpp:89\n"
    ~"#12 0x00007f26ed78809e in QtWaylandClient::QWaylandClipboard::setMimeData(QMimeData*, QClipboard::Mode) (this=0x557f88019c20, data=0x557f8fb87930, mode=QClipboard::Clipboard) at .../qt5/qtwayland/src/client/qwaylandclipboard.cpp:89\n"
    ~"#13 0x00007f26eede99de in QClipboard::setMimeData(QMimeData*, QClipboard::Mode) (this=0x557f8d510fd0, src=0x557f8fb87930, mode=QClipboard::Clipboard) at .../qt5/qtbase/src/gui/kernel/qclipboard.cpp:447\n"
    ~"#14 0x00007f26f087a5b5 in QtClipboard::setContents(com::sun::star::uno::Reference<com::sun::star::datatransfer::XTransferable> const&, com::sun::star::uno::Reference<com::sun::star::datatransfer::clipboard::XClipboardOwner> const&) (this=0x557f8d50cbb0, xTrans=uno::Reference to (SwTransferable *) 0x557f90440118, xClipboardOwner=uno::Reference to (SwTransferable *) 0x557f90440120) at .../libreoffice/vcl/qt6/../qt5/QtClipboard.cxx:137\n"
    ~"#15 0x00007f26fb05bacc in TransferableHelper::CopyToClipboard(com::sun::star::uno::Reference<com::sun::star::datatransfer::clipboard::XClipboard> const&) const (this=0x557f904400f0, rClipboard=uno::Reference to (QtClipboard *) 0x557f8d50cc10) at .../libreoffice/vcl/source/treelist/transfer.cxx:942\n"
    ~"#16 0x00007f26fb05bc77 in TransferableHelper::CopyToClipboard(vcl::Window*) const (this=0x557f904400f0, pWindow=0x557f8932d1f0) at .../libreoffice/vcl/source/treelist/transfer.cxx:957\n"
    ~"#17 0x00007f26b5130940 in SwTransferable::RemoveDDELinkFormat(vcl::Window&) (this=0x557f904400f0, rWin=...) at .../libreoffice/sw/source/uibase/dochdl/swdtflvr.cxx:385\n"
    ~"#18 0x00007f26b51440ab in SwTransferDdeLink::DataChanged(rtl::OUString const&, com::sun::star::uno::Any const&) (this=0x557f8fb864e0) at .../libreoffice/sw/source/uibase/dochdl/swdtflvr.cxx:4447\n"
    ~"#19 0x00007f270120fa0e in sfx2::SvLinkSource::NotifyDataChanged() (this=0x557f8fb8bbe0) at .../libreoffice/sfx2/source/appl/linksrc.cxx:291\n"
    ~"#20 0x00007f26b43210ba in SwServerObject::SendDataChanged(SwPaM const&) (this=0x557f8fb8bbe0, rRange=SwPaM = {...}) at .../libreoffice/sw/source/core/doc/swserv.cxx:177\n"
    ~"#21 0x00007f26b43217c2 in SwDataChanged::~SwDataChanged() (this=0x7ffe889a3520, __in_chrg=<optimized out>) at .../libreoffice/sw/source/core/doc/swserv.cxx:308\n"
    ~"#22 0x00007f26b4233c8b in sw::DocumentContentOperationsManager::DeleteRangeImplImpl(SwPaM&, SwDeleteFlags) (this=0x557f8d2b8000, rPam=SwPaM = {...}, flags=SwDeleteFlags::Default) at .../libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:4474\n"
    ~"#23 0x00007f26b4233826 in sw::DocumentContentOperationsManager::DeleteRangeImpl(SwPaM&, SwDeleteFlags) (this=0x557f8d2b8000, rPam=SwPaM = {...}, flags=SwDeleteFlags::Default) at .../libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:4419\n"
    ~"#24 0x00007f26b4233681 in sw::DocumentContentOperationsManager::DeleteAndJoinImpl(SwPaM&, SwDeleteFlags) (this=0x557f8d2b8000, rPam=SwPaM = {...}, flags=SwDeleteFlags::Default) at .../libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:4391\n"
    ~"#25 0x00007f26b421edb7 in (anonymous namespace)::lcl_DoWithBreaks(sw::DocumentContentOperationsManager&, SwPaM&, SwDeleteFlags, bool (sw::DocumentContentOperationsManager::*)(sw::DocumentContentOperationsManager* const, SwPaM&, SwDeleteFlags)) (rDocumentContentOperations=..., rPam=SwPaM = {...}, flags=SwDeleteFlags::Default, pFunc=(bool (sw::DocumentContentOperationsManager::*)(sw::DocumentContentOperationsManager * const, SwPaM &, SwDeleteFlags)) 0x7f26b4233632 <sw::DocumentContentOperationsManager::DeleteAndJoinImpl(SwPaM&, SwDeleteFlags)>) at .../libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:681\n"
    ~"#26 0x00007f26b42279df in sw::DocumentContentOperationsManager::DeleteAndJoin(SwPaM&, SwDeleteFlags) (this=0x557f8d2b8000, rPam=SwPaM = {...}, flags=SwDeleteFlags::Default) at .../libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:2367\n"
    ~"#27 0x00007f26b44a71f6 in SwEditShell::DeleteSel(SwPaM&, bool, bool, bool*) (this=0x557f8d51b300, rPam=SwPaM = {...}, isArtificialSelection=false, goLeft=false, pUndo=0x7ffe889a3be6) at .../libreoffice/sw/source/core/edit/eddel.cxx:122\n"
    ~"#28 0x00007f26b44a7671 in SwEditShell::Delete(bool, bool) (this=0x557f8d51b300, isArtificialSelection=false, goLeft=false) at .../libreoffice/sw/source/core/edit/eddel.cxx:164\n"
    ~"#29 0x00007f26b5604933 in SwWrtShell::DelRight(bool) (this=0x557f8d51b300, isReplaceHeuristic=false) at .../libreoffice/sw/source/uibase/wrtsh/delete.cxx:312\n"
    ~"#30 0x00007f26b512fe14 in (anonymous namespace)::SwTrnsfrActionAndUndo::SwTrnsfrActionAndUndo(SwWrtShell*, bool, SwPasteContext*) (this=0x557f9045b020, pS=0x557f8d51b300, bDelSel=true, pContext=0x7ffe889a4220) at .../libreoffice/sw/source/uibase/dochdl/swdtflvr.cxx:236\n"
    ~"#31 0x00007f26b51377c1 in SwTransferable::PasteData(TransferableDataHelper const&, SwWrtShell&, unsigned char, SotExchangeActionFlags, SotClipboardFormatId, SotExchangeDest, bool, bool, Point const*, signed char, bool, RndStdIds, bool, SwPasteContext*, PasteTableType) (rData=..., rSh=..., nAction=36 '$', nActionFlags=(SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl), nFormat=SotClipboardFormatId::HTML, nDestination=SotExchangeDest::SWDOC_FREE_AREA, bIsPasteFormat=false, bIsDefault=false, pPt=0x0, nDropAction=0 '\\000', bPasteSelection=false, nAnchorType=RndStdIds::FLY_AT_PARA, bIgnoreComments=false, pContext=0x7ffe889a4220, ePasteTable=PasteTableType::PASTE_DEFAULT) at .../libreoffice/sw/source/uibase/dochdl/swdtflvr.cxx:1768\n"
    ~"#32 0x00007f26b5137333 in SwTransferable::Paste(SwWrtShell&, TransferableDataHelper&, RndStdIds, bool, PasteTableType) (rSh=..., rData=..., nAnchorType=RndStdIds::FLY_AT_PARA, bIgnoreComments=false, ePasteTable=PasteTableType::PASTE_DEFAULT) at .../libreoffice/sw/source/uibase/dochdl/swdtflvr.cxx:1687\n"
    ~"#33 0x00007f26b52d29e9 in SwBaseShell::ExecClpbrd(SfxRequest&) (this=0x557f8db64330, rReq=...) at .../libreoffice/sw/source/uibase/shells/basesh.cxx:365\n"
    ~"#34 0x00007f26b52d1681 in SfxStubSwBaseShellExecClpbrd(SfxShell*, SfxRequest&) (pShell=0x557f8db64330, rReq=...) at .../libreoffice/workdir/SdiTarget/sw/sdi/swslots.hxx:2219\n"
    ~"#35 0x00007f27012d14dc in SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, SfxRequest&, bool) (this=0x557f8d4f46b0, rShell=..., rSlot=..., rReq=..., bRecord=true) at .../libreoffice/sfx2/source/control/dispatch.cxx:254\n"
    ~"#36 0x00007f27012d4b34 in SfxDispatcher::Execute_(SfxShell&, SfxSlot const&, SfxRequest&, SfxCallMode) (this=0x557f8d4f46b0, rShell=..., rSlot=..., rReq=..., eCallMode=SfxCallMode::RECORD) at .../libreoffice/sfx2/source/control/dispatch.cxx:753\n"
    ~"#37 0x00007f27012c05d4 in SfxBindings::Execute_Impl(SfxRequest&, SfxSlot const*, SfxShell*) (this=0x557f8d503240, aReq=..., pSlot=0x7f26b6cf5360 <aSwBaseShellSlots_Impl+1440>, pShell=0x557f8db64330) at .../libreoffice/sfx2/source/control/bindings.cxx:1057\n"
    ~"#38 0x00007f270139813d in SfxDispatchController_Impl::dispatch(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchResultListener> const&) (this=0x557f8db682a0, aURL=..., aArgs=empty uno::Sequence, rListener=empty uno::Reference) at .../libreoffice/sfx2/source/control/unoctitm.cxx:688\n"
    ~"#39 0x00007f2701395dbf in SfxOfficeDispatch::dispatch(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (this=0x557f8db68200, aURL=..., aArgs=empty uno::Sequence) at .../libreoffice/sfx2/source/control/unoctitm.cxx:250\n"
    ~"#40 0x00007f26fe03d948 in svt::(anonymous namespace)::AsyncAccelExec::impl_ts_asyncCallback(LinkParamNone*) (this=0x557f8fb8e070) at .../libreoffice/svtools/source/misc/acceleratorexecute.cxx:508\n"
    ~"#41 0x00007f26fe03d869 in svt::(anonymous namespace)::AsyncAccelExec::LinkStubimpl_ts_asyncCallback(void*, LinkParamNone*) (instance=0x557f8fb8e070, data=0x0) at .../libreoffice/svtools/source/misc/acceleratorexecute.cxx:500\n"
    ~"#42 0x00007f26fab0db3b in Link<LinkParamNone*, void>::Call(LinkParamNone*) const (this=0x557f8fb8e110, data=0x0) at .../libreoffice/include/tools/link.hxx:111\n"
    ~"#43 0x00007f26fb469f3d in vcl::EventPoster::DoEvent_Impl(void*) (this=0x557f8fb8e108) at .../libreoffice/vcl/source/helper/evntpost.cxx:52\n"
    ~"#44 0x00007f26fb469f05 in vcl::EventPoster::LinkStubDoEvent_Impl(void*, void*) (instance=0x557f8fb8e108, data=0x0) at .../libreoffice/vcl/source/helper/evntpost.cxx:48\n"
    ~"#45 0x00007f26fadc2373 in Link<void*, void>::Call(void*) const (this=0x7f26e80153b8, data=0x0) at .../libreoffice/include/tools/link.hxx:111\n"
    ~"#46 0x00007f26fadbf458 in ImplHandleUserEvent(ImplSVEvent*) (pSVEvent=0x7f26e80153b0) at .../libreoffice/vcl/source/window/winproc.cxx:2287\n"
    ~"#47 0x00007f26fadc1385 in ImplWindowFrameProc(vcl::Window*, SalEvent, void const*) (_pWindow=0x557f897d0e90, nEvent=SalEvent::UserEvent, pEvent=0x7f26e80153b0) at .../libreoffice/vcl/source/window/winproc.cxx:2851\n"
    ~"#48 0x00007f26f08b6bae in SalFrame::CallCallback(SalEvent, void const*) const (this=0x557f8800cf80, nEvent=SalEvent::UserEvent, pEvent=0x7f26e80153b0) at .../libreoffice/vcl/inc/salframe.hxx:310\n"
    ~"#49 0x00007f26f08d9dbf in QtInstance::ProcessEvent(SalUserEventList::SalUserEvent) (this=0x557f88020780, aEvent=...) at .../libreoffice/vcl/qt6/../qt5/QtInstance.cxx:516\n"
    ~"#50 0x00007f26fb47b97f in operator()() const (__closure=0x7ffe889a50e0) at .../libreoffice/vcl/source/app/salusereventlist.cxx:119\n"
    ~"#51 0x00007f26fb47bc53 in SalUserEventList::DispatchUserEvents(bool) (this=0x557f880207b8, bHandleAllCurrentEvents=false) at .../libreoffice/vcl/source/app/salusereventlist.cxx:120\n"
    ~"#52 0x00007f26f08d98a4 in QtInstance::ImplYield(bool, bool) (this=0x557f88020780, bWait=true, bHandleAllCurrentEvents=false) at .../libreoffice/vcl/qt6/../qt5/QtInstance.cxx:442\n"
    ~"#53 0x00007f26f08d9a4f in QtInstance::DoYield(bool, bool) (this=0x557f88020780, bWait=true, bHandleAllCurrentEvents=false) at .../libreoffice/vcl/qt6/../qt5/QtInstance.cxx:464\n"
    ~"#54 0x00007f26fb5390d0 in ImplYield(bool, bool) (i_bWait=true, i_bAllEvents=false) at .../libreoffice/vcl/source/app/svapp.cxx:390\n"
    ~"#55 0x00007f26fb539e6e in Application::Yield() () at .../libreoffice/vcl/source/app/svapp.cxx:474\n"
    ~"#56 0x00007f26fb538dc3 in Application::Execute() () at .../libreoffice/vcl/source/app/svapp.cxx:368\n"
    ~"#57 0x00007f2704e371b6 in desktop::Desktop::Main() (this=0x7ffe889a5c10) at .../libreoffice/desktop/source/app/app.cxx:1614\n"
    ~"#58 0x00007f26fb558292 in ImplSVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:229\n"
    ~"#59 0x00007f26fb5585a7 in SVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:261\n"
    ~"#60 0x00007f2704ea4307 in soffice_main() () at .../libreoffice/desktop/source/app/sofficemain.cxx:94\n"
    ~"#61 0x0000557f862d19d4 in sal_main () at .../libreoffice/desktop/source/app/main.c:51\n"
    ~"#62 0x0000557f862d19ba in main (argc=3, argv=0x7ffe889a5e38) at .../libreoffice/desktop/source/app/main.c:49\n"
    2906^done
    (gdb)

Change-Id: I1f517d441eeb3e77e969062b884d9a425038b22a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163202
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
(cherry picked from commit cb9513c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163179
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
tdf-gerrit pushed a commit that referenced this pull request Feb 16, 2024
Hold the SolarMutex instead of of using a custom mutex,
since `SwAccessibleMap` methods that get called require
the SolarMutex to be held.

Fixes a crash/assert when interacting with Writer comments
using the mouse while the Orca screen reader is running
when using the qt6 VCL plugin.

Backtrace:

    Thread 1 received signal SIGABRT, Aborted.
    __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  0x00007f0a462a81cf in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
    #2  0x00007f0a4625a472 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
    #3  0x00007f0a462444b2 in __GI_abort () at ./stdlib/abort.c:79
    #4  0x00007f0a462443d5 in __assert_fail_base
        (fmt=0x7f0a463b8dc8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x7f0a3d775838 "ImplGetSVData()->mpDefInst->GetYieldMutex()->IsCurrentThread() && \"SolarMutex not owned!\"", file=file@entry=0x7f0a3d7757f0 ".../libreoffice/vcl/source/app/dbggui.cxx", line=line@entry=35, function=function@entry=0x7f0a3d7757cc "void ImplDbgTestSolarMutex()") at ./assert/assert.c:92
    #5  0x00007f0a462533a2 in __assert_fail
        (assertion=0x7f0a3d775838 "ImplGetSVData()->mpDefInst->GetYieldMutex()->IsCurrentThread() && \"SolarMutex not owned!\"", file=0x7f0a3d7757f0 ".../libreoffice/vcl/source/app/dbggui.cxx", line=35, function=0x7f0a3d7757cc "void ImplDbgTestSolarMutex()") at ./assert/assert.c:101
    #6  0x00007f0a3ca733b4 in ImplDbgTestSolarMutex() () at .../libreoffice/vcl/source/app/dbggui.cxx:35
    #7  0x00007f0a452ccfbb in DbgTestSolarMutex() () at .../libreoffice/tools/source/debug/debug.cxx:54
    #8  0x00007f09f8fd3903 in SwAccessibleMap::GetContext(SwFrame const*, bool) (this=0x55fa8fd89930, pFrame=0x55fa8ecddb00, bCreate=false) at .../libreoffice/sw/source/core/access/accmap.cxx:1777
    #9  0x00007f09f906f684 in sw::sidebarwindows::(anonymous namespace)::SidebarWinAccessibleContext::getAccessibleParent() (this=0x55fa8f83e600) at .../libreoffice/sw/source/uibase/docvw/SidebarWinAcc.cxx:65
    #10 0x00007f0a31e6244c in QtAccessibleWidget::parent() const (this=0x7f0a280b6150) at .../libreoffice/vcl/qt6/../qt5/QtAccessibleWidget.cxx:322
    #11 0x00007f0a3095b51a in AtSpiAdaptor::accessibleInterface(QAccessibleInterface*, QString const&, QDBusMessage const&, QDBusConnection const&) (this=0x55fa884876c0, interface=0x7f0a280b6150, function=..., message=..., connection=...)
        at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1592
    #12 0x00007f0a30959934 in AtSpiAdaptor::handleMessage(QDBusMessage const&, QDBusConnection const&) (this=0x55fa884876c0, message=..., connection=...)
        at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1460
    #13 0x00007f0a2ee88ad3 in QDBusConnectionPrivate::activateObject(QDBusConnectionPrivate::ObjectTreeNode&, QDBusMessage const&, int) (this=0x7f0a28010b60, node=..., msg=..., pathStartPos=27)
        at .../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1448
    #14 0x00007f0a2ee897b8 in QDBusActivateObjectEvent::placeMetaCall(QObject*) (this=0x7f0a280b8400) at .../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1604
    #15 0x00007f0a31445095 in QObject::event(QEvent*) (this=0x55fa884876c0, e=0x7f0a280b8400) at .../qt5/qtbase/src/corelib/kernel/qobject.cpp:1447
    #16 0x00007f0a2f5a696c in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=0x55fa872f63e0, receiver=0x55fa884876c0, e=0x7f0a280b8400) at .../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3298
    #17 0x00007f0a2f5a677d in QApplication::notify(QObject*, QEvent*) (this=0x55fa873956b0, receiver=0x55fa884876c0, e=0x7f0a280b8400) at .../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3249
    #18 0x00007f0a313b1162 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x55fa884876c0, event=0x7f0a280b8400) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1138
    #19 0x00007f0a313b1d0b in QCoreApplication::sendEvent(QObject*, QEvent*) (receiver=0x55fa884876c0, event=0x7f0a280b8400) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1581
    #20 0x00007f0a313b33c4 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (receiver=0x0, event_type=0, data=0x55fa87311df0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1936
    #21 0x00007f0a313b255e in QCoreApplication::sendPostedEvents(QObject*, int) (receiver=0x0, event_type=0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1770
    #22 0x00007f0a318384ac in postEventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=0x55fa873b8c20) at .../qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:244
    #23 0x00007f0a38d111f4 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #24 0x00007f0a38d14317 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #25 0x00007f0a38d14930 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #26 0x00007f0a31838d41 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x55fa873987a0, flags=...) at .../qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:394
    #27 0x00007f0a30b5c418 in QPAEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x55fa873987a0, flags=...) at .../qt5/qtbase/src/gui/platform/unix/qeventdispatcher_glib.cpp:87
    #28 0x00007f0a31ed9a40 in QtInstance::ImplYield(bool, bool) (this=0x55fa873d30f0, bWait=true, bHandleAllCurrentEvents=false) at .../libreoffice/vcl/qt6/../qt5/QtInstance.cxx:453
    #29 0x00007f0a31ed9b69 in QtInstance::DoYield(bool, bool) (this=0x55fa873d30f0, bWait=true, bHandleAllCurrentEvents=false) at .../libreoffice/vcl/qt6/../qt5/QtInstance.cxx:464
    #30 0x00007f0a3cb39434 in ImplYield(bool, bool) (i_bWait=true, i_bAllEvents=false) at .../libreoffice/vcl/source/app/svapp.cxx:390
    #31 0x00007f0a3cb3a1d2 in Application::Yield() () at .../libreoffice/vcl/source/app/svapp.cxx:474
    #32 0x00007f0a3cb39127 in Application::Execute() () at .../libreoffice/vcl/source/app/svapp.cxx:368
    #33 0x00007f0a46437216 in desktop::Desktop::Main() (this=0x7ffd0478dce0) at .../libreoffice/desktop/source/app/app.cxx:1614
    #34 0x00007f0a3cb585f6 in ImplSVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:229
    #35 0x00007f0a3cb5890b in SVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:261
    #36 0x00007f0a464a4367 in soffice_main() () at .../libreoffice/desktop/source/app/sofficemain.cxx:94
    #37 0x000055fa860a09d4 in sal_main () at .../libreoffice/desktop/source/app/main.c:51
    #38 0x000055fa860a09ba in main (argc=3, argv=0x7ffd0478df08) at .../libreoffice/desktop/source/app/main.c:49

Change-Id: If6df884fe94b2aac74be1b9fb13356bf765119d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163379
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
tdf-gerrit pushed a commit that referenced this pull request Feb 16, 2024
Hold the SolarMutex instead of of using a custom mutex,
since `SwAccessibleMap` methods that get called require
the SolarMutex to be held.

Fixes a crash/assert when interacting with Writer comments
using the mouse while the Orca screen reader is running
when using the qt6 VCL plugin.

Backtrace:

    Thread 1 received signal SIGABRT, Aborted.
    __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  0x00007f0a462a81cf in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
    #2  0x00007f0a4625a472 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
    #3  0x00007f0a462444b2 in __GI_abort () at ./stdlib/abort.c:79
    #4  0x00007f0a462443d5 in __assert_fail_base
        (fmt=0x7f0a463b8dc8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x7f0a3d775838 "ImplGetSVData()->mpDefInst->GetYieldMutex()->IsCurrentThread() && \"SolarMutex not owned!\"", file=file@entry=0x7f0a3d7757f0 ".../libreoffice/vcl/source/app/dbggui.cxx", line=line@entry=35, function=function@entry=0x7f0a3d7757cc "void ImplDbgTestSolarMutex()") at ./assert/assert.c:92
    #5  0x00007f0a462533a2 in __assert_fail
        (assertion=0x7f0a3d775838 "ImplGetSVData()->mpDefInst->GetYieldMutex()->IsCurrentThread() && \"SolarMutex not owned!\"", file=0x7f0a3d7757f0 ".../libreoffice/vcl/source/app/dbggui.cxx", line=35, function=0x7f0a3d7757cc "void ImplDbgTestSolarMutex()") at ./assert/assert.c:101
    #6  0x00007f0a3ca733b4 in ImplDbgTestSolarMutex() () at .../libreoffice/vcl/source/app/dbggui.cxx:35
    #7  0x00007f0a452ccfbb in DbgTestSolarMutex() () at .../libreoffice/tools/source/debug/debug.cxx:54
    #8  0x00007f09f8fd3903 in SwAccessibleMap::GetContext(SwFrame const*, bool) (this=0x55fa8fd89930, pFrame=0x55fa8ecddb00, bCreate=false) at .../libreoffice/sw/source/core/access/accmap.cxx:1777
    #9  0x00007f09f906f684 in sw::sidebarwindows::(anonymous namespace)::SidebarWinAccessibleContext::getAccessibleParent() (this=0x55fa8f83e600) at .../libreoffice/sw/source/uibase/docvw/SidebarWinAcc.cxx:65
    #10 0x00007f0a31e6244c in QtAccessibleWidget::parent() const (this=0x7f0a280b6150) at .../libreoffice/vcl/qt6/../qt5/QtAccessibleWidget.cxx:322
    #11 0x00007f0a3095b51a in AtSpiAdaptor::accessibleInterface(QAccessibleInterface*, QString const&, QDBusMessage const&, QDBusConnection const&) (this=0x55fa884876c0, interface=0x7f0a280b6150, function=..., message=..., connection=...)
        at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1592
    #12 0x00007f0a30959934 in AtSpiAdaptor::handleMessage(QDBusMessage const&, QDBusConnection const&) (this=0x55fa884876c0, message=..., connection=...)
        at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1460
    #13 0x00007f0a2ee88ad3 in QDBusConnectionPrivate::activateObject(QDBusConnectionPrivate::ObjectTreeNode&, QDBusMessage const&, int) (this=0x7f0a28010b60, node=..., msg=..., pathStartPos=27)
        at .../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1448
    #14 0x00007f0a2ee897b8 in QDBusActivateObjectEvent::placeMetaCall(QObject*) (this=0x7f0a280b8400) at .../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1604
    #15 0x00007f0a31445095 in QObject::event(QEvent*) (this=0x55fa884876c0, e=0x7f0a280b8400) at .../qt5/qtbase/src/corelib/kernel/qobject.cpp:1447
    #16 0x00007f0a2f5a696c in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=0x55fa872f63e0, receiver=0x55fa884876c0, e=0x7f0a280b8400) at .../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3298
    #17 0x00007f0a2f5a677d in QApplication::notify(QObject*, QEvent*) (this=0x55fa873956b0, receiver=0x55fa884876c0, e=0x7f0a280b8400) at .../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3249
    #18 0x00007f0a313b1162 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x55fa884876c0, event=0x7f0a280b8400) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1138
    #19 0x00007f0a313b1d0b in QCoreApplication::sendEvent(QObject*, QEvent*) (receiver=0x55fa884876c0, event=0x7f0a280b8400) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1581
    #20 0x00007f0a313b33c4 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (receiver=0x0, event_type=0, data=0x55fa87311df0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1936
    #21 0x00007f0a313b255e in QCoreApplication::sendPostedEvents(QObject*, int) (receiver=0x0, event_type=0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1770
    #22 0x00007f0a318384ac in postEventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=0x55fa873b8c20) at .../qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:244
    #23 0x00007f0a38d111f4 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #24 0x00007f0a38d14317 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #25 0x00007f0a38d14930 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #26 0x00007f0a31838d41 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x55fa873987a0, flags=...) at .../qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:394
    #27 0x00007f0a30b5c418 in QPAEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x55fa873987a0, flags=...) at .../qt5/qtbase/src/gui/platform/unix/qeventdispatcher_glib.cpp:87
    #28 0x00007f0a31ed9a40 in QtInstance::ImplYield(bool, bool) (this=0x55fa873d30f0, bWait=true, bHandleAllCurrentEvents=false) at .../libreoffice/vcl/qt6/../qt5/QtInstance.cxx:453
    #29 0x00007f0a31ed9b69 in QtInstance::DoYield(bool, bool) (this=0x55fa873d30f0, bWait=true, bHandleAllCurrentEvents=false) at .../libreoffice/vcl/qt6/../qt5/QtInstance.cxx:464
    #30 0x00007f0a3cb39434 in ImplYield(bool, bool) (i_bWait=true, i_bAllEvents=false) at .../libreoffice/vcl/source/app/svapp.cxx:390
    #31 0x00007f0a3cb3a1d2 in Application::Yield() () at .../libreoffice/vcl/source/app/svapp.cxx:474
    #32 0x00007f0a3cb39127 in Application::Execute() () at .../libreoffice/vcl/source/app/svapp.cxx:368
    #33 0x00007f0a46437216 in desktop::Desktop::Main() (this=0x7ffd0478dce0) at .../libreoffice/desktop/source/app/app.cxx:1614
    #34 0x00007f0a3cb585f6 in ImplSVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:229
    #35 0x00007f0a3cb5890b in SVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:261
    #36 0x00007f0a464a4367 in soffice_main() () at .../libreoffice/desktop/source/app/sofficemain.cxx:94
    #37 0x000055fa860a09d4 in sal_main () at .../libreoffice/desktop/source/app/main.c:51
    #38 0x000055fa860a09ba in main (argc=3, argv=0x7ffd0478df08) at .../libreoffice/desktop/source/app/main.c:49

Change-Id: If6df884fe94b2aac74be1b9fb13356bf765119d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163379
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
(cherry picked from commit 512b09e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163404
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
tdf-gerrit pushed a commit that referenced this pull request Feb 16, 2024
In `SwTransferable::RemoveDDELinkFormat`, only update the
clipboard content with this `SwTransferable` after removing
the `SotClipboardFormatId::LINK` from the supported formats
if the `SwTransferable` was the clipboard content before
already.

Doing so always would unrelatedly overwrite what was previously
copied from another application to the clipboard for the
tdf#158947 scenario of pasting clipboard content of another
application over a selection when using the Qt-based VCL plugins
on Wayland (s. backtrace below that shows how the clipboard content
was overwritten, frame #17 is the method changed in this
commit).

My assumption why the clipboard content is explicitly overwritten
at all is to make sure that the system clipboard on some platforms
gets notified about the change in supported formats/mime
types after removing one. But that isn't necessary when the
transfer data modified here aren't the current clipboard content
in the first place.

Backtrace for how clipboard content was previously overwritten
for the tdf#158947 scenario with the qt6 VCL plugin on Wayland:

    ~"#0  QtClipboard::handleChanged(QClipboard::Mode) (this=0x557f90457770, aMode=QClipboard::Clipboard) at .../libreoffice/vcl/qt6/../qt5/QtClipboard.cxx:156\n"
    ~"#1  0x00007f26f08844ff in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QClipboard::Mode>, void, void (QtClipboard::*)(QClipboard::Mode)>::call(void (QtClipboard::*)(QClipboard::Mode), QtClipboard*, void**)::{lambda()#1}::operator()() const (__closure=0x7ffe889a2c20) at .../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:153\n"
    ~"#2  0x00007f26f0884ffb in QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QClipboard::Mode>, void, void (QtClipboard::*)(QClipboard::Mode)>::call(void (QtClipboard::*)(QClipboard::Mode), QtClipboard*, void**)::{lambda()#1}>(void**, QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QClipboard::Mode>, void, void (QtClipboard::*)(QClipboard::Mode)>::call(void (QtClipboard::*)(QClipboard::Mode), QtClipboard*, void**)::{lambda()#1}&&) (args=0x7ffe889a2ed0, fn=...) at .../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:72\n"
    ~"#3  0x00007f26f088456f in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QClipboard::Mode>, void, void (QtClipboard::*)(QClipboard::Mode)>::call(void (QtClipboard::*)(QClipboard::Mode), QtClipboard*, void**) (f=(void (QtClipboard::*)(QtClipboard * const, QClipboard::Mode)) 0x7f26f087a76e <QtClipboard::handleChanged(QClipboard::Mode)>, o=0x557f90457770, arg=0x7ffe889a2ed0) at .../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:152\n"
    ~"#4  0x00007f26f08833de in QtPrivate::FunctionPointer<void (QtClipboard::*)(QClipboard::Mode)>::call<QtPrivate::List<QClipboard::Mode>, void>(void (QtClipboard::*)(QClipboard::Mode), QtClipboard*, void**) (f=(void (QtClipboard::*)(QtClipboard * const, QClipboard::Mode)) 0x7f26f087a76e <QtClipboard::handleChanged(QClipboard::Mode)>, o=0x557f90457770, arg=0x7ffe889a2ed0) at .../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:200\n"
    ~"#5  0x00007f26f0881f71 in QtPrivate::QCallableObject<void (QtClipboard::*)(QClipboard::Mode), QtPrivate::List<QClipboard::Mode>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x557f904555f0, r=0x557f90457770, a=0x7ffe889a2ed0, ret=0x0) at .../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:571\n"
    ~"#6  0x00007f26efdb863f in QtPrivate::QSlotObjectBase::call(QObject*, void**) (this=0x557f904555f0, r=0x557f90457770, a=0x7ffe889a2ed0) at .../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:487\n"
    ~"#7  0x00007f26efe5772e in doActivate<false>(QObject*, int, void**) (sender=0x557f8d510fd0, signal_index=3, argv=0x7ffe889a2ed0) at .../qt5/qtbase/src/corelib/kernel/qobject.cpp:4116\n"
    ~"#8  0x00007f26efe4cdef in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=0x557f8d510fd0, m=0x7f26efa47cc0 <QClipboard::staticMetaObject>, local_signal_index=0, argv=0x7ffe889a2ed0) at .../qt5/qtbase/src/corelib/kernel/qobject.cpp:4176\n"
    ~"#9  0x00007f26eede9fcc in QClipboard::changed(QClipboard::Mode) (this=0x557f8d510fd0, _t1=QClipboard::Clipboard) at .../qt5/qtbase/src/gui/Gui_autogen/include/moc_qclipboard.cpp:182\n"
    ~"#10 0x00007f26eede9bc1 in QClipboard::emitChanged(QClipboard::Mode) (this=0x557f8d510fd0, mode=QClipboard::Clipboard) at .../qt5/qtbase/src/gui/kernel/qclipboard.cpp:558\n"
    ~"#11 0x00007f26eee4ed69 in QPlatformClipboard::emitChanged(QClipboard::Mode) (this=0x557f88019c20, mode=QClipboard::Clipboard) at .../qt5/qtbase/src/gui/kernel/qplatformclipboard.cpp:89\n"
    ~"#12 0x00007f26ed78809e in QtWaylandClient::QWaylandClipboard::setMimeData(QMimeData*, QClipboard::Mode) (this=0x557f88019c20, data=0x557f8fb87930, mode=QClipboard::Clipboard) at .../qt5/qtwayland/src/client/qwaylandclipboard.cpp:89\n"
    ~"#13 0x00007f26eede99de in QClipboard::setMimeData(QMimeData*, QClipboard::Mode) (this=0x557f8d510fd0, src=0x557f8fb87930, mode=QClipboard::Clipboard) at .../qt5/qtbase/src/gui/kernel/qclipboard.cpp:447\n"
    ~"#14 0x00007f26f087a5b5 in QtClipboard::setContents(com::sun::star::uno::Reference<com::sun::star::datatransfer::XTransferable> const&, com::sun::star::uno::Reference<com::sun::star::datatransfer::clipboard::XClipboardOwner> const&) (this=0x557f8d50cbb0, xTrans=uno::Reference to (SwTransferable *) 0x557f90440118, xClipboardOwner=uno::Reference to (SwTransferable *) 0x557f90440120) at .../libreoffice/vcl/qt6/../qt5/QtClipboard.cxx:137\n"
    ~"#15 0x00007f26fb05bacc in TransferableHelper::CopyToClipboard(com::sun::star::uno::Reference<com::sun::star::datatransfer::clipboard::XClipboard> const&) const (this=0x557f904400f0, rClipboard=uno::Reference to (QtClipboard *) 0x557f8d50cc10) at .../libreoffice/vcl/source/treelist/transfer.cxx:942\n"
    ~"#16 0x00007f26fb05bc77 in TransferableHelper::CopyToClipboard(vcl::Window*) const (this=0x557f904400f0, pWindow=0x557f8932d1f0) at .../libreoffice/vcl/source/treelist/transfer.cxx:957\n"
    ~"#17 0x00007f26b5130940 in SwTransferable::RemoveDDELinkFormat(vcl::Window&) (this=0x557f904400f0, rWin=...) at .../libreoffice/sw/source/uibase/dochdl/swdtflvr.cxx:385\n"
    ~"#18 0x00007f26b51440ab in SwTransferDdeLink::DataChanged(rtl::OUString const&, com::sun::star::uno::Any const&) (this=0x557f8fb864e0) at .../libreoffice/sw/source/uibase/dochdl/swdtflvr.cxx:4447\n"
    ~"#19 0x00007f270120fa0e in sfx2::SvLinkSource::NotifyDataChanged() (this=0x557f8fb8bbe0) at .../libreoffice/sfx2/source/appl/linksrc.cxx:291\n"
    ~"#20 0x00007f26b43210ba in SwServerObject::SendDataChanged(SwPaM const&) (this=0x557f8fb8bbe0, rRange=SwPaM = {...}) at .../libreoffice/sw/source/core/doc/swserv.cxx:177\n"
    ~"#21 0x00007f26b43217c2 in SwDataChanged::~SwDataChanged() (this=0x7ffe889a3520, __in_chrg=<optimized out>) at .../libreoffice/sw/source/core/doc/swserv.cxx:308\n"
    ~"#22 0x00007f26b4233c8b in sw::DocumentContentOperationsManager::DeleteRangeImplImpl(SwPaM&, SwDeleteFlags) (this=0x557f8d2b8000, rPam=SwPaM = {...}, flags=SwDeleteFlags::Default) at .../libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:4474\n"
    ~"#23 0x00007f26b4233826 in sw::DocumentContentOperationsManager::DeleteRangeImpl(SwPaM&, SwDeleteFlags) (this=0x557f8d2b8000, rPam=SwPaM = {...}, flags=SwDeleteFlags::Default) at .../libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:4419\n"
    ~"#24 0x00007f26b4233681 in sw::DocumentContentOperationsManager::DeleteAndJoinImpl(SwPaM&, SwDeleteFlags) (this=0x557f8d2b8000, rPam=SwPaM = {...}, flags=SwDeleteFlags::Default) at .../libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:4391\n"
    ~"#25 0x00007f26b421edb7 in (anonymous namespace)::lcl_DoWithBreaks(sw::DocumentContentOperationsManager&, SwPaM&, SwDeleteFlags, bool (sw::DocumentContentOperationsManager::*)(sw::DocumentContentOperationsManager* const, SwPaM&, SwDeleteFlags)) (rDocumentContentOperations=..., rPam=SwPaM = {...}, flags=SwDeleteFlags::Default, pFunc=(bool (sw::DocumentContentOperationsManager::*)(sw::DocumentContentOperationsManager * const, SwPaM &, SwDeleteFlags)) 0x7f26b4233632 <sw::DocumentContentOperationsManager::DeleteAndJoinImpl(SwPaM&, SwDeleteFlags)>) at .../libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:681\n"
    ~"#26 0x00007f26b42279df in sw::DocumentContentOperationsManager::DeleteAndJoin(SwPaM&, SwDeleteFlags) (this=0x557f8d2b8000, rPam=SwPaM = {...}, flags=SwDeleteFlags::Default) at .../libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:2367\n"
    ~"#27 0x00007f26b44a71f6 in SwEditShell::DeleteSel(SwPaM&, bool, bool, bool*) (this=0x557f8d51b300, rPam=SwPaM = {...}, isArtificialSelection=false, goLeft=false, pUndo=0x7ffe889a3be6) at .../libreoffice/sw/source/core/edit/eddel.cxx:122\n"
    ~"#28 0x00007f26b44a7671 in SwEditShell::Delete(bool, bool) (this=0x557f8d51b300, isArtificialSelection=false, goLeft=false) at .../libreoffice/sw/source/core/edit/eddel.cxx:164\n"
    ~"#29 0x00007f26b5604933 in SwWrtShell::DelRight(bool) (this=0x557f8d51b300, isReplaceHeuristic=false) at .../libreoffice/sw/source/uibase/wrtsh/delete.cxx:312\n"
    ~"#30 0x00007f26b512fe14 in (anonymous namespace)::SwTrnsfrActionAndUndo::SwTrnsfrActionAndUndo(SwWrtShell*, bool, SwPasteContext*) (this=0x557f9045b020, pS=0x557f8d51b300, bDelSel=true, pContext=0x7ffe889a4220) at .../libreoffice/sw/source/uibase/dochdl/swdtflvr.cxx:236\n"
    ~"#31 0x00007f26b51377c1 in SwTransferable::PasteData(TransferableDataHelper const&, SwWrtShell&, unsigned char, SotExchangeActionFlags, SotClipboardFormatId, SotExchangeDest, bool, bool, Point const*, signed char, bool, RndStdIds, bool, SwPasteContext*, PasteTableType) (rData=..., rSh=..., nAction=36 '$', nActionFlags=(SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl), nFormat=SotClipboardFormatId::HTML, nDestination=SotExchangeDest::SWDOC_FREE_AREA, bIsPasteFormat=false, bIsDefault=false, pPt=0x0, nDropAction=0 '\\000', bPasteSelection=false, nAnchorType=RndStdIds::FLY_AT_PARA, bIgnoreComments=false, pContext=0x7ffe889a4220, ePasteTable=PasteTableType::PASTE_DEFAULT) at .../libreoffice/sw/source/uibase/dochdl/swdtflvr.cxx:1768\n"
    ~"#32 0x00007f26b5137333 in SwTransferable::Paste(SwWrtShell&, TransferableDataHelper&, RndStdIds, bool, PasteTableType) (rSh=..., rData=..., nAnchorType=RndStdIds::FLY_AT_PARA, bIgnoreComments=false, ePasteTable=PasteTableType::PASTE_DEFAULT) at .../libreoffice/sw/source/uibase/dochdl/swdtflvr.cxx:1687\n"
    ~"#33 0x00007f26b52d29e9 in SwBaseShell::ExecClpbrd(SfxRequest&) (this=0x557f8db64330, rReq=...) at .../libreoffice/sw/source/uibase/shells/basesh.cxx:365\n"
    ~"#34 0x00007f26b52d1681 in SfxStubSwBaseShellExecClpbrd(SfxShell*, SfxRequest&) (pShell=0x557f8db64330, rReq=...) at .../libreoffice/workdir/SdiTarget/sw/sdi/swslots.hxx:2219\n"
    ~"#35 0x00007f27012d14dc in SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, SfxRequest&, bool) (this=0x557f8d4f46b0, rShell=..., rSlot=..., rReq=..., bRecord=true) at .../libreoffice/sfx2/source/control/dispatch.cxx:254\n"
    ~"#36 0x00007f27012d4b34 in SfxDispatcher::Execute_(SfxShell&, SfxSlot const&, SfxRequest&, SfxCallMode) (this=0x557f8d4f46b0, rShell=..., rSlot=..., rReq=..., eCallMode=SfxCallMode::RECORD) at .../libreoffice/sfx2/source/control/dispatch.cxx:753\n"
    ~"#37 0x00007f27012c05d4 in SfxBindings::Execute_Impl(SfxRequest&, SfxSlot const*, SfxShell*) (this=0x557f8d503240, aReq=..., pSlot=0x7f26b6cf5360 <aSwBaseShellSlots_Impl+1440>, pShell=0x557f8db64330) at .../libreoffice/sfx2/source/control/bindings.cxx:1057\n"
    ~"#38 0x00007f270139813d in SfxDispatchController_Impl::dispatch(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchResultListener> const&) (this=0x557f8db682a0, aURL=..., aArgs=empty uno::Sequence, rListener=empty uno::Reference) at .../libreoffice/sfx2/source/control/unoctitm.cxx:688\n"
    ~"#39 0x00007f2701395dbf in SfxOfficeDispatch::dispatch(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (this=0x557f8db68200, aURL=..., aArgs=empty uno::Sequence) at .../libreoffice/sfx2/source/control/unoctitm.cxx:250\n"
    ~"#40 0x00007f26fe03d948 in svt::(anonymous namespace)::AsyncAccelExec::impl_ts_asyncCallback(LinkParamNone*) (this=0x557f8fb8e070) at .../libreoffice/svtools/source/misc/acceleratorexecute.cxx:508\n"
    ~"#41 0x00007f26fe03d869 in svt::(anonymous namespace)::AsyncAccelExec::LinkStubimpl_ts_asyncCallback(void*, LinkParamNone*) (instance=0x557f8fb8e070, data=0x0) at .../libreoffice/svtools/source/misc/acceleratorexecute.cxx:500\n"
    ~"#42 0x00007f26fab0db3b in Link<LinkParamNone*, void>::Call(LinkParamNone*) const (this=0x557f8fb8e110, data=0x0) at .../libreoffice/include/tools/link.hxx:111\n"
    ~"#43 0x00007f26fb469f3d in vcl::EventPoster::DoEvent_Impl(void*) (this=0x557f8fb8e108) at .../libreoffice/vcl/source/helper/evntpost.cxx:52\n"
    ~"#44 0x00007f26fb469f05 in vcl::EventPoster::LinkStubDoEvent_Impl(void*, void*) (instance=0x557f8fb8e108, data=0x0) at .../libreoffice/vcl/source/helper/evntpost.cxx:48\n"
    ~"#45 0x00007f26fadc2373 in Link<void*, void>::Call(void*) const (this=0x7f26e80153b8, data=0x0) at .../libreoffice/include/tools/link.hxx:111\n"
    ~"#46 0x00007f26fadbf458 in ImplHandleUserEvent(ImplSVEvent*) (pSVEvent=0x7f26e80153b0) at .../libreoffice/vcl/source/window/winproc.cxx:2287\n"
    ~"#47 0x00007f26fadc1385 in ImplWindowFrameProc(vcl::Window*, SalEvent, void const*) (_pWindow=0x557f897d0e90, nEvent=SalEvent::UserEvent, pEvent=0x7f26e80153b0) at .../libreoffice/vcl/source/window/winproc.cxx:2851\n"
    ~"#48 0x00007f26f08b6bae in SalFrame::CallCallback(SalEvent, void const*) const (this=0x557f8800cf80, nEvent=SalEvent::UserEvent, pEvent=0x7f26e80153b0) at .../libreoffice/vcl/inc/salframe.hxx:310\n"
    ~"#49 0x00007f26f08d9dbf in QtInstance::ProcessEvent(SalUserEventList::SalUserEvent) (this=0x557f88020780, aEvent=...) at .../libreoffice/vcl/qt6/../qt5/QtInstance.cxx:516\n"
    ~"#50 0x00007f26fb47b97f in operator()() const (__closure=0x7ffe889a50e0) at .../libreoffice/vcl/source/app/salusereventlist.cxx:119\n"
    ~"#51 0x00007f26fb47bc53 in SalUserEventList::DispatchUserEvents(bool) (this=0x557f880207b8, bHandleAllCurrentEvents=false) at .../libreoffice/vcl/source/app/salusereventlist.cxx:120\n"
    ~"#52 0x00007f26f08d98a4 in QtInstance::ImplYield(bool, bool) (this=0x557f88020780, bWait=true, bHandleAllCurrentEvents=false) at .../libreoffice/vcl/qt6/../qt5/QtInstance.cxx:442\n"
    ~"#53 0x00007f26f08d9a4f in QtInstance::DoYield(bool, bool) (this=0x557f88020780, bWait=true, bHandleAllCurrentEvents=false) at .../libreoffice/vcl/qt6/../qt5/QtInstance.cxx:464\n"
    ~"#54 0x00007f26fb5390d0 in ImplYield(bool, bool) (i_bWait=true, i_bAllEvents=false) at .../libreoffice/vcl/source/app/svapp.cxx:390\n"
    ~"#55 0x00007f26fb539e6e in Application::Yield() () at .../libreoffice/vcl/source/app/svapp.cxx:474\n"
    ~"#56 0x00007f26fb538dc3 in Application::Execute() () at .../libreoffice/vcl/source/app/svapp.cxx:368\n"
    ~"#57 0x00007f2704e371b6 in desktop::Desktop::Main() (this=0x7ffe889a5c10) at .../libreoffice/desktop/source/app/app.cxx:1614\n"
    ~"#58 0x00007f26fb558292 in ImplSVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:229\n"
    ~"#59 0x00007f26fb5585a7 in SVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:261\n"
    ~"#60 0x00007f2704ea4307 in soffice_main() () at .../libreoffice/desktop/source/app/sofficemain.cxx:94\n"
    ~"#61 0x0000557f862d19d4 in sal_main () at .../libreoffice/desktop/source/app/main.c:51\n"
    ~"#62 0x0000557f862d19ba in main (argc=3, argv=0x7ffe889a5e38) at .../libreoffice/desktop/source/app/main.c:49\n"
    2906^done
    (gdb)

Change-Id: I1f517d441eeb3e77e969062b884d9a425038b22a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163202
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
(cherry picked from commit cb9513c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163179
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
tdf-gerrit pushed a commit that referenced this pull request Feb 16, 2024
Hold the SolarMutex instead of of using a custom mutex,
since `SwAccessibleMap` methods that get called require
the SolarMutex to be held.

Fixes a crash/assert when interacting with Writer comments
using the mouse while the Orca screen reader is running
when using the qt6 VCL plugin.

Backtrace:

    Thread 1 received signal SIGABRT, Aborted.
    __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  0x00007f0a462a81cf in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
    #2  0x00007f0a4625a472 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
    #3  0x00007f0a462444b2 in __GI_abort () at ./stdlib/abort.c:79
    #4  0x00007f0a462443d5 in __assert_fail_base
        (fmt=0x7f0a463b8dc8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x7f0a3d775838 "ImplGetSVData()->mpDefInst->GetYieldMutex()->IsCurrentThread() && \"SolarMutex not owned!\"", file=file@entry=0x7f0a3d7757f0 ".../libreoffice/vcl/source/app/dbggui.cxx", line=line@entry=35, function=function@entry=0x7f0a3d7757cc "void ImplDbgTestSolarMutex()") at ./assert/assert.c:92
    #5  0x00007f0a462533a2 in __assert_fail
        (assertion=0x7f0a3d775838 "ImplGetSVData()->mpDefInst->GetYieldMutex()->IsCurrentThread() && \"SolarMutex not owned!\"", file=0x7f0a3d7757f0 ".../libreoffice/vcl/source/app/dbggui.cxx", line=35, function=0x7f0a3d7757cc "void ImplDbgTestSolarMutex()") at ./assert/assert.c:101
    #6  0x00007f0a3ca733b4 in ImplDbgTestSolarMutex() () at .../libreoffice/vcl/source/app/dbggui.cxx:35
    #7  0x00007f0a452ccfbb in DbgTestSolarMutex() () at .../libreoffice/tools/source/debug/debug.cxx:54
    #8  0x00007f09f8fd3903 in SwAccessibleMap::GetContext(SwFrame const*, bool) (this=0x55fa8fd89930, pFrame=0x55fa8ecddb00, bCreate=false) at .../libreoffice/sw/source/core/access/accmap.cxx:1777
    #9  0x00007f09f906f684 in sw::sidebarwindows::(anonymous namespace)::SidebarWinAccessibleContext::getAccessibleParent() (this=0x55fa8f83e600) at .../libreoffice/sw/source/uibase/docvw/SidebarWinAcc.cxx:65
    #10 0x00007f0a31e6244c in QtAccessibleWidget::parent() const (this=0x7f0a280b6150) at .../libreoffice/vcl/qt6/../qt5/QtAccessibleWidget.cxx:322
    #11 0x00007f0a3095b51a in AtSpiAdaptor::accessibleInterface(QAccessibleInterface*, QString const&, QDBusMessage const&, QDBusConnection const&) (this=0x55fa884876c0, interface=0x7f0a280b6150, function=..., message=..., connection=...)
        at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1592
    #12 0x00007f0a30959934 in AtSpiAdaptor::handleMessage(QDBusMessage const&, QDBusConnection const&) (this=0x55fa884876c0, message=..., connection=...)
        at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1460
    #13 0x00007f0a2ee88ad3 in QDBusConnectionPrivate::activateObject(QDBusConnectionPrivate::ObjectTreeNode&, QDBusMessage const&, int) (this=0x7f0a28010b60, node=..., msg=..., pathStartPos=27)
        at .../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1448
    #14 0x00007f0a2ee897b8 in QDBusActivateObjectEvent::placeMetaCall(QObject*) (this=0x7f0a280b8400) at .../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1604
    #15 0x00007f0a31445095 in QObject::event(QEvent*) (this=0x55fa884876c0, e=0x7f0a280b8400) at .../qt5/qtbase/src/corelib/kernel/qobject.cpp:1447
    #16 0x00007f0a2f5a696c in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=0x55fa872f63e0, receiver=0x55fa884876c0, e=0x7f0a280b8400) at .../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3298
    #17 0x00007f0a2f5a677d in QApplication::notify(QObject*, QEvent*) (this=0x55fa873956b0, receiver=0x55fa884876c0, e=0x7f0a280b8400) at .../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3249
    #18 0x00007f0a313b1162 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x55fa884876c0, event=0x7f0a280b8400) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1138
    #19 0x00007f0a313b1d0b in QCoreApplication::sendEvent(QObject*, QEvent*) (receiver=0x55fa884876c0, event=0x7f0a280b8400) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1581
    #20 0x00007f0a313b33c4 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (receiver=0x0, event_type=0, data=0x55fa87311df0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1936
    #21 0x00007f0a313b255e in QCoreApplication::sendPostedEvents(QObject*, int) (receiver=0x0, event_type=0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1770
    #22 0x00007f0a318384ac in postEventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=0x55fa873b8c20) at .../qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:244
    #23 0x00007f0a38d111f4 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #24 0x00007f0a38d14317 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #25 0x00007f0a38d14930 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #26 0x00007f0a31838d41 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x55fa873987a0, flags=...) at .../qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:394
    #27 0x00007f0a30b5c418 in QPAEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x55fa873987a0, flags=...) at .../qt5/qtbase/src/gui/platform/unix/qeventdispatcher_glib.cpp:87
    #28 0x00007f0a31ed9a40 in QtInstance::ImplYield(bool, bool) (this=0x55fa873d30f0, bWait=true, bHandleAllCurrentEvents=false) at .../libreoffice/vcl/qt6/../qt5/QtInstance.cxx:453
    #29 0x00007f0a31ed9b69 in QtInstance::DoYield(bool, bool) (this=0x55fa873d30f0, bWait=true, bHandleAllCurrentEvents=false) at .../libreoffice/vcl/qt6/../qt5/QtInstance.cxx:464
    #30 0x00007f0a3cb39434 in ImplYield(bool, bool) (i_bWait=true, i_bAllEvents=false) at .../libreoffice/vcl/source/app/svapp.cxx:390
    #31 0x00007f0a3cb3a1d2 in Application::Yield() () at .../libreoffice/vcl/source/app/svapp.cxx:474
    #32 0x00007f0a3cb39127 in Application::Execute() () at .../libreoffice/vcl/source/app/svapp.cxx:368
    #33 0x00007f0a46437216 in desktop::Desktop::Main() (this=0x7ffd0478dce0) at .../libreoffice/desktop/source/app/app.cxx:1614
    #34 0x00007f0a3cb585f6 in ImplSVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:229
    #35 0x00007f0a3cb5890b in SVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:261
    #36 0x00007f0a464a4367 in soffice_main() () at .../libreoffice/desktop/source/app/sofficemain.cxx:94
    #37 0x000055fa860a09d4 in sal_main () at .../libreoffice/desktop/source/app/main.c:51
    #38 0x000055fa860a09ba in main (argc=3, argv=0x7ffd0478df08) at .../libreoffice/desktop/source/app/main.c:49

Change-Id: If6df884fe94b2aac74be1b9fb13356bf765119d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163379
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
(cherry picked from commit 512b09e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163404
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
tdf-gerrit pushed a commit that referenced this pull request Feb 22, 2024
In `SwTransferable::RemoveDDELinkFormat`, only update the
clipboard content with this `SwTransferable` after removing
the `SotClipboardFormatId::LINK` from the supported formats
if the `SwTransferable` was the clipboard content before
already.

Doing so always would unrelatedly overwrite what was previously
copied from another application to the clipboard for the
tdf#158947 scenario of pasting clipboard content of another
application over a selection when using the Qt-based VCL plugins
on Wayland (s. backtrace below that shows how the clipboard content
was overwritten, frame #17 is the method changed in this
commit).

My assumption why the clipboard content is explicitly overwritten
at all is to make sure that the system clipboard on some platforms
gets notified about the change in supported formats/mime
types after removing one. But that isn't necessary when the
transfer data modified here aren't the current clipboard content
in the first place.

Backtrace for how clipboard content was previously overwritten
for the tdf#158947 scenario with the qt6 VCL plugin on Wayland:

    ~"#0  QtClipboard::handleChanged(QClipboard::Mode) (this=0x557f90457770, aMode=QClipboard::Clipboard) at .../libreoffice/vcl/qt6/../qt5/QtClipboard.cxx:156\n"
    ~"#1  0x00007f26f08844ff in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QClipboard::Mode>, void, void (QtClipboard::*)(QClipboard::Mode)>::call(void (QtClipboard::*)(QClipboard::Mode), QtClipboard*, void**)::{lambda()#1}::operator()() const (__closure=0x7ffe889a2c20) at .../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:153\n"
    ~"#2  0x00007f26f0884ffb in QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QClipboard::Mode>, void, void (QtClipboard::*)(QClipboard::Mode)>::call(void (QtClipboard::*)(QClipboard::Mode), QtClipboard*, void**)::{lambda()#1}>(void**, QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QClipboard::Mode>, void, void (QtClipboard::*)(QClipboard::Mode)>::call(void (QtClipboard::*)(QClipboard::Mode), QtClipboard*, void**)::{lambda()#1}&&) (args=0x7ffe889a2ed0, fn=...) at .../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:72\n"
    ~"#3  0x00007f26f088456f in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QClipboard::Mode>, void, void (QtClipboard::*)(QClipboard::Mode)>::call(void (QtClipboard::*)(QClipboard::Mode), QtClipboard*, void**) (f=(void (QtClipboard::*)(QtClipboard * const, QClipboard::Mode)) 0x7f26f087a76e <QtClipboard::handleChanged(QClipboard::Mode)>, o=0x557f90457770, arg=0x7ffe889a2ed0) at .../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:152\n"
    ~"#4  0x00007f26f08833de in QtPrivate::FunctionPointer<void (QtClipboard::*)(QClipboard::Mode)>::call<QtPrivate::List<QClipboard::Mode>, void>(void (QtClipboard::*)(QClipboard::Mode), QtClipboard*, void**) (f=(void (QtClipboard::*)(QtClipboard * const, QClipboard::Mode)) 0x7f26f087a76e <QtClipboard::handleChanged(QClipboard::Mode)>, o=0x557f90457770, arg=0x7ffe889a2ed0) at .../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:200\n"
    ~"#5  0x00007f26f0881f71 in QtPrivate::QCallableObject<void (QtClipboard::*)(QClipboard::Mode), QtPrivate::List<QClipboard::Mode>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x557f904555f0, r=0x557f90457770, a=0x7ffe889a2ed0, ret=0x0) at .../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:571\n"
    ~"#6  0x00007f26efdb863f in QtPrivate::QSlotObjectBase::call(QObject*, void**) (this=0x557f904555f0, r=0x557f90457770, a=0x7ffe889a2ed0) at .../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:487\n"
    ~"#7  0x00007f26efe5772e in doActivate<false>(QObject*, int, void**) (sender=0x557f8d510fd0, signal_index=3, argv=0x7ffe889a2ed0) at .../qt5/qtbase/src/corelib/kernel/qobject.cpp:4116\n"
    ~"#8  0x00007f26efe4cdef in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=0x557f8d510fd0, m=0x7f26efa47cc0 <QClipboard::staticMetaObject>, local_signal_index=0, argv=0x7ffe889a2ed0) at .../qt5/qtbase/src/corelib/kernel/qobject.cpp:4176\n"
    ~"#9  0x00007f26eede9fcc in QClipboard::changed(QClipboard::Mode) (this=0x557f8d510fd0, _t1=QClipboard::Clipboard) at .../qt5/qtbase/src/gui/Gui_autogen/include/moc_qclipboard.cpp:182\n"
    ~"#10 0x00007f26eede9bc1 in QClipboard::emitChanged(QClipboard::Mode) (this=0x557f8d510fd0, mode=QClipboard::Clipboard) at .../qt5/qtbase/src/gui/kernel/qclipboard.cpp:558\n"
    ~"#11 0x00007f26eee4ed69 in QPlatformClipboard::emitChanged(QClipboard::Mode) (this=0x557f88019c20, mode=QClipboard::Clipboard) at .../qt5/qtbase/src/gui/kernel/qplatformclipboard.cpp:89\n"
    ~"#12 0x00007f26ed78809e in QtWaylandClient::QWaylandClipboard::setMimeData(QMimeData*, QClipboard::Mode) (this=0x557f88019c20, data=0x557f8fb87930, mode=QClipboard::Clipboard) at .../qt5/qtwayland/src/client/qwaylandclipboard.cpp:89\n"
    ~"#13 0x00007f26eede99de in QClipboard::setMimeData(QMimeData*, QClipboard::Mode) (this=0x557f8d510fd0, src=0x557f8fb87930, mode=QClipboard::Clipboard) at .../qt5/qtbase/src/gui/kernel/qclipboard.cpp:447\n"
    ~"#14 0x00007f26f087a5b5 in QtClipboard::setContents(com::sun::star::uno::Reference<com::sun::star::datatransfer::XTransferable> const&, com::sun::star::uno::Reference<com::sun::star::datatransfer::clipboard::XClipboardOwner> const&) (this=0x557f8d50cbb0, xTrans=uno::Reference to (SwTransferable *) 0x557f90440118, xClipboardOwner=uno::Reference to (SwTransferable *) 0x557f90440120) at .../libreoffice/vcl/qt6/../qt5/QtClipboard.cxx:137\n"
    ~"#15 0x00007f26fb05bacc in TransferableHelper::CopyToClipboard(com::sun::star::uno::Reference<com::sun::star::datatransfer::clipboard::XClipboard> const&) const (this=0x557f904400f0, rClipboard=uno::Reference to (QtClipboard *) 0x557f8d50cc10) at .../libreoffice/vcl/source/treelist/transfer.cxx:942\n"
    ~"#16 0x00007f26fb05bc77 in TransferableHelper::CopyToClipboard(vcl::Window*) const (this=0x557f904400f0, pWindow=0x557f8932d1f0) at .../libreoffice/vcl/source/treelist/transfer.cxx:957\n"
    ~"#17 0x00007f26b5130940 in SwTransferable::RemoveDDELinkFormat(vcl::Window&) (this=0x557f904400f0, rWin=...) at .../libreoffice/sw/source/uibase/dochdl/swdtflvr.cxx:385\n"
    ~"#18 0x00007f26b51440ab in SwTransferDdeLink::DataChanged(rtl::OUString const&, com::sun::star::uno::Any const&) (this=0x557f8fb864e0) at .../libreoffice/sw/source/uibase/dochdl/swdtflvr.cxx:4447\n"
    ~"#19 0x00007f270120fa0e in sfx2::SvLinkSource::NotifyDataChanged() (this=0x557f8fb8bbe0) at .../libreoffice/sfx2/source/appl/linksrc.cxx:291\n"
    ~"#20 0x00007f26b43210ba in SwServerObject::SendDataChanged(SwPaM const&) (this=0x557f8fb8bbe0, rRange=SwPaM = {...}) at .../libreoffice/sw/source/core/doc/swserv.cxx:177\n"
    ~"#21 0x00007f26b43217c2 in SwDataChanged::~SwDataChanged() (this=0x7ffe889a3520, __in_chrg=<optimized out>) at .../libreoffice/sw/source/core/doc/swserv.cxx:308\n"
    ~"#22 0x00007f26b4233c8b in sw::DocumentContentOperationsManager::DeleteRangeImplImpl(SwPaM&, SwDeleteFlags) (this=0x557f8d2b8000, rPam=SwPaM = {...}, flags=SwDeleteFlags::Default) at .../libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:4474\n"
    ~"#23 0x00007f26b4233826 in sw::DocumentContentOperationsManager::DeleteRangeImpl(SwPaM&, SwDeleteFlags) (this=0x557f8d2b8000, rPam=SwPaM = {...}, flags=SwDeleteFlags::Default) at .../libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:4419\n"
    ~"#24 0x00007f26b4233681 in sw::DocumentContentOperationsManager::DeleteAndJoinImpl(SwPaM&, SwDeleteFlags) (this=0x557f8d2b8000, rPam=SwPaM = {...}, flags=SwDeleteFlags::Default) at .../libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:4391\n"
    ~"#25 0x00007f26b421edb7 in (anonymous namespace)::lcl_DoWithBreaks(sw::DocumentContentOperationsManager&, SwPaM&, SwDeleteFlags, bool (sw::DocumentContentOperationsManager::*)(sw::DocumentContentOperationsManager* const, SwPaM&, SwDeleteFlags)) (rDocumentContentOperations=..., rPam=SwPaM = {...}, flags=SwDeleteFlags::Default, pFunc=(bool (sw::DocumentContentOperationsManager::*)(sw::DocumentContentOperationsManager * const, SwPaM &, SwDeleteFlags)) 0x7f26b4233632 <sw::DocumentContentOperationsManager::DeleteAndJoinImpl(SwPaM&, SwDeleteFlags)>) at .../libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:681\n"
    ~"#26 0x00007f26b42279df in sw::DocumentContentOperationsManager::DeleteAndJoin(SwPaM&, SwDeleteFlags) (this=0x557f8d2b8000, rPam=SwPaM = {...}, flags=SwDeleteFlags::Default) at .../libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:2367\n"
    ~"#27 0x00007f26b44a71f6 in SwEditShell::DeleteSel(SwPaM&, bool, bool, bool*) (this=0x557f8d51b300, rPam=SwPaM = {...}, isArtificialSelection=false, goLeft=false, pUndo=0x7ffe889a3be6) at .../libreoffice/sw/source/core/edit/eddel.cxx:122\n"
    ~"#28 0x00007f26b44a7671 in SwEditShell::Delete(bool, bool) (this=0x557f8d51b300, isArtificialSelection=false, goLeft=false) at .../libreoffice/sw/source/core/edit/eddel.cxx:164\n"
    ~"#29 0x00007f26b5604933 in SwWrtShell::DelRight(bool) (this=0x557f8d51b300, isReplaceHeuristic=false) at .../libreoffice/sw/source/uibase/wrtsh/delete.cxx:312\n"
    ~"#30 0x00007f26b512fe14 in (anonymous namespace)::SwTrnsfrActionAndUndo::SwTrnsfrActionAndUndo(SwWrtShell*, bool, SwPasteContext*) (this=0x557f9045b020, pS=0x557f8d51b300, bDelSel=true, pContext=0x7ffe889a4220) at .../libreoffice/sw/source/uibase/dochdl/swdtflvr.cxx:236\n"
    ~"#31 0x00007f26b51377c1 in SwTransferable::PasteData(TransferableDataHelper const&, SwWrtShell&, unsigned char, SotExchangeActionFlags, SotClipboardFormatId, SotExchangeDest, bool, bool, Point const*, signed char, bool, RndStdIds, bool, SwPasteContext*, PasteTableType) (rData=..., rSh=..., nAction=36 '$', nActionFlags=(SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl), nFormat=SotClipboardFormatId::HTML, nDestination=SotExchangeDest::SWDOC_FREE_AREA, bIsPasteFormat=false, bIsDefault=false, pPt=0x0, nDropAction=0 '\\000', bPasteSelection=false, nAnchorType=RndStdIds::FLY_AT_PARA, bIgnoreComments=false, pContext=0x7ffe889a4220, ePasteTable=PasteTableType::PASTE_DEFAULT) at .../libreoffice/sw/source/uibase/dochdl/swdtflvr.cxx:1768\n"
    ~"#32 0x00007f26b5137333 in SwTransferable::Paste(SwWrtShell&, TransferableDataHelper&, RndStdIds, bool, PasteTableType) (rSh=..., rData=..., nAnchorType=RndStdIds::FLY_AT_PARA, bIgnoreComments=false, ePasteTable=PasteTableType::PASTE_DEFAULT) at .../libreoffice/sw/source/uibase/dochdl/swdtflvr.cxx:1687\n"
    ~"#33 0x00007f26b52d29e9 in SwBaseShell::ExecClpbrd(SfxRequest&) (this=0x557f8db64330, rReq=...) at .../libreoffice/sw/source/uibase/shells/basesh.cxx:365\n"
    ~"#34 0x00007f26b52d1681 in SfxStubSwBaseShellExecClpbrd(SfxShell*, SfxRequest&) (pShell=0x557f8db64330, rReq=...) at .../libreoffice/workdir/SdiTarget/sw/sdi/swslots.hxx:2219\n"
    ~"#35 0x00007f27012d14dc in SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, SfxRequest&, bool) (this=0x557f8d4f46b0, rShell=..., rSlot=..., rReq=..., bRecord=true) at .../libreoffice/sfx2/source/control/dispatch.cxx:254\n"
    ~"#36 0x00007f27012d4b34 in SfxDispatcher::Execute_(SfxShell&, SfxSlot const&, SfxRequest&, SfxCallMode) (this=0x557f8d4f46b0, rShell=..., rSlot=..., rReq=..., eCallMode=SfxCallMode::RECORD) at .../libreoffice/sfx2/source/control/dispatch.cxx:753\n"
    ~"#37 0x00007f27012c05d4 in SfxBindings::Execute_Impl(SfxRequest&, SfxSlot const*, SfxShell*) (this=0x557f8d503240, aReq=..., pSlot=0x7f26b6cf5360 <aSwBaseShellSlots_Impl+1440>, pShell=0x557f8db64330) at .../libreoffice/sfx2/source/control/bindings.cxx:1057\n"
    ~"#38 0x00007f270139813d in SfxDispatchController_Impl::dispatch(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchResultListener> const&) (this=0x557f8db682a0, aURL=..., aArgs=empty uno::Sequence, rListener=empty uno::Reference) at .../libreoffice/sfx2/source/control/unoctitm.cxx:688\n"
    ~"#39 0x00007f2701395dbf in SfxOfficeDispatch::dispatch(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (this=0x557f8db68200, aURL=..., aArgs=empty uno::Sequence) at .../libreoffice/sfx2/source/control/unoctitm.cxx:250\n"
    ~"#40 0x00007f26fe03d948 in svt::(anonymous namespace)::AsyncAccelExec::impl_ts_asyncCallback(LinkParamNone*) (this=0x557f8fb8e070) at .../libreoffice/svtools/source/misc/acceleratorexecute.cxx:508\n"
    ~"#41 0x00007f26fe03d869 in svt::(anonymous namespace)::AsyncAccelExec::LinkStubimpl_ts_asyncCallback(void*, LinkParamNone*) (instance=0x557f8fb8e070, data=0x0) at .../libreoffice/svtools/source/misc/acceleratorexecute.cxx:500\n"
    ~"#42 0x00007f26fab0db3b in Link<LinkParamNone*, void>::Call(LinkParamNone*) const (this=0x557f8fb8e110, data=0x0) at .../libreoffice/include/tools/link.hxx:111\n"
    ~"#43 0x00007f26fb469f3d in vcl::EventPoster::DoEvent_Impl(void*) (this=0x557f8fb8e108) at .../libreoffice/vcl/source/helper/evntpost.cxx:52\n"
    ~"#44 0x00007f26fb469f05 in vcl::EventPoster::LinkStubDoEvent_Impl(void*, void*) (instance=0x557f8fb8e108, data=0x0) at .../libreoffice/vcl/source/helper/evntpost.cxx:48\n"
    ~"#45 0x00007f26fadc2373 in Link<void*, void>::Call(void*) const (this=0x7f26e80153b8, data=0x0) at .../libreoffice/include/tools/link.hxx:111\n"
    ~"#46 0x00007f26fadbf458 in ImplHandleUserEvent(ImplSVEvent*) (pSVEvent=0x7f26e80153b0) at .../libreoffice/vcl/source/window/winproc.cxx:2287\n"
    ~"#47 0x00007f26fadc1385 in ImplWindowFrameProc(vcl::Window*, SalEvent, void const*) (_pWindow=0x557f897d0e90, nEvent=SalEvent::UserEvent, pEvent=0x7f26e80153b0) at .../libreoffice/vcl/source/window/winproc.cxx:2851\n"
    ~"#48 0x00007f26f08b6bae in SalFrame::CallCallback(SalEvent, void const*) const (this=0x557f8800cf80, nEvent=SalEvent::UserEvent, pEvent=0x7f26e80153b0) at .../libreoffice/vcl/inc/salframe.hxx:310\n"
    ~"#49 0x00007f26f08d9dbf in QtInstance::ProcessEvent(SalUserEventList::SalUserEvent) (this=0x557f88020780, aEvent=...) at .../libreoffice/vcl/qt6/../qt5/QtInstance.cxx:516\n"
    ~"#50 0x00007f26fb47b97f in operator()() const (__closure=0x7ffe889a50e0) at .../libreoffice/vcl/source/app/salusereventlist.cxx:119\n"
    ~"#51 0x00007f26fb47bc53 in SalUserEventList::DispatchUserEvents(bool) (this=0x557f880207b8, bHandleAllCurrentEvents=false) at .../libreoffice/vcl/source/app/salusereventlist.cxx:120\n"
    ~"#52 0x00007f26f08d98a4 in QtInstance::ImplYield(bool, bool) (this=0x557f88020780, bWait=true, bHandleAllCurrentEvents=false) at .../libreoffice/vcl/qt6/../qt5/QtInstance.cxx:442\n"
    ~"#53 0x00007f26f08d9a4f in QtInstance::DoYield(bool, bool) (this=0x557f88020780, bWait=true, bHandleAllCurrentEvents=false) at .../libreoffice/vcl/qt6/../qt5/QtInstance.cxx:464\n"
    ~"#54 0x00007f26fb5390d0 in ImplYield(bool, bool) (i_bWait=true, i_bAllEvents=false) at .../libreoffice/vcl/source/app/svapp.cxx:390\n"
    ~"#55 0x00007f26fb539e6e in Application::Yield() () at .../libreoffice/vcl/source/app/svapp.cxx:474\n"
    ~"#56 0x00007f26fb538dc3 in Application::Execute() () at .../libreoffice/vcl/source/app/svapp.cxx:368\n"
    ~"#57 0x00007f2704e371b6 in desktop::Desktop::Main() (this=0x7ffe889a5c10) at .../libreoffice/desktop/source/app/app.cxx:1614\n"
    ~"#58 0x00007f26fb558292 in ImplSVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:229\n"
    ~"#59 0x00007f26fb5585a7 in SVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:261\n"
    ~"#60 0x00007f2704ea4307 in soffice_main() () at .../libreoffice/desktop/source/app/sofficemain.cxx:94\n"
    ~"#61 0x0000557f862d19d4 in sal_main () at .../libreoffice/desktop/source/app/main.c:51\n"
    ~"#62 0x0000557f862d19ba in main (argc=3, argv=0x7ffe889a5e38) at .../libreoffice/desktop/source/app/main.c:49\n"
    2906^done
    (gdb)

Change-Id: I1f517d441eeb3e77e969062b884d9a425038b22a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163202
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
(cherry picked from commit cb9513c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163179
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit 0750cac)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163184
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
tdf-gerrit pushed a commit that referenced this pull request Feb 26, 2024
...as seen during CppunitTest_xmloff_style,

> workdir/UnpackedTarball/freetype/src/truetype/ttgxvar.c:1048:31: runtime error: applying zero offset to null pointer
>  #0 in tt_var_get_item_delta at workdir/UnpackedTarball/freetype/src/truetype/ttgxvar.c:1048:31
>  #1 in tt_hvadvance_adjust at workdir/UnpackedTarball/freetype/src/truetype/ttgxvar.c:1242:13
>  #2 in tt_vadvance_adjust at workdir/UnpackedTarball/freetype/src/truetype/ttgxvar.c:1278:12
>  #3 in tt_face_get_metrics at workdir/UnpackedTarball/freetype/src/sfnt/ttmtx.c:319:11
>  #4 in cff_slot_load at workdir/UnpackedTarball/freetype/src/cff/cffgload.c:660:11
>  #5 in cff_glyph_load at workdir/UnpackedTarball/freetype/src/cff/cffdrivr.c:192:13
>  #6 in FT_Load_Glyph at workdir/UnpackedTarball/freetype/src/base/ftobjs.c:1066:15
>  #7 in _cairo_ft_scaled_glyph_load_glyph at workdir/UnpackedTarball/cairo/src/cairo-ft-font.c:2455:13
>  #8 in _cairo_ft_scaled_glyph_init at workdir/UnpackedTarball/cairo/src/cairo-ft-font.c:2640:11
>  #9 in _cairo_scaled_glyph_lookup at workdir/UnpackedTarball/cairo/src/cairo-scaled-font.c:3035:6
>  #10 in _cairo_scaled_font_glyph_device_extents at workdir/UnpackedTarball/cairo/src/cairo-scaled-font.c:2250:15
>  #11 in _cairo_composite_rectangles_init_for_glyphs at workdir/UnpackedTarball/cairo/src/cairo-composite-rectangles.c:476:14
>  #12 in _cairo_compositor_glyphs at workdir/UnpackedTarball/cairo/src/cairo-compositor.c:280:14
>  #13 in _cairo_image_surface_glyphs at workdir/UnpackedTarball/cairo/src/cairo-image-surface.c:1030:12
>  #14 in _cairo_surface_show_text_glyphs at workdir/UnpackedTarball/cairo/src/cairo-surface.c:2920:15
>  #15 in _cairo_gstate_show_text_glyphs at workdir/UnpackedTarball/cairo/src/cairo-gstate.c:2077:15
>  #16 in _cairo_default_context_glyphs at workdir/UnpackedTarball/cairo/src/cairo-default-context.c:1334:12
>  #17 in cairo_show_glyphs at workdir/UnpackedTarball/cairo/src/cairo.c:3670:14
>  #18 in CairoTextRender::DrawTextLayout(GenericSalLayout const&, SalGraphics const&) at vcl/unx/generic/gdi/cairotextrender.cxx:477:9
>  #19 in SvpSalGraphics::DrawTextLayout(GenericSalLayout const&) at vcl/headless/svptext.cxx:72:23
>  #20 in GenericSalLayout::DrawText(SalGraphics&) const at vcl/source/gdi/CommonSalLayout.cxx:171:18
>  #21 in OutputDevice::ImplDrawTextDirect(SalLayout&, bool) at vcl/source/outdev/text.cxx:312:16
>  #22 in OutputDevice::ImplDrawText(SalLayout&) at vcl/source/outdev/text.cxx:463:9
>  #23 in OutputDevice::DrawTextArray(Point const&, rtl::OUString const&, KernArraySpan, std::span<unsigned char const, 18446744073709551615ul>, int, int, SalLayoutFlags, SalLayoutGlyphs const*) at vcl/source/outdev/text.cxx:701:9
>  #24 in SwFntObj::DrawText(SwDrawTextInfo&) at sw/source/core/txtnode/fntcache.cxx:1490:31
>  #25 in SwSubFont::DrawText_(SwDrawTextInfo&, bool) at sw/source/core/txtnode/swfont.cxx:1144:24
>  #26 in SwFont::DrawText_(SwDrawTextInfo&) at sw/source/core/inc/swfont.hxx:324:29
>  #27 in SwTextPaintInfo::DrawText_(rtl::OUString const&, SwLinePortion const&, o3tl::strong_int<int, Tag_TextFrameIndex>, o3tl::strong_int<int, Tag_TextFrameIndex>, bool, bool, bool, bool) at sw/source/core/text/inftxt.cxx:730:21
>  #28 in SwTextPaintInfo::DrawText(SwLinePortion const&, o3tl::strong_int<int, Tag_TextFrameIndex>, bool) const at sw/source/core/text/inftxt.hxx:783:41
>  #29 in SwTextPortion::Paint(SwTextPaintInfo const&) const at sw/source/core/text/portxt.cxx:603:18
>  #30 in SwTextPainter::DrawTextLine(SwRect const&, SwSaveClip&, bool, std::optional<SwTaggedPDFHelper>&, std::optional<SwTaggedPDFHelper>&, bool) at sw/source/core/text/itrpaint.cxx:433:23
>  #31 in SwTextFrame::PaintSwFrame(OutputDevice&, SwRect const&) const at sw/source/core/text/frmpaint.cxx:787:23
>  #32 in SwLayoutFrame::PaintSwFrame(OutputDevice&, SwRect const&) const at sw/source/core/layout/paintfrm.cxx:3804:21
>  #33 in SwFlyFrame::PaintSwFrame(OutputDevice&, SwRect const&) const at sw/source/core/layout/paintfrm.cxx:4507:20
>  #34 in SwVirtFlyDrawObj::wrap_DoPaintObject(drawinglayer::geometry::ViewInformation2D const&) const at sw/source/core/draw/dflyobj.cxx:541:18
>  #35 in drawinglayer::primitive2d::(anonymous namespace)::SwVirtFlyDrawObjPrimitive::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&, drawinglayer::geometry::ViewInformation2D const&) const at sw/source/core/draw/dflyobj.cxx:244:35
>  #36 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:46:24
>  #37 in drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:397:13
>  #38 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:69:21
>  #39 in sdr::contact::ObjectContactOfPageView::DoProcessDisplay(sdr::contact::DisplayInfo&) at svx/source/sdr/contact/objectcontactofpageview.cxx:284:31
>  #40 in sdr::contact::ObjectContactOfPageView::ProcessDisplay(sdr::contact::DisplayInfo&) at svx/source/sdr/contact/objectcontactofpageview.cxx:120:21
>  #41 in SdrPageWindow::RedrawLayer(o3tl::strong_int<short, SdrLayerIDTag> const*, sdr::contact::ViewObjectContactRedirector*, basegfx::B2IRange const*) at svx/source/svdraw/sdrpagewindow.cxx:421:28
>  #42 in SdrPageView::DrawLayer(o3tl::strong_int<short, SdrLayerIDTag>, OutputDevice*, sdr::contact::ViewObjectContactRedirector*, tools::Rectangle const&, basegfx::B2IRange const*) at svx/source/svdraw/svdpagv.cxx:265:27
>  #43 in SwViewShellImp::PaintLayer(o3tl::strong_int<short, SdrLayerIDTag>, SwPageFrame const&, SwRect const&, Color const*, bool, sdr::contact::ViewObjectContactRedirector*) at sw/source/core/view/vdraw.cxx:139:20
>  #44 in SwRootFrame::PaintSwFrame(OutputDevice&, SwRect const&) const at sw/source/core/layout/paintfrm.cxx:3527:33
>  #45 in SwViewShell::PrtOle2(SwDoc*, SwViewOption const*, SwPrintData const&, OutputDevice&, tools::Rectangle const&, bool) at sw/source/core/view/vprint.cxx:592:27
>  #46 in SwDocShell::Draw(OutputDevice*, JobSetup const&, unsigned short, bool) at sw/source/uibase/app/docsh.cxx:881:5
>  #47 in SfxObjectShell::DoDraw_Impl(OutputDevice*, Point const&, Fraction const&, Fraction const&, JobSetup const&, unsigned short, bool) at sfx2/source/doc/objembed.cxx:204:5
>  #48 in SfxObjectShell::DoDraw(OutputDevice*, Point const&, Size const&, JobSetup const&, unsigned short, bool) at sfx2/source/doc/objembed.cxx:151:9
>  #49 in SfxObjectShell::CreatePreview_Impl(bool, VirtualDevice*, GDIMetaFile*) const at sfx2/source/doc/objcont.cxx:198:40
>  #50 in SfxObjectShell::GetPreviewBitmap() const at sfx2/source/doc/objcont.cxx:110:9
>  #51 in SfxObjectShell::WriteThumbnail(bool, com::sun::star::uno::Reference<com::sun::star::io::XStream> const&) at sfx2/source/doc/objstor.cxx:3850:31
>  #52 in SfxObjectShell::GenerateAndStoreThumbnail(bool, com::sun::star::uno::Reference<com::sun::star::embed::XStorage> const&) at sfx2/source/doc/objstor.cxx:3808:33
>  #53 in SfxObjectShell::SaveTo_Impl(SfxMedium&, SfxItemSet const*) at sfx2/source/doc/objstor.cxx:1531:19
>  #54 in SfxObjectShell::PreDoSaveAs_Impl(rtl::OUString const&, rtl::OUString const&, SfxItemSet const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sfx2/source/doc/objstor.cxx:3117:39
>  #55 in SfxObjectShell::CommonSaveAs_Impl(INetURLObject const&, rtl::OUString const&, SfxItemSet&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sfx2/source/doc/objstor.cxx:2907:9
>  #56 in SfxObjectShell::APISaveAs_Impl(std::basic_string_view<char16_t, std::char_traits<char16_t>>, SfxItemSet&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sfx2/source/doc/objserv.cxx:320:19
>  #57 in SfxBaseModel::impl_store(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, bool) at sfx2/source/doc/sfxbasemodel.cxx:3233:42
>  #58 in SfxBaseModel::storeToURL(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sfx2/source/doc/sfxbasemodel.cxx:1815:13
>  #59 in UnoApiTest::saveWithParams(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at test/source/unoapi_test.cxx:213:16
>  #60 in UnoApiTest::save(rtl::OUString const&, char const*) at test/source/unoapi_test.cxx:178:5
>  #61 in testWritingModeBTLR::TestBody() at xmloff/qa/unit/style.cxx:193:9

Change-Id: I54d4d90e203127e018b99c34785602ac3d96e425
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163925
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
tdf-gerrit pushed a commit that referenced this pull request Feb 27, 2024
the appearance of 2 interceptions is reproducible for me on linux with

make CppunitTest_framework_dispatch VALGRIND=memcheck

1st time
 #1 (anonymous namespace)::MyInterceptor::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/qa/cppunit/dispatchtest.cxx:139
 #2 non-virtual thunk to (anonymous namespace)::MyInterceptor::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/qa/cppunit/dispatchtest.cxx:0
 #3 framework::InterceptionHelper::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/dispatch/interceptionhelper.cxx:87
 #4 non-virtual thunk to framework::InterceptionHelper::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/dispatch/interceptionhelper.cxx:0
 #5 (anonymous namespace)::XFrameImpl::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/services/frame.cxx:2329
 #6 non-virtual thunk to (anonymous namespace)::XFrameImpl::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/services/frame.cxx:0
 #7 framework::DispatchHelper::executeDispatch(com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at core/framework/source/services/dispatchhelper.cxx:110
 #8 non-virtual thunk to framework::DispatchHelper::executeDispatch(com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at core/framework/source/services/dispatchhelper.cxx:0
 #9 unotest::MacrosTest::dispatchCommand(com::sun::star::uno::Reference<com::sun::star::lang::XComponent> const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at core/unotest/source/cpp/macros_test.cxx:94
 #10 (anonymous namespace)::testInterception::TestBody() at core/framework/qa/cppunit/dispatchtest.cxx:172

2nd time
 #1 (anonymous namespace)::MyInterceptor::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/qa/cppunit/dispatchtest.cxx:139
 #2 non-virtual thunk to (anonymous namespace)::MyInterceptor::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/qa/cppunit/dispatchtest.cxx:0
 #3 framework::InterceptionHelper::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/dispatch/interceptionhelper.cxx:87
 #4 non-virtual thunk to framework::InterceptionHelper::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/dispatch/interceptionhelper.cxx:0
 #5 (anonymous namespace)::XFrameImpl::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/services/frame.cxx:2329
 #6 non-virtual thunk to (anonymous namespace)::XFrameImpl::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/services/frame.cxx:0
 #7 SfxStateCache::GetSlotServer(SfxDispatcher&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> const&) at core/sfx2/source/control/statcach.cxx:263
 #8 SfxBindings::UpdateSlotServer_Impl() at core/sfx2/source/control/bindings.cxx:1083
 #9 SfxBindings::NextJob_Impl(Timer const*) at core/sfx2/source/control/bindings.cxx:1254
 #10 SfxBindings::NextJob(Timer*) at core/sfx2/source/control/bindings.cxx:1222
 #11 SfxBindings::LinkStubNextJob(void*, Timer*) at core/sfx2/source/control/bindings.cxx:1219
 #12 Link<Timer*, void>::Call(Timer*) const at core/include/tools/link.hxx:111
 #13 Timer::Invoke() at core/vcl/source/app/timer.cxx:76
 #14 Scheduler::CallbackTaskScheduling() at core/vcl/source/app/scheduler.cxx:480
 #15 SalTimer::CallCallback() at core/vcl/inc/saltimer.hxx:55
 #16 SvpSalInstance::CheckTimeout(bool) at core/vcl/headless/svpinst.cxx:161
 #17 SvpSalInstance::ImplYield(bool, bool) at core/vcl/headless/svpinst.cxx:399
 #18 SvpSalInstance::DoYield(bool, bool) at core/vcl/headless/svpinst.cxx:471
 #19 ImplYield(bool, bool) at core/vcl/source/app/svapp.cxx:377
 #20 Scheduler::ProcessEventsToIdle() at core/vcl/source/app/svapp.cxx:407
 #21 unotest::MacrosTest::dispatchCommand(com::sun::star::uno::Reference<com::sun::star::lang::XComponent> const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at core/unotest/source/cpp/macros_test.cxx:95
 #22 (anonymous namespace)::testInterception::TestBody() at core/framework/qa/cppunit/dispatchtest.cxx:172

setting bold/italic will invalidate the slot for the property and timer
starts to update the normal listeners to those properties which might
kick in on a slower run.

Change-Id: Ib37e61c0fbed463f8974d476158e54a0160a2c92
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157798
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164039
Tested-by: Jenkins
tdf-gerrit pushed a commit that referenced this pull request Feb 28, 2024
The recently added CppunitTest_sc_tiledrendering
CPPUNIT_TEST_NAME=testEditShapeText::TestBody had started to cause

> svx/source/svdraw/sdrpagewindow.cxx:471:56: runtime error: member call on address 0x51d0000c4480 which does not point to an object of type 'SdrMarkView'
> 0x51d0000c4480: note: object is of type 'SdrPaintView'
>  00 00 00 00  30 1f 13 bc ca 7f 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  03 00 00 00
>               ^~~~~~~~~~~~~~~~~~~~~~~
>               vptr for 'SdrPaintView'
>  #0 in SdrPageWindow::InvalidatePageWindow(basegfx::B2DRange const&) at svx/source/svdraw/sdrpagewindow.cxx:471:56
>  #1 in sdr::contact::ObjectContactOfPageView::InvalidatePartOfView(basegfx::B2DRange const&) const at svx/source/sdr/contact/objectcontactofpageview.cxx:357:29
>  #2 in sdr::contact::ViewObjectContact::triggerLazyInvalidate() at svx/source/sdr/contact/viewobjectcontact.cxx:267:28
>  #3 in sdr::contact::ObjectContactOfPageView::Invoke() at svx/source/sdr/contact/objectcontactofpageview.cxx:105:29
>  #4 in sdr::contact::ObjectContactOfPageView::~ObjectContactOfPageView() at svx/source/sdr/contact/objectcontactofpageview.cxx:74:13
>  #5 in sdr::contact::ObjectContactOfPageView::~ObjectContactOfPageView() at svx/source/sdr/contact/objectcontactofpageview.cxx:72:9
>  #6 in SdrPageWindow::ResetObjectContact() at svx/source/svdraw/sdrpagewindow.cxx:520:9
>  #7 in SdrPageWindow::~SdrPageWindow() at svx/source/svdraw/sdrpagewindow.cxx:130:5
>  #8 in std::default_delete<SdrPageWindow>::operator()(SdrPageWindow*) const at ~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/14.0.0/../../../../include/c++/14.0.0/bits/unique_ptr.h:93:2
>  #9 in std::unique_ptr<SdrPageWindow, std::default_delete<SdrPageWindow>>::~unique_ptr() at ~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/14.0.0/../../../../include/c++/14.0.0/bits/unique_ptr.h:398:4
>  #10 in void std::destroy_at<std::unique_ptr<SdrPageWindow, std::default_delete<SdrPageWindow>>>(std::unique_ptr<SdrPageWindow, std::default_delete<SdrPageWindow>>*) at ~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/14.0.0/../../../../include/c++/14.0.0/bits/stl_construct.h:88:15
>  #11 in void std::_Destroy<std::unique_ptr<SdrPageWindow, std::default_delete<SdrPageWindow>>>(std::unique_ptr<SdrPageWindow, std::default_delete<SdrPageWindow>>*) at ~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/14.0.0/../../../../include/c++/14.0.0/bits/stl_construct.h:149:7
>  #12 in void std::_Destroy_aux<false>::__destroy<std::unique_ptr<SdrPageWindow, std::default_delete<SdrPageWindow>>*>(std::unique_ptr<SdrPageWindow, std::default_delete<SdrPageWindow>>*, std::unique_ptr<SdrPageWindow, std::default_delete<SdrPageWindow>>*) at ~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/14.0.0/../../../../include/c++/14.0.0/bits/stl_construct.h:163:6
>  #13 in void std::_Destroy<std::unique_ptr<SdrPageWindow, std::default_delete<SdrPageWindow>>*>(std::unique_ptr<SdrPageWindow, std::default_delete<SdrPageWindow>>*, std::unique_ptr<SdrPageWindow, std::default_delete<SdrPageWindow>>*) at ~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/14.0.0/../../../../include/c++/14.0.0/bits/stl_construct.h:195:7
>  #14 in void std::_Destroy<std::unique_ptr<SdrPageWindow, std::default_delete<SdrPageWindow>>*, std::unique_ptr<SdrPageWindow, std::default_delete<SdrPageWindow>>>(std::unique_ptr<SdrPageWindow, std::default_delete<SdrPageWindow>>*, std::unique_ptr<SdrPageWindow, std::default_delete<SdrPageWindow>>*, std::allocator<std::unique_ptr<SdrPageWindow, std::default_delete<SdrPageWindow>>>&) at ~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/14.0.0/../../../../include/c++/14.0.0/bits/alloc_traits.h:941:7
>  #15 in std::__cxx1998::vector<std::unique_ptr<SdrPageWindow, std::default_delete<SdrPageWindow>>, std::allocator<std::unique_ptr<SdrPageWindow, std::default_delete<SdrPageWindow>>>>::~vector() at ~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/14.0.0/../../../../include/c++/14.0.0/bits/stl_vector.h:732:2
>  #16 in std::__debug::vector<std::unique_ptr<SdrPageWindow, std::default_delete<SdrPageWindow>>, std::allocator<std::unique_ptr<SdrPageWindow, std::default_delete<SdrPageWindow>>>>::~vector() at ~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/14.0.0/../../../../include/c++/14.0.0/debug/vector:245:25
>  #17 in SdrPageView::~SdrPageView() at svx/source/svdraw/svdpagv.cxx:122:1
>  #18 in std::default_delete<SdrPageView>::operator()(SdrPageView*) const at ~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/14.0.0/../../../../include/c++/14.0.0/bits/unique_ptr.h:93:2
>  #19 in std::__uniq_ptr_impl<SdrPageView, std::default_delete<SdrPageView>>::reset(SdrPageView*) at ~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/14.0.0/../../../../include/c++/14.0.0/bits/unique_ptr.h:205:4
>  #20 in std::unique_ptr<SdrPageView, std::default_delete<SdrPageView>>::reset(SdrPageView*) at ~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/14.0.0/../../../../include/c++/14.0.0/bits/unique_ptr.h:503:7
>  #21 in SdrPaintView::ClearPageView() at svx/source/svdraw/svdpntv.cxx:356:20
>  #22 in SdrPaintView::~SdrPaintView() at svx/source/svdraw/svdpntv.cxx:189:5
>  #23 in SdrSnapView::~SdrSnapView() at svx/source/svdraw/svdsnpv.cxx:199:1
>  #24 in SdrMarkView::~SdrMarkView() at svx/source/svdraw/svdmrkv.cxx:197:1
>  #25 in SdrEditView::~SdrEditView() at svx/source/svdraw/svdedtv.cxx:126:1
>  #26 in SdrPolyEditView::~SdrPolyEditView() at svx/source/svdraw/svdpoev.cxx:58:1
>  #27 in SdrGlueEditView::~SdrGlueEditView() at svx/source/svdraw/svdglev.cxx:40:1
>  #28 in SdrObjEditView::~SdrObjEditView() at svx/source/svdraw/svdedxv.cxx:101:1
>  #29 in SdrExchangeView::~SdrExchangeView() at include/svx/svdxcgv.hxx:27:25
>  #30 in SdrDragView::~SdrDragView() at svx/source/svdraw/svddrgv.cxx:69:1
>  #31 in SdrCreateView::~SdrCreateView() at svx/source/svdraw/svdcrtv.cxx:199:1
>  #32 in SdrView::~SdrView() at svx/source/svdraw/svdview.cxx:154:1
>  #33 in E3dView::~E3dView() at svx/source/engine3d/view3d.cxx:1457:1
>  #34 in FmFormView::~FmFormView() at svx/source/form/fmview.cxx:124:1
>  #35 in FmFormView::~FmFormView() at svx/source/form/fmview.cxx:119:1
>  #36 in std::default_delete<FmFormView>::operator()(FmFormView*) const at ~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/14.0.0/../../../../include/c++/14.0.0/bits/unique_ptr.h:93:2
>  #37 in std::unique_ptr<FmFormView, std::default_delete<FmFormView>>::~unique_ptr() at ~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/14.0.0/../../../../include/c++/14.0.0/bits/unique_ptr.h:398:4
>  #38 in ScGridWindow::~ScGridWindow() at sc/source/ui/view/gridwin.cxx:450:1
>  #39 in ScGridWindow::~ScGridWindow() at sc/source/ui/view/gridwin.cxx:448:1
>  #40 in ScGridWindow::~ScGridWindow() at sc/source/ui/view/gridwin.cxx:448:1
>  #41 in VclReferenceBase::release() const at include/vcl/vclreferencebase.hxx:43:13
>  #42 in rtl::Reference<vcl::Window>::~Reference() at include/rtl/ref.hxx:131:22
>  #43 in VclPtr<vcl::Window>::~VclPtr() at include/vcl/vclptr.hxx:112:5
>  #44 in ImplSVWinData::~ImplSVWinData() at vcl/source/app/svdata.cxx:531:34
>  #45 in DestroySVWinData(ImplSVWinData*) at vcl/source/app/svdata.cxx:388:5
>  #46 in SfxViewFrame::~SfxViewFrame() at sfx2/source/view/viewfrm.cxx:2012:5
>  #47 in SfxViewFrame::Close() at sfx2/source/view/viewfrm.cxx:1190:5
>  #48 in SfxFrame::DoClose_Impl() at sfx2/source/view/frame.cxx:138:37
>  #49 in SfxBaseController::dispose() at sfx2/source/view/sfxbasecontroller.cxx:928:27
>  #50 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&) at framework/source/services/frame.cxx:1495:33
>  #51 in (anonymous namespace)::XFrameImpl::close(unsigned char) at framework/source/services/frame.cxx:1706:12
>  #52 in SfxFrame::DoClose() at sfx2/source/view/frame.cxx:104:29
>  #53 in SfxViewFrame::Notify(SfxBroadcaster&, SfxHint const&) at sfx2/source/view/viewfrm.cxx:1778:28
>  #54 in SfxBroadcaster::Broadcast(SfxHint const&) at svl/source/notify/SfxBroadcaster.cxx:40:24
>  #55 in (anonymous namespace)::SfxModelListener_Impl::notifyClosing(com::sun::star::lang::EventObject const&) at sfx2/source/doc/objxtor.cxx:147:12
>  #56 in SfxBaseModel::close(unsigned char) at sfx2/source/doc/sfxbasemodel.cxx:1516:40
>  #57 in SfxBaseModel::dispose() at sfx2/source/doc/sfxbasemodel.cxx:750:13
>  #58 in ScTiledRenderingTest::tearDown() at sc/qa/unit/tiledrendering/tiledrendering.cxx:140:22

The fix appears to be to just not call back into the in-destruction FmFormView -
... - SdrMarkView - ... - SdrPaintView - ... deep-inheritance object, by not
initiating any further triggerLazyInvalidate from within
~ObjectContactOfPageView.

Change-Id: If5e49e4ebdbbf18d38e89c6b28ff3577224080a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164024
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
tdf-gerrit pushed a commit that referenced this pull request Feb 28, 2024
`Window::dispose` takes care of disposing its
accessible as well.

However, `VCLXWindow::dispose` was explicitly unsetting
the accessible before disposing its `vcl::Window`, resulting
in it not getting disposed, in turn resulting in a crash on exit
for the tdf#159735 case.

Potentially related:

    commit 5aa60be
    Date:   Wed May 12 11:33:06 2021 +0200

        fix leak in VCLXWindow

        which is a little tricky because dispose() can be called from either
        side (vcl::Window or VCLXWindow)

Before that commit, setting a nullptr accessible happened
in the `VCLXWindow` dtor, which is meant to get called after
the `vcl::Window` got disposed in `VCLXWindow::dispose`.
(In the Linux bibisect repo, the commit before that one is fine
and at that commit, the tdf#159735 comment 5 scenario even
crashes in step 3 already.)

Don't unset the `vcl::Window`'s accessible any more in
`VCLXWindow::dispose`, but do that after disposing it in
`vcl::Window::dispose` instead, which seems to be the
natural place to do that anyway.

Backtrace of crash:

    Thread 1 received signal SIGSEGV, Segmentation fault.
    0x00007fd754ae6fe9 in comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>::disposeAndClear (this=0x7ffccdc2b5b8, rGuard=..., rEvt=...) at include/comphelper/interfacecontainer4.hxx:397
    397                     aIt.next()->disposing(rEvt);
    (gdb) bt
    #0  0x00007fd754ae6fe9 in comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>::disposeAndClear(std::unique_lock<std::mutex>&, com::sun::star::lang::EventObject const&)
        (this=0x7ffccdc2b5b8, rGuard=..., rEvt=...) at include/comphelper/interfacecontainer4.hxx:397
    #1  0x00007fd754ae6014 in comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing(unsigned int, com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&)
        (_nClient=28, _rxEventSource=uno::Reference to (accessibility::AccessibleListBox *) 0x55bf49c0ad00) at .../libreoffice/comphelper/source/misc/accessibleeventnotifier.cxx:204
    #2  0x00007fd754ae1424 in comphelper::OCommonAccessibleComponent::disposing() (this=0x55bf49c0ad00) at .../libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:61
    #3  0x00007fd74e884512 in VCLXAccessibleComponent::disposing() (this=0x55bf49c0ad00) at .../libreoffice/toolkit/source/awt/vclxaccessiblecomponent.cxx:376
    #4  0x00007fd6a3d506b7 in accessibility::AccessibleListBox::disposing() (this=0x55bf49c0ad00) at .../libreoffice/accessibility/source/extended/accessiblelistbox.cxx:246
    #5  0x00007fd75453f544 in cppu::WeakComponentImplHelperBase::dispose() (this=0x55bf49c0ad00) at .../libreoffice/cppuhelper/source/implbase.cxx:104
    #6  0x00007fd6a3d45fd5 in cppu::PartialWeakComponentImplHelper<com::sun::star::accessibility::XAccessibleContext2, com::sun::star::accessibility::XAccessibleEventBroadcaster>::dispose() (this=0x55bf49c0ad00)
        at include/cppuhelper/compbase.hxx:90
    #7  0x00007fd75453f1fe in cppu::WeakComponentImplHelperBase::release() (this=0x55bf49c0ad00) at .../libreoffice/cppuhelper/source/implbase.cxx:79
    #8  0x00007fd6a3d47d85 in cppu::PartialWeakComponentImplHelper<com::sun::star::accessibility::XAccessibleContext2, com::sun::star::accessibility::XAccessibleEventBroadcaster>::release() (this=0x55bf49c0ad00)
        at include/cppuhelper/compbase.hxx:86
    #9  0x00007fd6a3d47ca5 in cppu::ImplInheritanceHelper<comphelper::OCommonAccessibleComponent, com::sun::star::accessibility::XAccessibleExtendedComponent>::release() (this=0x55bf49c0ad00) at include/cppuhelper/implbase.hxx:171
    #10 0x00007fd6a3d47c85 in cppu::ImplInheritanceHelper<comphelper::OAccessibleExtendedComponentHelper, com::sun::star::lang::XServiceInfo>::release() (this=0x55bf49c0ad00) at include/cppuhelper/implbase.hxx:171
    #11 0x00007fd6a3d45f55 in cppu::ImplInheritanceHelper<VCLXAccessibleComponent, com::sun::star::accessibility::XAccessible, com::sun::star::accessibility::XAccessibleSelection>::release() (this=0x55bf49c0ad00)
        at include/cppuhelper/implbase.hxx:171
    #12 0x00007fd74282e13e in com::sun::star::uno::Reference<com::sun::star::uno::XInterface>::~Reference() (this=0x55bf49c0e860) at include/com/sun/star/uno/Reference.hxx:114
    #13 0x00007fd7428524c5 in std::destroy_at<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*) (__location=0x55bf49c0e860)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:88
    #14 0x00007fd7428524a5 in std::_Destroy<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*) (__pointer=0x55bf49c0e860)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:149
    #15 0x00007fd742852477 in std::_Destroy_aux<false>::__destroy<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*, com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*) (__first=0x55bf49c0e860, __last=0x55bf49c0e868) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:163
    #16 0x00007fd74285243d in std::_Destroy<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*, com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*) (__first=0x55bf49c0e860, __last=0x55bf49c0e868) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:195
    #17 0x00007fd742852379 in std::_Destroy<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*, com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*, com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*, std::allocator<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >&) (__first=0x55bf49c0e860, __last=0x55bf49c0e868)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/alloc_traits.h:948
    #18 std::__cxx1998::vector<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>, std::allocator<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> > >::~vector() (this=0x55bf4d1120f8)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_vector.h:732
    #19 0x00007fd74285231d in std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>, std::allocator<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> > >::~vector() (this=0x55bf4d1120e0)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/debug/vector:230
    #20 0x00007fd7428522f5 in o3tl::sorted_vector<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>, std::less<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >, o3tl::find_unique>::~sorted_vector()
        (this=0x55bf4d1120e0) at include/o3tl/sorted_vector.hxx:47
    #21 0x00007fd74284f83d in DocumentFocusListener::~DocumentFocusListener() (this=0x55bf4d1120b0) at vcl/inc/unx/gtk/gtkdata.hxx:221
    #22 0x00007fd74284f869 in DocumentFocusListener::~DocumentFocusListener() (this=0x55bf4d1120b0) at vcl/inc/unx/gtk/gtkdata.hxx:221
    #23 0x00007fd7546453a0 in cppu::OWeakObject::release() (this=0x55bf4d1120b0) at .../libreoffice/cppuhelper/source/weak.cxx:230
    #24 0x00007fd742834415 in cppu::WeakImplHelper<com::sun::star::accessibility::XAccessibleEventListener>::release() (this=0x55bf4d1120b0) at include/cppuhelper/implbase.hxx:115
    #25 0x00007fd754aec91e in com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>::~Reference() (this=0x55bf4896c088) at include/com/sun/star/uno/Reference.hxx:114
    #26 0x00007fd754aec8e5 in std::destroy_at<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> >(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*)
        (__location=0x55bf4896c088) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:88
    #27 0x00007fd754aec8c5 in std::_Destroy<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> >(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*)
        (__pointer=0x55bf4896c088) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:149
    #28 0x00007fd754aec897 in std::_Destroy_aux<false>::__destroy<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*>(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*, com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*) (__first=0x55bf4896c088, __last=0x55bf4896c090)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:163
    #29 0x00007fd754aec85d in std::_Destroy<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*>(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*, com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*) (__first=0x55bf4896c080, __last=0x55bf4896c090) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:195
    #30 0x00007fd754aec799 in std::_Destroy<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*, com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> >(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*, com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> >&) (__first=0x55bf4896c080, __last=0x55bf4896c090) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/alloc_traits.h:948
    --Type <RET> for more, q to quit, c to continue without paging--
    #31 std::__cxx1998::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> > >::~vector()
        (this=0x55bf49866bc8) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_vector.h:732
    #32 0x00007fd754aec73d in std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> > >::~vector() (this=0x55bf49866bb0) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/debug/vector:230
    #33 0x00007fd754aec715 in o3tl::cow_wrapper<std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> > >, o3tl::ThreadSafeRefCountingPolicy>::impl_t::~impl_t() (this=0x55bf49866bb0) at include/o3tl/cow_wrapper.hxx:176
    #34 0x00007fd754aec6e4 in o3tl::cow_wrapper<std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> > >, o3tl::ThreadSafeRefCountingPolicy>::release() (this=0x55bf49b28380) at include/o3tl/cow_wrapper.hxx:207
    #35 0x00007fd754aec675 in o3tl::cow_wrapper<std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> > >, o3tl::ThreadSafeRefCountingPolicy>::~cow_wrapper() (this=0x55bf49b28380) at include/o3tl/cow_wrapper.hxx:271
    #36 0x00007fd754ae6ae5 in comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>::~OInterfaceContainerHelper4() (this=0x55bf49b28380) at include/comphelper/interfacecontainer4.hxx:126
    #37 0x00007fd754ae7c49 in std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >::~pair() (this=0x55bf49b28378)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_pair.h:187
    #38 0x00007fd754ae7c25 in std::destroy_at<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> > >(std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >*) (__location=0x55bf49b28378) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:88
    #39 0x00007fd754ae7b4b in std::allocator_traits<std::allocator<std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false> > >::destroy<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> > >(std::allocator<std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false> >&, std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >*)
        (__a=..., __p=0x55bf49b28378) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/alloc_traits.h:560
    #40 std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false> > >::_M_deallocate_node(std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false>*)
        (this=0x7fd754d2aaa8 <(anonymous namespace)::gaClients+40>, __n=0x55bf49b28370) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable_policy.h:2011
    #41 0x00007fd754ae7ab5 in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false> > >::_M_deallocate_nodes(std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false>*)
        (this=0x7fd754d2aaa8 <(anonymous namespace)::gaClients+40>, __n=0x0) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable_policy.h:2033
    #42 0x00007fd754ae79df in std::_Hashtable<unsigned int, std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, std::allocator<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> > >, std::__detail::_Select1st, std::equal_to<unsigned int>, std::hash<unsigned int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::clear() (this=0x7fd754d2aaa8 <(anonymous namespace)::gaClients+40>)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable.h:2524
    #43 0x00007fd754af6415 in std::__cxx1998::unordered_map<unsigned int, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> > > >::clear() (this=0x7fd754d2aaa8 <(anonymous namespace)::gaClients+40>)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/unordered_map.h:798
    #44 0x00007fd754ae778d in std::__debug::unordered_map<unsigned int, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> > > >::clear() (this=0x7fd754d2aa80 <(anonymous namespace)::gaClients>)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/debug/unordered_map:234
    #45 0x00007fd754ae6640 in comphelper::AccessibleEventNotifier::shutdown() () at .../libreoffice/comphelper/source/misc/accessibleeventnotifier.cxx:268
    #46 0x00007fd74d3c5e41 in DeInitVCL() () at .../libreoffice/vcl/source/app/svmain.cxx:619
    #47 0x00007fd74d3c4031 in ImplSVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:254
    #48 0x00007fd74d3c5f79 in SVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:261
    #49 0x00007fd7565a4ba3 in soffice_main() () at .../libreoffice/desktop/source/app/sofficemain.cxx:94
    #50 0x000055bf472e7a5d in sal_main () at .../libreoffice/desktop/source/app/main.c:51
    #51 0x000055bf472e7a37 in main (argc=3, argv=0x7ffccdc2c9a8) at .../libreoffice/desktop/source/app/main.c:49

Change-Id: I251b2f97184e0492f02eb772e5906847f9249506
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164090
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
tdf-gerrit pushed a commit that referenced this pull request Feb 29, 2024
...introduced in 364f0bb "tdf#155218 sc: fix
regression page orientation in print dialog", causing UITest_calc_dialogs to
fail with

> /include/vcl/print.hxx:227:61: runtime error: load of value 190, which is not a valid value for type 'bool'
>     #0 0x7f1337c5ec9e in Printer::IsPrintAreaReset() /include/vcl/print.hxx:227:61
>     #1 0x7f1337bd64be in ScModelObj::getRendererCount(com::sun::star::uno::Any const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sc/source/ui/unoobj/docuno.cxx:1856:41
>     #2 0x7f13ca466d5f in SfxPrinterController::getPageCount() const /sfx2/source/view/viewprn.cxx:228:36
>     #3 0x7f13a130580e in Printer::PreparePrintJob(std::shared_ptr<vcl::PrinterController>, JobSetup const&) /vcl/source/gdi/print3.cxx:420:53
>     #4 0x7f13a13027e3 in Printer::ImplPrintJob(std::shared_ptr<vcl::PrinterController> const&, JobSetup const&) /vcl/source/gdi/print3.cxx:575:9
>     #5 0x7f13a134cdc8 in (anonymous namespace)::PrintJobAsync::ExecJob(void*) /vcl/source/gdi/print3.cxx:318:5
>     #6 0x7f13a1302b28 in (anonymous namespace)::PrintJobAsync::LinkStubExecJob(void*, void*) /vcl/source/gdi/print3.cxx:316:1
>     #7 0x7f139f592d0d in Link<void*, void>::Call(void*) const /include/tools/link.hxx:111:45
>     #8 0x7f139f579a00 in ImplHandleUserEvent(ImplSVEvent*) /vcl/source/window/winproc.cxx:2287:30
>     #9 0x7f139f5646c0 in ImplWindowFrameProc(vcl::Window*, SalEvent, void const*) /vcl/source/window/winproc.cxx:2851:13
>     #10 0x7f13a3273a82 in SalFrame::CallCallback(SalEvent, void const*) const /vcl/inc/salframe.hxx:310:29
>     #11 0x7f13a3320ea1 in SvpSalInstance::ProcessEvent(SalUserEventList::SalUserEvent) /vcl/headless/svpinst.cxx:266:22
>     #12 0x7f13a3321632 in non-virtual thunk to SvpSalInstance::ProcessEvent(SalUserEventList::SalUserEvent) /vcl/headless/svpinst.cxx
>     #13 0x7f13a1b7e593 in SalUserEventList::DispatchUserEvents(bool)::$_0::operator()() const /vcl/source/app/salusereventlist.cxx:119:58
>     #14 0x7f13a1b7dd25 in SalUserEventList::DispatchUserEvents(bool) /vcl/source/app/salusereventlist.cxx:120:13
>     #15 0x7f13a3325345 in SvpSalInstance::ImplYield(bool, bool) /vcl/headless/svpinst.cxx:395:22
>     #16 0x7f13a3327b4e in SvpSalInstance::DoYield(bool, bool) /vcl/headless/svpinst.cxx:471:21
>     #17 0x7f13a2012c4a in ImplYield(bool, bool) /vcl/source/app/svapp.cxx:390:48
>     #18 0x7f13a20112b8 in Application::Yield() /vcl/source/app/svapp.cxx:474:5
>     #19 0x7f13a2010b57 in Application::Execute() /vcl/source/app/svapp.cxx:368:13
>     #20 0x7f13e355d421 in desktop::Desktop::Main() /desktop/source/app/app.cxx:1614:13
>     #21 0x7f13a20b6ae2 in ImplSVMain() /vcl/source/app/svmain.cxx:229:35
>     #22 0x7f13a20bfd20 in SVMain() /vcl/source/app/svmain.cxx:261:12
>     #23 0x7f13e376dc40 in soffice_main /desktop/source/app/sofficemain.cxx:94:12
>     #24 0x4fda3c in sal_main /desktop/source/app/main.c:51:15

(<https://ci.libreoffice.org/job/lo_ubsan/3090/>)

Change-Id: Ibf9ed98b133337457e983155b960dfc40f84c819
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164135
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
tdf-gerrit pushed a commit that referenced this pull request Feb 29, 2024
`Window::dispose` takes care of disposing its
accessible as well.

However, `VCLXWindow::dispose` was explicitly unsetting
the accessible before disposing its `vcl::Window`, resulting
in it not getting disposed, in turn resulting in a crash on exit
for the tdf#159735 case.

Potentially related:

    commit 5aa60be
    Date:   Wed May 12 11:33:06 2021 +0200

        fix leak in VCLXWindow

        which is a little tricky because dispose() can be called from either
        side (vcl::Window or VCLXWindow)

Before that commit, setting a nullptr accessible happened
in the `VCLXWindow` dtor, which is meant to get called after
the `vcl::Window` got disposed in `VCLXWindow::dispose`.
(In the Linux bibisect repo, the commit before that one is fine
and at that commit, the tdf#159735 comment 5 scenario even
crashes in step 3 already.)

Don't unset the `vcl::Window`'s accessible any more in
`VCLXWindow::dispose`, but do that after disposing it in
`vcl::Window::dispose` instead, which seems to be the
natural place to do that anyway.

Backtrace of crash:

    Thread 1 received signal SIGSEGV, Segmentation fault.
    0x00007fd754ae6fe9 in comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>::disposeAndClear (this=0x7ffccdc2b5b8, rGuard=..., rEvt=...) at include/comphelper/interfacecontainer4.hxx:397
    397                     aIt.next()->disposing(rEvt);
    (gdb) bt
    #0  0x00007fd754ae6fe9 in comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>::disposeAndClear(std::unique_lock<std::mutex>&, com::sun::star::lang::EventObject const&)
        (this=0x7ffccdc2b5b8, rGuard=..., rEvt=...) at include/comphelper/interfacecontainer4.hxx:397
    #1  0x00007fd754ae6014 in comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing(unsigned int, com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&)
        (_nClient=28, _rxEventSource=uno::Reference to (accessibility::AccessibleListBox *) 0x55bf49c0ad00) at .../libreoffice/comphelper/source/misc/accessibleeventnotifier.cxx:204
    #2  0x00007fd754ae1424 in comphelper::OCommonAccessibleComponent::disposing() (this=0x55bf49c0ad00) at .../libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:61
    #3  0x00007fd74e884512 in VCLXAccessibleComponent::disposing() (this=0x55bf49c0ad00) at .../libreoffice/toolkit/source/awt/vclxaccessiblecomponent.cxx:376
    #4  0x00007fd6a3d506b7 in accessibility::AccessibleListBox::disposing() (this=0x55bf49c0ad00) at .../libreoffice/accessibility/source/extended/accessiblelistbox.cxx:246
    #5  0x00007fd75453f544 in cppu::WeakComponentImplHelperBase::dispose() (this=0x55bf49c0ad00) at .../libreoffice/cppuhelper/source/implbase.cxx:104
    #6  0x00007fd6a3d45fd5 in cppu::PartialWeakComponentImplHelper<com::sun::star::accessibility::XAccessibleContext2, com::sun::star::accessibility::XAccessibleEventBroadcaster>::dispose() (this=0x55bf49c0ad00)
        at include/cppuhelper/compbase.hxx:90
    #7  0x00007fd75453f1fe in cppu::WeakComponentImplHelperBase::release() (this=0x55bf49c0ad00) at .../libreoffice/cppuhelper/source/implbase.cxx:79
    #8  0x00007fd6a3d47d85 in cppu::PartialWeakComponentImplHelper<com::sun::star::accessibility::XAccessibleContext2, com::sun::star::accessibility::XAccessibleEventBroadcaster>::release() (this=0x55bf49c0ad00)
        at include/cppuhelper/compbase.hxx:86
    #9  0x00007fd6a3d47ca5 in cppu::ImplInheritanceHelper<comphelper::OCommonAccessibleComponent, com::sun::star::accessibility::XAccessibleExtendedComponent>::release() (this=0x55bf49c0ad00) at include/cppuhelper/implbase.hxx:171
    #10 0x00007fd6a3d47c85 in cppu::ImplInheritanceHelper<comphelper::OAccessibleExtendedComponentHelper, com::sun::star::lang::XServiceInfo>::release() (this=0x55bf49c0ad00) at include/cppuhelper/implbase.hxx:171
    #11 0x00007fd6a3d45f55 in cppu::ImplInheritanceHelper<VCLXAccessibleComponent, com::sun::star::accessibility::XAccessible, com::sun::star::accessibility::XAccessibleSelection>::release() (this=0x55bf49c0ad00)
        at include/cppuhelper/implbase.hxx:171
    #12 0x00007fd74282e13e in com::sun::star::uno::Reference<com::sun::star::uno::XInterface>::~Reference() (this=0x55bf49c0e860) at include/com/sun/star/uno/Reference.hxx:114
    #13 0x00007fd7428524c5 in std::destroy_at<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*) (__location=0x55bf49c0e860)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:88
    #14 0x00007fd7428524a5 in std::_Destroy<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*) (__pointer=0x55bf49c0e860)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:149
    #15 0x00007fd742852477 in std::_Destroy_aux<false>::__destroy<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*, com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*) (__first=0x55bf49c0e860, __last=0x55bf49c0e868) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:163
    #16 0x00007fd74285243d in std::_Destroy<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*, com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*) (__first=0x55bf49c0e860, __last=0x55bf49c0e868) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:195
    #17 0x00007fd742852379 in std::_Destroy<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*, com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*, com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*, std::allocator<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >&) (__first=0x55bf49c0e860, __last=0x55bf49c0e868)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/alloc_traits.h:948
    #18 std::__cxx1998::vector<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>, std::allocator<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> > >::~vector() (this=0x55bf4d1120f8)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_vector.h:732
    #19 0x00007fd74285231d in std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>, std::allocator<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> > >::~vector() (this=0x55bf4d1120e0)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/debug/vector:230
    #20 0x00007fd7428522f5 in o3tl::sorted_vector<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>, std::less<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >, o3tl::find_unique>::~sorted_vector()
        (this=0x55bf4d1120e0) at include/o3tl/sorted_vector.hxx:47
    #21 0x00007fd74284f83d in DocumentFocusListener::~DocumentFocusListener() (this=0x55bf4d1120b0) at vcl/inc/unx/gtk/gtkdata.hxx:221
    #22 0x00007fd74284f869 in DocumentFocusListener::~DocumentFocusListener() (this=0x55bf4d1120b0) at vcl/inc/unx/gtk/gtkdata.hxx:221
    #23 0x00007fd7546453a0 in cppu::OWeakObject::release() (this=0x55bf4d1120b0) at .../libreoffice/cppuhelper/source/weak.cxx:230
    #24 0x00007fd742834415 in cppu::WeakImplHelper<com::sun::star::accessibility::XAccessibleEventListener>::release() (this=0x55bf4d1120b0) at include/cppuhelper/implbase.hxx:115
    #25 0x00007fd754aec91e in com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>::~Reference() (this=0x55bf4896c088) at include/com/sun/star/uno/Reference.hxx:114
    #26 0x00007fd754aec8e5 in std::destroy_at<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> >(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*)
        (__location=0x55bf4896c088) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:88
    #27 0x00007fd754aec8c5 in std::_Destroy<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> >(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*)
        (__pointer=0x55bf4896c088) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:149
    #28 0x00007fd754aec897 in std::_Destroy_aux<false>::__destroy<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*>(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*, com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*) (__first=0x55bf4896c088, __last=0x55bf4896c090)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:163
    #29 0x00007fd754aec85d in std::_Destroy<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*>(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*, com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*) (__first=0x55bf4896c080, __last=0x55bf4896c090) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:195
    #30 0x00007fd754aec799 in std::_Destroy<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*, com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> >(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*, com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> >&) (__first=0x55bf4896c080, __last=0x55bf4896c090) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/alloc_traits.h:948
    --Type <RET> for more, q to quit, c to continue without paging--
    #31 std::__cxx1998::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> > >::~vector()
        (this=0x55bf49866bc8) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_vector.h:732
    #32 0x00007fd754aec73d in std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> > >::~vector() (this=0x55bf49866bb0) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/debug/vector:230
    #33 0x00007fd754aec715 in o3tl::cow_wrapper<std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> > >, o3tl::ThreadSafeRefCountingPolicy>::impl_t::~impl_t() (this=0x55bf49866bb0) at include/o3tl/cow_wrapper.hxx:176
    #34 0x00007fd754aec6e4 in o3tl::cow_wrapper<std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> > >, o3tl::ThreadSafeRefCountingPolicy>::release() (this=0x55bf49b28380) at include/o3tl/cow_wrapper.hxx:207
    #35 0x00007fd754aec675 in o3tl::cow_wrapper<std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> > >, o3tl::ThreadSafeRefCountingPolicy>::~cow_wrapper() (this=0x55bf49b28380) at include/o3tl/cow_wrapper.hxx:271
    #36 0x00007fd754ae6ae5 in comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>::~OInterfaceContainerHelper4() (this=0x55bf49b28380) at include/comphelper/interfacecontainer4.hxx:126
    #37 0x00007fd754ae7c49 in std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >::~pair() (this=0x55bf49b28378)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_pair.h:187
    #38 0x00007fd754ae7c25 in std::destroy_at<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> > >(std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >*) (__location=0x55bf49b28378) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:88
    #39 0x00007fd754ae7b4b in std::allocator_traits<std::allocator<std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false> > >::destroy<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> > >(std::allocator<std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false> >&, std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >*)
        (__a=..., __p=0x55bf49b28378) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/alloc_traits.h:560
    #40 std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false> > >::_M_deallocate_node(std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false>*)
        (this=0x7fd754d2aaa8 <(anonymous namespace)::gaClients+40>, __n=0x55bf49b28370) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable_policy.h:2011
    #41 0x00007fd754ae7ab5 in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false> > >::_M_deallocate_nodes(std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false>*)
        (this=0x7fd754d2aaa8 <(anonymous namespace)::gaClients+40>, __n=0x0) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable_policy.h:2033
    #42 0x00007fd754ae79df in std::_Hashtable<unsigned int, std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, std::allocator<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> > >, std::__detail::_Select1st, std::equal_to<unsigned int>, std::hash<unsigned int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::clear() (this=0x7fd754d2aaa8 <(anonymous namespace)::gaClients+40>)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable.h:2524
    #43 0x00007fd754af6415 in std::__cxx1998::unordered_map<unsigned int, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> > > >::clear() (this=0x7fd754d2aaa8 <(anonymous namespace)::gaClients+40>)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/unordered_map.h:798
    #44 0x00007fd754ae778d in std::__debug::unordered_map<unsigned int, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> > > >::clear() (this=0x7fd754d2aa80 <(anonymous namespace)::gaClients>)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/debug/unordered_map:234
    #45 0x00007fd754ae6640 in comphelper::AccessibleEventNotifier::shutdown() () at .../libreoffice/comphelper/source/misc/accessibleeventnotifier.cxx:268
    #46 0x00007fd74d3c5e41 in DeInitVCL() () at .../libreoffice/vcl/source/app/svmain.cxx:619
    #47 0x00007fd74d3c4031 in ImplSVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:254
    #48 0x00007fd74d3c5f79 in SVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:261
    #49 0x00007fd7565a4ba3 in soffice_main() () at .../libreoffice/desktop/source/app/sofficemain.cxx:94
    #50 0x000055bf472e7a5d in sal_main () at .../libreoffice/desktop/source/app/main.c:51
    #51 0x000055bf472e7a37 in main (argc=3, argv=0x7ffccdc2c9a8) at .../libreoffice/desktop/source/app/main.c:49

Change-Id: I251b2f97184e0492f02eb772e5906847f9249506
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164090
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
(cherry picked from commit 2ea7cdf9876ce2de61458982247ab6861e1aac2f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163988
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
tdf-gerrit pushed a commit that referenced this pull request Feb 29, 2024
`Window::dispose` takes care of disposing its
accessible as well.

However, `VCLXWindow::dispose` was explicitly unsetting
the accessible before disposing its `vcl::Window`, resulting
in it not getting disposed, in turn resulting in a crash on exit
for the tdf#159735 case.

Potentially related:

    commit 5aa60be
    Date:   Wed May 12 11:33:06 2021 +0200

        fix leak in VCLXWindow

        which is a little tricky because dispose() can be called from either
        side (vcl::Window or VCLXWindow)

Before that commit, setting a nullptr accessible happened
in the `VCLXWindow` dtor, which is meant to get called after
the `vcl::Window` got disposed in `VCLXWindow::dispose`.
(In the Linux bibisect repo, the commit before that one is fine
and at that commit, the tdf#159735 comment 5 scenario even
crashes in step 3 already.)

Don't unset the `vcl::Window`'s accessible any more in
`VCLXWindow::dispose`, but do that after disposing it in
`vcl::Window::dispose` instead, which seems to be the
natural place to do that anyway.

Backtrace of crash:

    Thread 1 received signal SIGSEGV, Segmentation fault.
    0x00007fd754ae6fe9 in comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>::disposeAndClear (this=0x7ffccdc2b5b8, rGuard=..., rEvt=...) at include/comphelper/interfacecontainer4.hxx:397
    397                     aIt.next()->disposing(rEvt);
    (gdb) bt
    #0  0x00007fd754ae6fe9 in comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>::disposeAndClear(std::unique_lock<std::mutex>&, com::sun::star::lang::EventObject const&)
        (this=0x7ffccdc2b5b8, rGuard=..., rEvt=...) at include/comphelper/interfacecontainer4.hxx:397
    #1  0x00007fd754ae6014 in comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing(unsigned int, com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&)
        (_nClient=28, _rxEventSource=uno::Reference to (accessibility::AccessibleListBox *) 0x55bf49c0ad00) at .../libreoffice/comphelper/source/misc/accessibleeventnotifier.cxx:204
    #2  0x00007fd754ae1424 in comphelper::OCommonAccessibleComponent::disposing() (this=0x55bf49c0ad00) at .../libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:61
    #3  0x00007fd74e884512 in VCLXAccessibleComponent::disposing() (this=0x55bf49c0ad00) at .../libreoffice/toolkit/source/awt/vclxaccessiblecomponent.cxx:376
    #4  0x00007fd6a3d506b7 in accessibility::AccessibleListBox::disposing() (this=0x55bf49c0ad00) at .../libreoffice/accessibility/source/extended/accessiblelistbox.cxx:246
    #5  0x00007fd75453f544 in cppu::WeakComponentImplHelperBase::dispose() (this=0x55bf49c0ad00) at .../libreoffice/cppuhelper/source/implbase.cxx:104
    #6  0x00007fd6a3d45fd5 in cppu::PartialWeakComponentImplHelper<com::sun::star::accessibility::XAccessibleContext2, com::sun::star::accessibility::XAccessibleEventBroadcaster>::dispose() (this=0x55bf49c0ad00)
        at include/cppuhelper/compbase.hxx:90
    #7  0x00007fd75453f1fe in cppu::WeakComponentImplHelperBase::release() (this=0x55bf49c0ad00) at .../libreoffice/cppuhelper/source/implbase.cxx:79
    #8  0x00007fd6a3d47d85 in cppu::PartialWeakComponentImplHelper<com::sun::star::accessibility::XAccessibleContext2, com::sun::star::accessibility::XAccessibleEventBroadcaster>::release() (this=0x55bf49c0ad00)
        at include/cppuhelper/compbase.hxx:86
    #9  0x00007fd6a3d47ca5 in cppu::ImplInheritanceHelper<comphelper::OCommonAccessibleComponent, com::sun::star::accessibility::XAccessibleExtendedComponent>::release() (this=0x55bf49c0ad00) at include/cppuhelper/implbase.hxx:171
    #10 0x00007fd6a3d47c85 in cppu::ImplInheritanceHelper<comphelper::OAccessibleExtendedComponentHelper, com::sun::star::lang::XServiceInfo>::release() (this=0x55bf49c0ad00) at include/cppuhelper/implbase.hxx:171
    #11 0x00007fd6a3d45f55 in cppu::ImplInheritanceHelper<VCLXAccessibleComponent, com::sun::star::accessibility::XAccessible, com::sun::star::accessibility::XAccessibleSelection>::release() (this=0x55bf49c0ad00)
        at include/cppuhelper/implbase.hxx:171
    #12 0x00007fd74282e13e in com::sun::star::uno::Reference<com::sun::star::uno::XInterface>::~Reference() (this=0x55bf49c0e860) at include/com/sun/star/uno/Reference.hxx:114
    #13 0x00007fd7428524c5 in std::destroy_at<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*) (__location=0x55bf49c0e860)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:88
    #14 0x00007fd7428524a5 in std::_Destroy<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*) (__pointer=0x55bf49c0e860)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:149
    #15 0x00007fd742852477 in std::_Destroy_aux<false>::__destroy<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*, com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*) (__first=0x55bf49c0e860, __last=0x55bf49c0e868) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:163
    #16 0x00007fd74285243d in std::_Destroy<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*, com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*) (__first=0x55bf49c0e860, __last=0x55bf49c0e868) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:195
    #17 0x00007fd742852379 in std::_Destroy<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*, com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*, com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*, std::allocator<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >&) (__first=0x55bf49c0e860, __last=0x55bf49c0e868)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/alloc_traits.h:948
    #18 std::__cxx1998::vector<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>, std::allocator<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> > >::~vector() (this=0x55bf4d1120f8)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_vector.h:732
    #19 0x00007fd74285231d in std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>, std::allocator<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> > >::~vector() (this=0x55bf4d1120e0)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/debug/vector:230
    #20 0x00007fd7428522f5 in o3tl::sorted_vector<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>, std::less<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >, o3tl::find_unique>::~sorted_vector()
        (this=0x55bf4d1120e0) at include/o3tl/sorted_vector.hxx:47
    #21 0x00007fd74284f83d in DocumentFocusListener::~DocumentFocusListener() (this=0x55bf4d1120b0) at vcl/inc/unx/gtk/gtkdata.hxx:221
    #22 0x00007fd74284f869 in DocumentFocusListener::~DocumentFocusListener() (this=0x55bf4d1120b0) at vcl/inc/unx/gtk/gtkdata.hxx:221
    #23 0x00007fd7546453a0 in cppu::OWeakObject::release() (this=0x55bf4d1120b0) at .../libreoffice/cppuhelper/source/weak.cxx:230
    #24 0x00007fd742834415 in cppu::WeakImplHelper<com::sun::star::accessibility::XAccessibleEventListener>::release() (this=0x55bf4d1120b0) at include/cppuhelper/implbase.hxx:115
    #25 0x00007fd754aec91e in com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>::~Reference() (this=0x55bf4896c088) at include/com/sun/star/uno/Reference.hxx:114
    #26 0x00007fd754aec8e5 in std::destroy_at<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> >(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*)
        (__location=0x55bf4896c088) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:88
    #27 0x00007fd754aec8c5 in std::_Destroy<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> >(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*)
        (__pointer=0x55bf4896c088) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:149
    #28 0x00007fd754aec897 in std::_Destroy_aux<false>::__destroy<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*>(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*, com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*) (__first=0x55bf4896c088, __last=0x55bf4896c090)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:163
    #29 0x00007fd754aec85d in std::_Destroy<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*>(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*, com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*) (__first=0x55bf4896c080, __last=0x55bf4896c090) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:195
    #30 0x00007fd754aec799 in std::_Destroy<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*, com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> >(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*, com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> >&) (__first=0x55bf4896c080, __last=0x55bf4896c090) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/alloc_traits.h:948
    --Type <RET> for more, q to quit, c to continue without paging--
    #31 std::__cxx1998::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> > >::~vector()
        (this=0x55bf49866bc8) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_vector.h:732
    #32 0x00007fd754aec73d in std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> > >::~vector() (this=0x55bf49866bb0) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/debug/vector:230
    #33 0x00007fd754aec715 in o3tl::cow_wrapper<std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> > >, o3tl::ThreadSafeRefCountingPolicy>::impl_t::~impl_t() (this=0x55bf49866bb0) at include/o3tl/cow_wrapper.hxx:176
    #34 0x00007fd754aec6e4 in o3tl::cow_wrapper<std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> > >, o3tl::ThreadSafeRefCountingPolicy>::release() (this=0x55bf49b28380) at include/o3tl/cow_wrapper.hxx:207
    #35 0x00007fd754aec675 in o3tl::cow_wrapper<std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> > >, o3tl::ThreadSafeRefCountingPolicy>::~cow_wrapper() (this=0x55bf49b28380) at include/o3tl/cow_wrapper.hxx:271
    #36 0x00007fd754ae6ae5 in comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>::~OInterfaceContainerHelper4() (this=0x55bf49b28380) at include/comphelper/interfacecontainer4.hxx:126
    #37 0x00007fd754ae7c49 in std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >::~pair() (this=0x55bf49b28378)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_pair.h:187
    #38 0x00007fd754ae7c25 in std::destroy_at<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> > >(std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >*) (__location=0x55bf49b28378) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:88
    #39 0x00007fd754ae7b4b in std::allocator_traits<std::allocator<std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false> > >::destroy<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> > >(std::allocator<std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false> >&, std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >*)
        (__a=..., __p=0x55bf49b28378) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/alloc_traits.h:560
    #40 std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false> > >::_M_deallocate_node(std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false>*)
        (this=0x7fd754d2aaa8 <(anonymous namespace)::gaClients+40>, __n=0x55bf49b28370) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable_policy.h:2011
    #41 0x00007fd754ae7ab5 in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false> > >::_M_deallocate_nodes(std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false>*)
        (this=0x7fd754d2aaa8 <(anonymous namespace)::gaClients+40>, __n=0x0) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable_policy.h:2033
    #42 0x00007fd754ae79df in std::_Hashtable<unsigned int, std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, std::allocator<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> > >, std::__detail::_Select1st, std::equal_to<unsigned int>, std::hash<unsigned int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::clear() (this=0x7fd754d2aaa8 <(anonymous namespace)::gaClients+40>)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable.h:2524
    #43 0x00007fd754af6415 in std::__cxx1998::unordered_map<unsigned int, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> > > >::clear() (this=0x7fd754d2aaa8 <(anonymous namespace)::gaClients+40>)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/unordered_map.h:798
    #44 0x00007fd754ae778d in std::__debug::unordered_map<unsigned int, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> > > >::clear() (this=0x7fd754d2aa80 <(anonymous namespace)::gaClients>)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/debug/unordered_map:234
    #45 0x00007fd754ae6640 in comphelper::AccessibleEventNotifier::shutdown() () at .../libreoffice/comphelper/source/misc/accessibleeventnotifier.cxx:268
    #46 0x00007fd74d3c5e41 in DeInitVCL() () at .../libreoffice/vcl/source/app/svmain.cxx:619
    #47 0x00007fd74d3c4031 in ImplSVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:254
    #48 0x00007fd74d3c5f79 in SVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:261
    #49 0x00007fd7565a4ba3 in soffice_main() () at .../libreoffice/desktop/source/app/sofficemain.cxx:94
    #50 0x000055bf472e7a5d in sal_main () at .../libreoffice/desktop/source/app/main.c:51
    #51 0x000055bf472e7a37 in main (argc=3, argv=0x7ffccdc2c9a8) at .../libreoffice/desktop/source/app/main.c:49

Change-Id: I251b2f97184e0492f02eb772e5906847f9249506
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164090
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
(cherry picked from commit 2ea7cdf9876ce2de61458982247ab6861e1aac2f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164113
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
tdf-gerrit pushed a commit that referenced this pull request Mar 7, 2024
`Window::dispose` takes care of disposing its
accessible as well.

However, `VCLXWindow::dispose` was explicitly unsetting
the accessible before disposing its `vcl::Window`, resulting
in it not getting disposed, in turn resulting in a crash on exit
for the tdf#159735 case.

Potentially related:

    commit 5aa60be
    Date:   Wed May 12 11:33:06 2021 +0200

        fix leak in VCLXWindow

        which is a little tricky because dispose() can be called from either
        side (vcl::Window or VCLXWindow)

Before that commit, setting a nullptr accessible happened
in the `VCLXWindow` dtor, which is meant to get called after
the `vcl::Window` got disposed in `VCLXWindow::dispose`.
(In the Linux bibisect repo, the commit before that one is fine
and at that commit, the tdf#159735 comment 5 scenario even
crashes in step 3 already.)

Don't unset the `vcl::Window`'s accessible any more in
`VCLXWindow::dispose`, but do that after disposing it in
`vcl::Window::dispose` instead, which seems to be the
natural place to do that anyway.

Backtrace of crash:

    Thread 1 received signal SIGSEGV, Segmentation fault.
    0x00007fd754ae6fe9 in comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>::disposeAndClear (this=0x7ffccdc2b5b8, rGuard=..., rEvt=...) at include/comphelper/interfacecontainer4.hxx:397
    397                     aIt.next()->disposing(rEvt);
    (gdb) bt
    #0  0x00007fd754ae6fe9 in comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>::disposeAndClear(std::unique_lock<std::mutex>&, com::sun::star::lang::EventObject const&)
        (this=0x7ffccdc2b5b8, rGuard=..., rEvt=...) at include/comphelper/interfacecontainer4.hxx:397
    #1  0x00007fd754ae6014 in comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing(unsigned int, com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&)
        (_nClient=28, _rxEventSource=uno::Reference to (accessibility::AccessibleListBox *) 0x55bf49c0ad00) at .../libreoffice/comphelper/source/misc/accessibleeventnotifier.cxx:204
    #2  0x00007fd754ae1424 in comphelper::OCommonAccessibleComponent::disposing() (this=0x55bf49c0ad00) at .../libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:61
    #3  0x00007fd74e884512 in VCLXAccessibleComponent::disposing() (this=0x55bf49c0ad00) at .../libreoffice/toolkit/source/awt/vclxaccessiblecomponent.cxx:376
    #4  0x00007fd6a3d506b7 in accessibility::AccessibleListBox::disposing() (this=0x55bf49c0ad00) at .../libreoffice/accessibility/source/extended/accessiblelistbox.cxx:246
    #5  0x00007fd75453f544 in cppu::WeakComponentImplHelperBase::dispose() (this=0x55bf49c0ad00) at .../libreoffice/cppuhelper/source/implbase.cxx:104
    #6  0x00007fd6a3d45fd5 in cppu::PartialWeakComponentImplHelper<com::sun::star::accessibility::XAccessibleContext2, com::sun::star::accessibility::XAccessibleEventBroadcaster>::dispose() (this=0x55bf49c0ad00)
        at include/cppuhelper/compbase.hxx:90
    #7  0x00007fd75453f1fe in cppu::WeakComponentImplHelperBase::release() (this=0x55bf49c0ad00) at .../libreoffice/cppuhelper/source/implbase.cxx:79
    #8  0x00007fd6a3d47d85 in cppu::PartialWeakComponentImplHelper<com::sun::star::accessibility::XAccessibleContext2, com::sun::star::accessibility::XAccessibleEventBroadcaster>::release() (this=0x55bf49c0ad00)
        at include/cppuhelper/compbase.hxx:86
    #9  0x00007fd6a3d47ca5 in cppu::ImplInheritanceHelper<comphelper::OCommonAccessibleComponent, com::sun::star::accessibility::XAccessibleExtendedComponent>::release() (this=0x55bf49c0ad00) at include/cppuhelper/implbase.hxx:171
    #10 0x00007fd6a3d47c85 in cppu::ImplInheritanceHelper<comphelper::OAccessibleExtendedComponentHelper, com::sun::star::lang::XServiceInfo>::release() (this=0x55bf49c0ad00) at include/cppuhelper/implbase.hxx:171
    #11 0x00007fd6a3d45f55 in cppu::ImplInheritanceHelper<VCLXAccessibleComponent, com::sun::star::accessibility::XAccessible, com::sun::star::accessibility::XAccessibleSelection>::release() (this=0x55bf49c0ad00)
        at include/cppuhelper/implbase.hxx:171
    #12 0x00007fd74282e13e in com::sun::star::uno::Reference<com::sun::star::uno::XInterface>::~Reference() (this=0x55bf49c0e860) at include/com/sun/star/uno/Reference.hxx:114
    #13 0x00007fd7428524c5 in std::destroy_at<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*) (__location=0x55bf49c0e860)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:88
    #14 0x00007fd7428524a5 in std::_Destroy<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*) (__pointer=0x55bf49c0e860)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:149
    #15 0x00007fd742852477 in std::_Destroy_aux<false>::__destroy<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*, com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*) (__first=0x55bf49c0e860, __last=0x55bf49c0e868) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:163
    #16 0x00007fd74285243d in std::_Destroy<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*, com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*) (__first=0x55bf49c0e860, __last=0x55bf49c0e868) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:195
    #17 0x00007fd742852379 in std::_Destroy<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*, com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*, com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*, std::allocator<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >&) (__first=0x55bf49c0e860, __last=0x55bf49c0e868)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/alloc_traits.h:948
    #18 std::__cxx1998::vector<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>, std::allocator<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> > >::~vector() (this=0x55bf4d1120f8)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_vector.h:732
    #19 0x00007fd74285231d in std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>, std::allocator<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> > >::~vector() (this=0x55bf4d1120e0)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/debug/vector:230
    #20 0x00007fd7428522f5 in o3tl::sorted_vector<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>, std::less<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >, o3tl::find_unique>::~sorted_vector()
        (this=0x55bf4d1120e0) at include/o3tl/sorted_vector.hxx:47
    #21 0x00007fd74284f83d in DocumentFocusListener::~DocumentFocusListener() (this=0x55bf4d1120b0) at vcl/inc/unx/gtk/gtkdata.hxx:221
    #22 0x00007fd74284f869 in DocumentFocusListener::~DocumentFocusListener() (this=0x55bf4d1120b0) at vcl/inc/unx/gtk/gtkdata.hxx:221
    #23 0x00007fd7546453a0 in cppu::OWeakObject::release() (this=0x55bf4d1120b0) at .../libreoffice/cppuhelper/source/weak.cxx:230
    #24 0x00007fd742834415 in cppu::WeakImplHelper<com::sun::star::accessibility::XAccessibleEventListener>::release() (this=0x55bf4d1120b0) at include/cppuhelper/implbase.hxx:115
    #25 0x00007fd754aec91e in com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>::~Reference() (this=0x55bf4896c088) at include/com/sun/star/uno/Reference.hxx:114
    #26 0x00007fd754aec8e5 in std::destroy_at<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> >(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*)
        (__location=0x55bf4896c088) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:88
    #27 0x00007fd754aec8c5 in std::_Destroy<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> >(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*)
        (__pointer=0x55bf4896c088) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:149
    #28 0x00007fd754aec897 in std::_Destroy_aux<false>::__destroy<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*>(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*, com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*) (__first=0x55bf4896c088, __last=0x55bf4896c090)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:163
    #29 0x00007fd754aec85d in std::_Destroy<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*>(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*, com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*) (__first=0x55bf4896c080, __last=0x55bf4896c090) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:195
    #30 0x00007fd754aec799 in std::_Destroy<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*, com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> >(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*, com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>*, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> >&) (__first=0x55bf4896c080, __last=0x55bf4896c090) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/alloc_traits.h:948
    --Type <RET> for more, q to quit, c to continue without paging--
    #31 std::__cxx1998::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> > >::~vector()
        (this=0x55bf49866bc8) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_vector.h:732
    #32 0x00007fd754aec73d in std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> > >::~vector() (this=0x55bf49866bb0) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/debug/vector:230
    #33 0x00007fd754aec715 in o3tl::cow_wrapper<std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> > >, o3tl::ThreadSafeRefCountingPolicy>::impl_t::~impl_t() (this=0x55bf49866bb0) at include/o3tl/cow_wrapper.hxx:176
    #34 0x00007fd754aec6e4 in o3tl::cow_wrapper<std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> > >, o3tl::ThreadSafeRefCountingPolicy>::release() (this=0x55bf49b28380) at include/o3tl/cow_wrapper.hxx:207
    #35 0x00007fd754aec675 in o3tl::cow_wrapper<std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener>, std::allocator<com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEventListener> > >, o3tl::ThreadSafeRefCountingPolicy>::~cow_wrapper() (this=0x55bf49b28380) at include/o3tl/cow_wrapper.hxx:271
    #36 0x00007fd754ae6ae5 in comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>::~OInterfaceContainerHelper4() (this=0x55bf49b28380) at include/comphelper/interfacecontainer4.hxx:126
    #37 0x00007fd754ae7c49 in std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >::~pair() (this=0x55bf49b28378)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_pair.h:187
    #38 0x00007fd754ae7c25 in std::destroy_at<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> > >(std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >*) (__location=0x55bf49b28378) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:88
    #39 0x00007fd754ae7b4b in std::allocator_traits<std::allocator<std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false> > >::destroy<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> > >(std::allocator<std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false> >&, std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >*)
        (__a=..., __p=0x55bf49b28378) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/alloc_traits.h:560
    #40 std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false> > >::_M_deallocate_node(std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false>*)
        (this=0x7fd754d2aaa8 <(anonymous namespace)::gaClients+40>, __n=0x55bf49b28370) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable_policy.h:2011
    #41 0x00007fd754ae7ab5 in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false> > >::_M_deallocate_nodes(std::__detail::_Hash_node<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, false>*)
        (this=0x7fd754d2aaa8 <(anonymous namespace)::gaClients+40>, __n=0x0) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable_policy.h:2033
    #42 0x00007fd754ae79df in std::_Hashtable<unsigned int, std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> >, std::allocator<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> > >, std::__detail::_Select1st, std::equal_to<unsigned int>, std::hash<unsigned int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::clear() (this=0x7fd754d2aaa8 <(anonymous namespace)::gaClients+40>)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/hashtable.h:2524
    #43 0x00007fd754af6415 in std::__cxx1998::unordered_map<unsigned int, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> > > >::clear() (this=0x7fd754d2aaa8 <(anonymous namespace)::gaClients+40>)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/unordered_map.h:798
    #44 0x00007fd754ae778d in std::__debug::unordered_map<unsigned int, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener>, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, comphelper::OInterfaceContainerHelper4<com::sun::star::accessibility::XAccessibleEventListener> > > >::clear() (this=0x7fd754d2aa80 <(anonymous namespace)::gaClients>)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/debug/unordered_map:234
    #45 0x00007fd754ae6640 in comphelper::AccessibleEventNotifier::shutdown() () at .../libreoffice/comphelper/source/misc/accessibleeventnotifier.cxx:268
    #46 0x00007fd74d3c5e41 in DeInitVCL() () at .../libreoffice/vcl/source/app/svmain.cxx:619
    #47 0x00007fd74d3c4031 in ImplSVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:254
    #48 0x00007fd74d3c5f79 in SVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:261
    #49 0x00007fd7565a4ba3 in soffice_main() () at .../libreoffice/desktop/source/app/sofficemain.cxx:94
    #50 0x000055bf472e7a5d in sal_main () at .../libreoffice/desktop/source/app/main.c:51
    #51 0x000055bf472e7a37 in main (argc=3, argv=0x7ffccdc2c9a8) at .../libreoffice/desktop/source/app/main.c:49

Change-Id: I251b2f97184e0492f02eb772e5906847f9249506
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164090
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
(cherry picked from commit 2ea7cdf9876ce2de61458982247ab6861e1aac2f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163988
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
tdf-gerrit pushed a commit that referenced this pull request Mar 28, 2024
Seems to be timing dependent, does not always happen.

Stack:
 #0 sal::backtrace_get(unsigned int) at sal/osl/unx/backtraceapi.cxx:42 (discriminator 1)
 #1 (anonymous namespace)::printStack(int) at sal/osl/unx/signal.cxx:289
 #2 (anonymous namespace)::callSystemHandler(int, siginfo_t*, void*) at sal/osl/unx/signal.cxx:330
 #3 (anonymous namespace)::signalHandlerFunction(int, siginfo_t*, void*) at sal/osl/unx/signal.cxx:427
 #4 __restore_rt at libc_sigaction.c:?
 #5 std::__uniq_ptr_impl<weld::ComboBox, std::default_delete<weld::ComboBox> >::_M_ptr() const at /usr/include/c++/13/bits/unique_ptr.h:199 (discriminator 1)
 #6 std::unique_ptr<weld::ComboBox, std::default_delete<weld::ComboBox> >::get() const at /usr/include/c++/13/bits/unique_ptr.h:470
 #7 std::unique_ptr<weld::ComboBox, std::default_delete<weld::ComboBox> >::operator->() const at /usr/include/c++/13/bits/unique_ptr.h:464
 #8 SvxTPFilter::GetSelectedAuthor() const at svx/source/dialog/ctredlin.cxx:636 (discriminator 1)
 #9 SwRedlineAcceptDlg::InitAuthors() at sw/source/uibase/misc/redlndlg.cxx:256
 #10 SwRedlineAcceptDlg::Activate() at sw/source/uibase/misc/redlndlg.cxx:492
 #11 SwModelessRedlineAcceptDlg::Activate() at sw/source/uibase/misc/redlndlg.cxx:123
 #12 SfxDialogController::FocusChangeHdl(weld::Container&) at sfx2/source/dialog/basedlgs.cxx:117
 #13 SfxDialogController::LinkStubFocusChangeHdl(void*, weld::Container&) at sfx2/source/dialog/basedlgs.cxx:111
 #14 Link<weld::Container&, void>::Call(weld::Container&) const at include/tools/link.hxx:111
 #15 weld::Container::signal_container_focus_changed() at include/vcl/weld.hxx:368
 #16 SalInstanceContainer::HandleEventListener(VclWindowEvent&) at vcl/source/app/salvtables.cxx:1328
 #17 SalInstanceWidget::EventListener(VclWindowEvent&) at vcl/source/app/salvtables.cxx:824
 #18 SalInstanceWidget::LinkStubEventListener(void*, VclWindowEvent&) at vcl/source/app/salvtables.cxx:821
 #19 Link<VclWindowEvent&, void>::Call(VclWindowEvent&) const at include/tools/link.hxx:111
 #20 vcl::Window::CallEventListeners(VclEventId, void*) at vcl/source/window/event.cxx:257 (discriminator 2)
 #21 vcl::Window::ImplCallActivateListeners(vcl::Window*) at vcl/source/window/window.cxx:3438
 #22 vcl::Window::ImplCallActivateListeners(vcl::Window*) at vcl/source/window/window.cxx:3442 (discriminator 1)
 #23 vcl::Window::ImplCallActivateListeners(vcl::Window*) at vcl/source/window/window.cxx:3442 (discriminator 1)
 #24 vcl::Window::ImplCallActivateListeners(vcl::Window*) at vcl/source/window/window.cxx:3442 (discriminator 1)
 #25 vcl::Window::ImplCallActivateListeners(vcl::Window*) at vcl/source/window/window.cxx:3442 (discriminator 1)
 #26 vcl::Window::ImplCallActivateListeners(vcl::Window*) at vcl/source/window/window.cxx:3442 (discriminator 1)
 #27 vcl::Window::ImplCallActivateListeners(vcl::Window*) at vcl/source/window/window.cxx:3442 (discriminator 1)
 #28 vcl::Window::ImplCallActivateListeners(vcl::Window*) at vcl/source/window/window.cxx:3442 (discriminator 1)
 #29 vcl::Window::ImplGrabFocus(GetFocusFlags) at vcl/source/window/mouse.cxx:386 (discriminator 15)
 #30 vcl::Window::GrabFocus() at vcl/source/window/window.cxx:2989
 #31 vcl::Window::dispose() at vcl/source/window/window.cxx:433
 #32 Control::dispose() at vcl/source/control/ctrl.cxx:66
 #33 SvTreeListBox::dispose() at vcl/source/treelist/treelistbox.cxx:1341
 #34 SvTabListBox::dispose() at vcl/source/treelist/svtabbx.cxx:244
 #35 SvHeaderTabListBox::dispose() at vcl/source/treelist/svtabbx.cxx:529
 #36 VclReferenceBase::disposeOnce() at vcl/source/outdev/vclreferencebase.cxx:38
 #37 VclPtr<vcl::Window>::disposeAndClear() at include/vcl/vclptr.hxx:209
 #38 VclBuilder::disposeBuilder() at vcl/source/window/builder.cxx:810 (discriminator 2)
 #39 VclBuilder::~VclBuilder() at vcl/source/window/builder.cxx:805
 #40 std::default_delete<VclBuilder>::operator()(VclBuilder*) const at /usr/include/c++/13/bits/unique_ptr.h:99 (discriminator 1)
 #41 std::__uniq_ptr_impl<VclBuilder, std::default_delete<VclBuilder> >::reset(VclBuilder*) at /usr/include/c++/13/bits/unique_ptr.h:212
 #42 std::unique_ptr<VclBuilder, std::default_delete<VclBuilder> >::reset(VclBuilder*) at /usr/include/c++/13/bits/unique_ptr.h:510
 #43 SalInstanceBuilder::~SalInstanceBuilder() at vcl/source/app/salvtables.cxx:7456
 #44 SalInstanceBuilder::~SalInstanceBuilder() at vcl/source/app/salvtables.cxx:7457 (discriminator 1)
 #45 std::default_delete<weld::Builder>::operator()(weld::Builder*) const at /usr/include/c++/13/bits/unique_ptr.h:100
 #46 std::unique_ptr<weld::Builder, std::default_delete<weld::Builder> >::~unique_ptr() at /usr/include/c++/13/bits/unique_ptr.h:405
 #47 SvxTPage::~SvxTPage() at svx/source/dialog/ctredlin.cxx:289
 #48 SvxTPView::~SvxTPView() at svx/source/dialog/ctredlin.cxx:341
 #49 SvxTPView::~SvxTPView() at svx/source/dialog/ctredlin.cxx:341 (discriminator 1)
 #50 std::default_delete<SvxTPView>::operator()(SvxTPView*) const at /usr/include/c++/13/bits/unique_ptr.h:100
 #51 std::__uniq_ptr_impl<SvxTPView, std::default_delete<SvxTPView> >::reset(SvxTPView*) at /usr/include/c++/13/bits/unique_ptr.h:212
 #52 std::unique_ptr<SvxTPView, std::default_delete<SvxTPView> >::reset(SvxTPView*) at /usr/include/c++/13/bits/unique_ptr.h:510
 #53 SvxAcceptChgCtr::~SvxAcceptChgCtr() at svx/source/dialog/ctredlin.cxx:972
 #54 std::default_delete<SvxAcceptChgCtr>::operator()(SvxAcceptChgCtr*) const at /usr/include/c++/13/bits/unique_ptr.h:99 (discriminator 1)
 #55 std::unique_ptr<SvxAcceptChgCtr, std::default_delete<SvxAcceptChgCtr> >::~unique_ptr() at /usr/include/c++/13/bits/unique_ptr.h:405
 #56 SwRedlineAcceptDlg::~SwRedlineAcceptDlg() at sw/source/uibase/misc/redlndlg.cxx:210 (discriminator 3)
 #57 std::default_delete<SwRedlineAcceptDlg>::operator()(SwRedlineAcceptDlg*) const at /usr/include/c++/13/bits/unique_ptr.h:99 (discriminator 1)
 #58 std::unique_ptr<SwRedlineAcceptDlg, std::default_delete<SwRedlineAcceptDlg> >::~unique_ptr() at /usr/include/c++/13/bits/unique_ptr.h:405
 #59 SwModelessRedlineAcceptDlg::~SwModelessRedlineAcceptDlg() at sw/source/uibase/misc/redlndlg.cxx:141 (discriminator 1)
 #60 void std::destroy_at<SwModelessRedlineAcceptDlg>(SwModelessRedlineAcceptDlg*) at /usr/include/c++/13/bits/stl_construct.h:89
 #61 void std::_Destroy<SwModelessRedlineAcceptDlg>(SwModelessRedlineAcceptDlg*) at /usr/include/c++/13/bits/stl_construct.h:153
 #62 std::_Sp_counted_ptr_inplace<SwModelessRedlineAcceptDlg, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() at /usr/include/c++/13/bits/alloc_traits.h:674
 #63 std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use() at /usr/include/c++/13/bits/shared_ptr_base.h:187
 #64 std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use_cold() at /usr/include/c++/13/bits/shared_ptr_base.h:199
 #65 std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() at /usr/include/c++/13/bits/shared_ptr_base.h:354
 #66 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() at /usr/include/c++/13/bits/shared_ptr_base.h:1072
 #67 std::__shared_ptr<SfxDialogController, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() at /usr/include/c++/13/bits/shared_ptr_base.h:1524
 #68 std::__shared_ptr<SfxDialogController, (__gnu_cxx::_Lock_policy)2>::reset() at /usr/include/c++/13/bits/shared_ptr_base.h:1642
 #69 SfxChildWindow::~SfxChildWindow() at sfx2/source/appl/childwin.cxx:197
 #70 SwChildWinWrapper::~SwChildWinWrapper() at sw/source/uibase/inc/chldwrap.hxx:27
 #71 SwRedlineAcceptChild::~SwRedlineAcceptChild() at sw/source/uibase/inc/redlndlg.hxx:144
 #72 SwRedlineAcceptChild::~SwRedlineAcceptChild() at sw/source/uibase/inc/redlndlg.hxx:144 (discriminator 1)
 #73 SfxChildWindow::Destroy() at sfx2/source/appl/childwin.cxx:177
 #74 SfxWorkWindow::DeleteControllers_Impl() at sfx2/source/appl/workwin.cxx:608
 #75 SfxFrame::DoClose_Impl() at sfx2/source/view/frame.cxx:137
 #76 SfxBaseController::dispose() at sfx2/source/view/sfxbasecontroller.cxx:930
 #77 (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&) at framework/source/services/frame.cxx:1500
 #78 framework::CloseDispatcher::implts_establishBackingMode() at framework/source/dispatch/closedispatcher.cxx:536
 #79 framework::CloseDispatcher::impl_asyncCallback(LinkParamNone*) at framework/source/dispatch/closedispatcher.cxx:403 (discriminator 1)
 #80 framework::CloseDispatcher::dispatchWithNotification(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchResultListener> const&) at framework/source/dispatch/closedispatcher.cxx:222
 #81 framework::CloseDispatcher::dispatch(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/dispatch/closedispatcher.cxx:91 (discriminator 2)
 #82 comphelper::dispatchCommand(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchResultListener> const&) at comphelper/source/misc/dispatchcommand.cxx:63
 #83 comphelper::dispatchCommand(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchResultListener> const&) at comphelper/source/misc/dispatchcommand.cxx:76
 #84 UITest::executeCommand(rtl::OUString const&) at vcl/source/uitest/uitest.cxx:24 (discriminator 2)
 #85 (anonymous namespace)::UITestUnoObj::executeCommand(rtl::OUString const&) at vcl/source/uitest/uno/uitest_uno.cxx:63 (discriminator 1)
 #86 gcc3::callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, double*) at bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:87
 #87 cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void*, void**, _uno_Any**) at bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:229
 #88 unoInterfaceProxyDispatch at bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:409
 #89 binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const at binaryurp/source/incomingrequest.cxx:239
 #90 binaryurp::IncomingRequest::execute() const at binaryurp/source/incomingrequest.cxx:79 (discriminator 1)
 #91 request at binaryurp/source/reader.cxx:84
 #92 cppu_threadpool::JobQueue::enter(void const*, bool) at cppu/source/threadpool/jobqueue.cxx:101
 #93 cppu_threadpool::ORequestThread::run() at cppu/source/threadpool/thread.cxx:169
 #94 threadFunc at include/osl/thread.hxx:190
 #95 osl_thread_start_Impl(void*) at sal/osl/unx/thread.cxx:245
 #96 start_thread at ./nptl/./nptl/pthread_create.c:444
 #97 clone3 at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:80

Change-Id: I5f1db80acaf4e9a5ad642baa7061d50af071ad5e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165434
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
tdf-gerrit pushed a commit that referenced this pull request Apr 2, 2024
(tdf#160430: Fix glyph bounds calculation, and use basegfx::B2DRectangle, 2024-04-01).
As reported by Stephan in https://gerrit.libreoffice.org/c/core/+/165553/6#message-fec1e45288c0e87d43c58f777ebe51b03c534d82:

 `CppunitTest_sw_rtfexport CPPUNIT_TEST_NAME=testMathEqarray::TestBody` now fails with

  vcl/source/gdi/sallayout.cxx:245:30: runtime error: inf is outside the range of representable values of type 'long'
   #0 in SalLayout::GetBoundRect(tools::Rectangle&) const at vcl/source/gdi/sallayout.cxx:245:30
   #1 in OutputDevice::GetTextBoundRect(tools::Rectangle&, rtl::OUString const&, int, int, int, unsigned long, KernArraySpan, std::span<unsigned char const, 18446744073709551615ul>, SalLayoutGlyphs const*) const at vcl/source/outdev/text.cxx:1932:28
   #2 in (anonymous namespace)::SmGetGlyphBoundRect(OutputDevice const&, rtl::OUString const&, tools::Rectangle&) at starmath/source/rect.cxx:80:32
   #3 in SmRect::SmRect(OutputDevice const&, SmFormat const*, rtl::OUString const&, unsigned short) at starmath/source/rect.cxx:224:21
   #4 in SmMathSymbolNode::AdaptToY(OutputDevice&, unsigned long) at starmath/source/node.cxx:2122:18
   #5 in SmBraceNode::Arrange(OutputDevice&, SmFormat const&) at starmath/source/node.cxx:1340:17
   #6 in SmBinHorNode::Arrange(OutputDevice&, SmFormat const&) at starmath/source/node.cxx:816:13
   #7 in SmLineNode::Arrange(OutputDevice&, SmFormat const&) at starmath/source/node.cxx:610:20
   #8 in SmTableNode::Arrange(OutputDevice&, SmFormat const&) at starmath/source/node.cxx:534:20
   #9 in SmDocShell::ArrangeFormula() at starmath/source/document.cxx:280:13
   #10 in SmDocShell::GetSize() at starmath/source/document.cxx:405:9
   #11 in SmDocShell::Repaint() at starmath/source/document.cxx:566:21
   #12 in SmDocShell::OnDocumentPrinterChanged(Printer*) at starmath/source/document.cxx:552:5
   #13 in SmDocShell::SetText(rtl::OUString const&) at starmath/source/document.cxx:188:9
   #14 in SmDocShell::readFormulaOoxml(oox::formulaimport::XmlStream&) at starmath/source/document.cxx:848:5
   #15 in SmModel::readFormulaOoxml(oox::formulaimport::XmlStream&) at starmath/source/unomodel.cxx:1105:22
   #16 in writerfilter::rtftok::RTFDocumentImpl::beforePopState(writerfilter::rtftok::RTFParserState&) at writerfilter/source/rtftok/rtfdocumentimpl.cxx:3010:30
   #17 in writerfilter::rtftok::RTFDocumentImpl::popState() at writerfilter/source/rtftok/rtfdocumentimpl.cxx:3666:23
   #18 in writerfilter::rtftok::RTFTokenizer::resolveParse() at writerfilter/source/rtftok/rtftokenizer.cxx:114:37
   #19 in writerfilter::rtftok::RTFDocumentImpl::resolve(writerfilter::Stream&) at writerfilter/source/rtftok/rtfdocumentimpl.cxx:856:27
   #20 in (anonymous namespace)::RtfFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at writerfilter/source/filter/RtfFilter.cxx:163:20
   #21 in SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) at sfx2/source/doc/objstor.cxx:2392:34
   #22 in SfxObjectShell::DoLoad(SfxMedium*) at sfx2/source/doc/objstor.cxx:760:23
   #23 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sfx2/source/doc/sfxbasemodel.cxx:1980:36
   #24 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&) at sfx2/source/view/frmload.cxx:720:28
   #25 in framework::LoadEnv::impl_loadContent() at framework/source/loadenv/loadenv.cxx:1176:37
   #26 in framework::LoadEnv::start() at framework/source/loadenv/loadenv.cxx:412:20
   #27 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) at framework/source/loadenv/loadenv.cxx:308:5
   #28 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&) at framework/source/loadenv/loadenv.cxx:168:14
   #29 in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/services/desktop.cxx:591:16
   #30 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 framework/source/services/desktop.cxx
   #31 in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at unotest/source/cpp/macros_test.cxx:71:62
   #32 in UnoApiTest::loadWithParams(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at test/source/unoapi_test.cxx:126:19
   #33 in UnoApiTest::load(rtl::OUString const&, char const*) at test/source/unoapi_test.cxx:108:5
   #34 in SwModelTestBase::loadURL(rtl::OUString const&, char const*) at sw/qa/unit/swmodeltestbase.cxx:441:20
   #35 in SwModelTestBase::loadAndReload(char const*) at sw/qa/unit/swmodeltestbase.cxx:466:5
   #36 in (anonymous namespace)::testMathEqarray::TestBody() at sw/qa/extras/rtfexport/rtfexport.cxx:198:5

Change-Id: I857861f5bc51a1e43bfbf5e0c9dbce542d673ca7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165664
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
tdf-gerrit pushed a commit that referenced this pull request Apr 4, 2024
This reverts commit 829fa53, which started all
sorts of `make check` tests to hang for me due to a recursive locking attempt in

> #5  std::mutex::lock (this=0x7f6af81e62c0) at ~/gcc/inst/include/c++/14.0.1/bits/std_mutex.h:113
> #6  std::unique_lock<std::mutex>::lock (this=<synthetic pointer>) at ~/gcc/inst/include/c++/14.0.1/bits/unique_lock.h:147
> #7  std::unique_lock<std::mutex>::unique_lock (this=<synthetic pointer>, __m=...) at ~/gcc/inst/include/c++/14.0.1/bits/unique_lock.h:73
> #8  GrammarCheckingIterator::NextDocId (this=0x7f6af81e6260) at linguistic/source/gciterator.cxx:317
> #9  GrammarCheckingIterator::GetOrCreateDocId (this=this@entry=0x7f6af81e6260, xComponent=uno::Reference to (SwXTextDocument *) 0x7f6af8430ec8) at linguistic/source/gciterator.cxx:339
> #10 0x00007f6b3b9e9da9 in GrammarCheckingIterator::startProofreading (this=0x7f6af81e6260, xDoc=<optimized out>, xIteratorProvider=<optimized out>) at linguistic/source/gciterator.cxx:773
> #11 0x00007f6b16441ec3 in SwDoc::StartGrammarChecking (this=<optimized out>, bSkipStart=bSkipStart@entry=false) at sw/source/core/doc/docnew.cxx:180
> #12 0x00007f6b164c4eae in sw::DocumentTimerManager::DoIdleJobs (this=0x7f6afad005a0) at sw/source/core/doc/DocumentTimerManager.cxx:169
> #13 0x00007f6b3e83a68b in Scheduler::CallbackTaskScheduling () at vcl/source/app/scheduler.cxx:509
> #14 0x00007f6b3eb1725f in SalTimer::CallCallback (this=<optimized out>) at vcl/inc/saltimer.hxx:54
> #15 SvpSalInstance::CheckTimeout (this=this@entry=0xffebe0, bExecuteTimers=bExecuteTimers@entry=true) at vcl/headless/svpinst.cxx:157
> #16 0x00007f6b3eb1761d in SvpSalInstance::ImplYield (this=this@entry=0xffebe0, bWait=bWait@entry=true, bHandleAllCurrentEvents=bHandleAllCurrentEvents@entry=false) at vcl/headless/svpinst.cxx:395
> #17 0x00007f6b3eb17cd5 in SvpSalInstance::DoYield (this=0xffebe0, bWait=<optimized out>, bHandleAllCurrentEvents=<optimized out>) at vcl/headless/svpinst.cxx:467
> #18 0x00007f6b3e86aa44 in ImplYield (i_bWait=true, i_bAllEvents=false) at vcl/source/app/svapp.cxx:394
> #19 0x00007f6b3e86b13b in Application::Execute () at vcl/source/app/svapp.cxx:369
> #20 0x00007f6b3c8e715f in desktop::Desktop::Main (this=0x7ffe5e22fcb0) at desktop/source/app/app.cxx:1615
> #21 0x00007f6b3e87e6fb in ImplSVMain () at vcl/source/app/svmain.cxx:229
> #22 0x00007f6b3e87e9c5 in SVMain () at vcl/source/app/svmain.cxx:261
> #23 0x00007f6b3c91de37 in soffice_main () at desktop/source/app/sofficemain.cxx:93
> #24 0x000000000040078b in sal_main () at desktop/source/app/main.c:51
> #25 main (argc=argc@entry=8, argv=argv@entry=0x7ffe5e22feb8) at desktop/source/app/main.c:49

Change-Id: I60b8b0ba00cae691d6089325e4379a86221dc95b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165764
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
tdf-gerrit pushed a commit that referenced this pull request Apr 8, 2024
(tdf#160430: Fix glyph bounds calculation, and use basegfx::B2DRectangle, 2024-04-01).
As reported by Stephan in https://gerrit.libreoffice.org/c/core/+/165553/6#message-fec1e45288c0e87d43c58f777ebe51b03c534d82:

 `CppunitTest_sw_rtfexport CPPUNIT_TEST_NAME=testMathEqarray::TestBody` now fails with

  vcl/source/gdi/sallayout.cxx:245:30: runtime error: inf is outside the range of representable values of type 'long'
   #0 in SalLayout::GetBoundRect(tools::Rectangle&) const at vcl/source/gdi/sallayout.cxx:245:30
   #1 in OutputDevice::GetTextBoundRect(tools::Rectangle&, rtl::OUString const&, int, int, int, unsigned long, KernArraySpan, std::span<unsigned char const, 18446744073709551615ul>, SalLayoutGlyphs const*) const at vcl/source/outdev/text.cxx:1932:28
   #2 in (anonymous namespace)::SmGetGlyphBoundRect(OutputDevice const&, rtl::OUString const&, tools::Rectangle&) at starmath/source/rect.cxx:80:32
   #3 in SmRect::SmRect(OutputDevice const&, SmFormat const*, rtl::OUString const&, unsigned short) at starmath/source/rect.cxx:224:21
   #4 in SmMathSymbolNode::AdaptToY(OutputDevice&, unsigned long) at starmath/source/node.cxx:2122:18
   #5 in SmBraceNode::Arrange(OutputDevice&, SmFormat const&) at starmath/source/node.cxx:1340:17
   #6 in SmBinHorNode::Arrange(OutputDevice&, SmFormat const&) at starmath/source/node.cxx:816:13
   #7 in SmLineNode::Arrange(OutputDevice&, SmFormat const&) at starmath/source/node.cxx:610:20
   #8 in SmTableNode::Arrange(OutputDevice&, SmFormat const&) at starmath/source/node.cxx:534:20
   #9 in SmDocShell::ArrangeFormula() at starmath/source/document.cxx:280:13
   #10 in SmDocShell::GetSize() at starmath/source/document.cxx:405:9
   #11 in SmDocShell::Repaint() at starmath/source/document.cxx:566:21
   #12 in SmDocShell::OnDocumentPrinterChanged(Printer*) at starmath/source/document.cxx:552:5
   #13 in SmDocShell::SetText(rtl::OUString const&) at starmath/source/document.cxx:188:9
   #14 in SmDocShell::readFormulaOoxml(oox::formulaimport::XmlStream&) at starmath/source/document.cxx:848:5
   #15 in SmModel::readFormulaOoxml(oox::formulaimport::XmlStream&) at starmath/source/unomodel.cxx:1105:22
   #16 in writerfilter::rtftok::RTFDocumentImpl::beforePopState(writerfilter::rtftok::RTFParserState&) at writerfilter/source/rtftok/rtfdocumentimpl.cxx:3010:30
   #17 in writerfilter::rtftok::RTFDocumentImpl::popState() at writerfilter/source/rtftok/rtfdocumentimpl.cxx:3666:23
   #18 in writerfilter::rtftok::RTFTokenizer::resolveParse() at writerfilter/source/rtftok/rtftokenizer.cxx:114:37
   #19 in writerfilter::rtftok::RTFDocumentImpl::resolve(writerfilter::Stream&) at writerfilter/source/rtftok/rtfdocumentimpl.cxx:856:27
   #20 in (anonymous namespace)::RtfFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at writerfilter/source/filter/RtfFilter.cxx:163:20
   #21 in SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) at sfx2/source/doc/objstor.cxx:2392:34
   #22 in SfxObjectShell::DoLoad(SfxMedium*) at sfx2/source/doc/objstor.cxx:760:23
   #23 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sfx2/source/doc/sfxbasemodel.cxx:1980:36
   #24 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&) at sfx2/source/view/frmload.cxx:720:28
   #25 in framework::LoadEnv::impl_loadContent() at framework/source/loadenv/loadenv.cxx:1176:37
   #26 in framework::LoadEnv::start() at framework/source/loadenv/loadenv.cxx:412:20
   #27 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) at framework/source/loadenv/loadenv.cxx:308:5
   #28 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&) at framework/source/loadenv/loadenv.cxx:168:14
   #29 in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/services/desktop.cxx:591:16
   #30 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 framework/source/services/desktop.cxx
   #31 in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at unotest/source/cpp/macros_test.cxx:71:62
   #32 in UnoApiTest::loadWithParams(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at test/source/unoapi_test.cxx:126:19
   #33 in UnoApiTest::load(rtl::OUString const&, char const*) at test/source/unoapi_test.cxx:108:5
   #34 in SwModelTestBase::loadURL(rtl::OUString const&, char const*) at sw/qa/unit/swmodeltestbase.cxx:441:20
   #35 in SwModelTestBase::loadAndReload(char const*) at sw/qa/unit/swmodeltestbase.cxx:466:5
   #36 in (anonymous namespace)::testMathEqarray::TestBody() at sw/qa/extras/rtfexport/rtfexport.cxx:198:5

Change-Id: I857861f5bc51a1e43bfbf5e0c9dbce542d673ca7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165664
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
tdf-gerrit pushed a commit that referenced this pull request Apr 9, 2024
(tdf#160430: Fix glyph bounds calculation, and use basegfx::B2DRectangle, 2024-04-01).
As reported by Stephan in https://gerrit.libreoffice.org/c/core/+/165553/6#message-fec1e45288c0e87d43c58f777ebe51b03c534d82:

 `CppunitTest_sw_rtfexport CPPUNIT_TEST_NAME=testMathEqarray::TestBody` now fails with

  vcl/source/gdi/sallayout.cxx:245:30: runtime error: inf is outside the range of representable values of type 'long'
   #0 in SalLayout::GetBoundRect(tools::Rectangle&) const at vcl/source/gdi/sallayout.cxx:245:30
   #1 in OutputDevice::GetTextBoundRect(tools::Rectangle&, rtl::OUString const&, int, int, int, unsigned long, KernArraySpan, std::span<unsigned char const, 18446744073709551615ul>, SalLayoutGlyphs const*) const at vcl/source/outdev/text.cxx:1932:28
   #2 in (anonymous namespace)::SmGetGlyphBoundRect(OutputDevice const&, rtl::OUString const&, tools::Rectangle&) at starmath/source/rect.cxx:80:32
   #3 in SmRect::SmRect(OutputDevice const&, SmFormat const*, rtl::OUString const&, unsigned short) at starmath/source/rect.cxx:224:21
   #4 in SmMathSymbolNode::AdaptToY(OutputDevice&, unsigned long) at starmath/source/node.cxx:2122:18
   #5 in SmBraceNode::Arrange(OutputDevice&, SmFormat const&) at starmath/source/node.cxx:1340:17
   #6 in SmBinHorNode::Arrange(OutputDevice&, SmFormat const&) at starmath/source/node.cxx:816:13
   #7 in SmLineNode::Arrange(OutputDevice&, SmFormat const&) at starmath/source/node.cxx:610:20
   #8 in SmTableNode::Arrange(OutputDevice&, SmFormat const&) at starmath/source/node.cxx:534:20
   #9 in SmDocShell::ArrangeFormula() at starmath/source/document.cxx:280:13
   #10 in SmDocShell::GetSize() at starmath/source/document.cxx:405:9
   #11 in SmDocShell::Repaint() at starmath/source/document.cxx:566:21
   #12 in SmDocShell::OnDocumentPrinterChanged(Printer*) at starmath/source/document.cxx:552:5
   #13 in SmDocShell::SetText(rtl::OUString const&) at starmath/source/document.cxx:188:9
   #14 in SmDocShell::readFormulaOoxml(oox::formulaimport::XmlStream&) at starmath/source/document.cxx:848:5
   #15 in SmModel::readFormulaOoxml(oox::formulaimport::XmlStream&) at starmath/source/unomodel.cxx:1105:22
   #16 in writerfilter::rtftok::RTFDocumentImpl::beforePopState(writerfilter::rtftok::RTFParserState&) at writerfilter/source/rtftok/rtfdocumentimpl.cxx:3010:30
   #17 in writerfilter::rtftok::RTFDocumentImpl::popState() at writerfilter/source/rtftok/rtfdocumentimpl.cxx:3666:23
   #18 in writerfilter::rtftok::RTFTokenizer::resolveParse() at writerfilter/source/rtftok/rtftokenizer.cxx:114:37
   #19 in writerfilter::rtftok::RTFDocumentImpl::resolve(writerfilter::Stream&) at writerfilter/source/rtftok/rtfdocumentimpl.cxx:856:27
   #20 in (anonymous namespace)::RtfFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at writerfilter/source/filter/RtfFilter.cxx:163:20
   #21 in SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) at sfx2/source/doc/objstor.cxx:2392:34
   #22 in SfxObjectShell::DoLoad(SfxMedium*) at sfx2/source/doc/objstor.cxx:760:23
   #23 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sfx2/source/doc/sfxbasemodel.cxx:1980:36
   #24 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&) at sfx2/source/view/frmload.cxx:720:28
   #25 in framework::LoadEnv::impl_loadContent() at framework/source/loadenv/loadenv.cxx:1176:37
   #26 in framework::LoadEnv::start() at framework/source/loadenv/loadenv.cxx:412:20
   #27 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) at framework/source/loadenv/loadenv.cxx:308:5
   #28 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&) at framework/source/loadenv/loadenv.cxx:168:14
   #29 in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/services/desktop.cxx:591:16
   #30 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 framework/source/services/desktop.cxx
   #31 in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at unotest/source/cpp/macros_test.cxx:71:62
   #32 in UnoApiTest::loadWithParams(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at test/source/unoapi_test.cxx:126:19
   #33 in UnoApiTest::load(rtl::OUString const&, char const*) at test/source/unoapi_test.cxx:108:5
   #34 in SwModelTestBase::loadURL(rtl::OUString const&, char const*) at sw/qa/unit/swmodeltestbase.cxx:441:20
   #35 in SwModelTestBase::loadAndReload(char const*) at sw/qa/unit/swmodeltestbase.cxx:466:5
   #36 in (anonymous namespace)::testMathEqarray::TestBody() at sw/qa/extras/rtfexport/rtfexport.cxx:198:5

Change-Id: I857861f5bc51a1e43bfbf5e0c9dbce542d673ca7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165664
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 51244eb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165844
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
tdf-gerrit pushed a commit that referenced this pull request Apr 9, 2024
At least with one ASan/UBSan setup of mine using LODE's Clang 12.0.1,
./autogen.sh would occasionally detect -std=gnu11 as the required CC "option to
enable C11 features" (which would in turn cause building external/firebird to
fail oddly; an issue worth investigations of its own), because Clang would
occasionally crash with a SEGV on the corresponding configure test program's
first invocation (without -std=gnu11) when invoked with -O2 (and happen to
succeed on second invocation with -std=gnu11, so configure thinks that's
needed), see below for a relevant config.log excerpt.

When CC/CXX are already set (as is the case in this scenario), we could arguably
skip the AC_PROG_CC/CXX checks entirely (and thus avoid configure potentially
adding -std=gnu11 to CC), but at least AC_PROG_CC also internally sets the GCC
shell var, which we use in configure.ac.  So better be conservative and just
avoid -O2 during AC_PROG_CC/CXX (whatever the autoconf motivation to include it
in the first place).

> configure:8165: checking for /home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang -fsanitize=address -fsanitize=undefined -fsanitize=float-divide-by-zero -fsanitize=local-bounds -fsanitize-blacklist=/home/sberg/lo0/core/sanitize-ubsan-excludelist option to enable C11 features
> configure:8180: /home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang -fsanitize=address -fsanitize=undefined -fsanitize=float-divide-by-zero -fsanitize=local-bounds -fsanitize-blacklist=/home/sberg/lo0/core/sanitize-ubsan-excludelist  -c -g -O2  conftest.c >&5
> PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
> Stack dump:
> 0.	Program arguments: /home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang -fsanitize=address -fsanitize=undefined -fsanitize=float-divide-by-zero -fsanitize=local-bounds -fsanitize-blacklist=/home/sberg/lo0/core/sanitize-ubsan-excludelist -c -g -O2 conftest.c
> 1.	<eof> parser at end of file
> 2.	Code generation
>  #0 0x000055f3a890caf2 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x1c3eaf2)
>  #1 0x000055f3a890a734 llvm::sys::RunSignalHandlers() (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x1c3c734)
>  #2 0x000055f3a887b998 CrashRecoverySignalHandler(int) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x1bad998)
>  #3 0x00007f750d24e520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
>  #4 0x000055f3a93f9cd4 llvm::DIE::getUnitDie() const (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x272bcd4)
>  #5 0x000055f3a9404574 llvm::DwarfDebug::finishEntityDefinitions() (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x2736574)
>  #6 0x000055f3a941df99 llvm::DwarfDebug::finalizeModuleInfo() (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x274ff99)
>  #7 0x000055f3a9421128 llvm::DwarfDebug::endModule() (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x2753128)
>  #8 0x000055f3a93f1219 llvm::AsmPrinter::doFinalization(llvm::Module&) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x2723219)
>  #9 0x000055f3a82478f5 llvm::FPPassManager::doFinalization(llvm::Module&) (.localalias) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x15798f5)
> #10 0x000055f3a8253900 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x1585900)
> #11 0x000055f3a8bb57d3 (anonymous namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (.constprop.0) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x1ee77d3)
> #12 0x000055f3a8bb76ea clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x1ee96ea)
> #13 0x000055f3a9825876 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x2b57876)
> #14 0x000055f3aa35c549 clang::ParseAST(clang::Sema&, bool, bool) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x368e549)
> #15 0x000055f3a91ef2d9 clang::FrontendAction::Execute() (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x25212d9)
> #16 0x000055f3a91903a3 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x24c23a3)
> #17 0x000055f3a92a2fd8 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x25d4fd8)
> #18 0x000055f3a7798815 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0xaca815)
> #19 0x000055f3a77961a7 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0xac81a7)
> #20 0x000055f3a9039689 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) const::'lambda'()>(long) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x236b689)
> #21 0x000055f3a887baa7 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x1badaa7)
> #22 0x000055f3a903a802 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) const (.part.0) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x236c802)
> #23 0x000055f3a900fbec clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x2341bec)
> #24 0x000055f3a9010679 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x2342679)
> #25 0x000055f3a901e8f1 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x23508f1)
> #26 0x000055f3a7717e6f main (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0xa49e6f)
> #27 0x00007f750d235d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
> #28 0x00007f750d235e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
> #29 0x000055f3a7795b55 _start (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0xac7b55)
> clang-12: error: clang frontend command failed with exit code 139 (use -v to see invocation)
> clang version 12.0.1 (https://github.com/llvm/llvm-project.git fed41342a82f5a3a9201819a82bf7a48313e296b)
> Target: x86_64-unknown-linux-gnu
> Thread model: posix
> InstalledDir: /home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin
> clang-12: note: diagnostic msg:
> ********************
>
> PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
> Preprocessed source(s) and associated run script(s) are located at:
> clang-12: note: diagnostic msg: /tmp/conftest-968380.c
> clang-12: note: diagnostic msg: /tmp/conftest-968380.sh
> clang-12: note: diagnostic msg:
>
> ********************
> configure:8180: $? = 139
> configure: failed program was:
> | /* confdefs.h */
> | #define PACKAGE_NAME "LibreOffice"
> | #define PACKAGE_TARNAME "libreoffice"
> | #define PACKAGE_VERSION "24.8.0.0.alpha0+"
> | #define PACKAGE_STRING "LibreOffice 24.8.0.0.alpha0+"
> | #define PACKAGE_BUGREPORT ""
> | #define PACKAGE_URL "http://documentfoundation.org/"
> | #define LIBO_VERSION_MAJOR 24
> | #define LIBO_VERSION_MINOR 8
> | #define LIBO_VERSION_MICRO 0
> | #define LIBO_VERSION_PATCH 0
> | #define LIBO_THIS_YEAR 2024
> | #define SRCDIR "/home/sberg/lo0/core"
> | #define SRC_ROOT "/home/sberg/lo0/core"
> | #define BUILDDIR "/home/sberg/lo0/core"
> | #define USE_HEADLESS_CODE 1
> | #define ENABLE_HEADLESS 1
> | /* end confdefs.h.  */
> |
> | /* Does the compiler advertise C89 conformance?
> |    Do not test the value of __STDC__, because some compilers set it to 0
> |    while being otherwise adequately conformant. */
> | #if !defined __STDC__
> | # error "Compiler does not advertise C89 conformance"
> | #endif
> |
> | #include <stddef.h>
> | #include <stdarg.h>
> | struct stat;
> | /* Most of the following tests are stolen from RCS 5.7 src/conf.sh.  */
> | struct buf { int x; };
> | struct buf * (*rcsopen) (struct buf *, struct stat *, int);
> | static char *e (p, i)
> |      char **p;
> |      int i;
> | {
> |   return p[i];
> | }
> | static char *f (char * (*g) (char **, int), char **p, ...)
> | {
> |   char *s;
> |   va_list v;
> |   va_start (v,p);
> |   s = g (p, va_arg (v,int));
> |   va_end (v);
> |   return s;
> | }
> |
> | /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
> |    function prototypes and stuff, but not \xHH hex character constants.
> |    These do not provoke an error unfortunately, instead are silently treated
> |    as an "x".  The following induces an error, until -std is added to get
> |    proper ANSI mode.  Curiously \x00 != x always comes out true, for an
> |    array size at least.  It is necessary to write \x00 == 0 to get something
> |    that is true only with -std.  */
> | int osf4_cc_array ['\x00' == 0 ? 1 : -1];
> |
> | /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
> |    inside strings and character constants.  */
> | #define FOO(x) 'x'
> | int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
> |
> | int test (int i, double x);
> | struct s1 {int (*f) (int a);};
> | struct s2 {int (*f) (double a);};
> | int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int),
> |                int, int);
> |
> | // Does the compiler advertise C99 conformance?
> | #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
> | # error "Compiler does not advertise C99 conformance"
> | #endif
> |
> | #include <stdbool.h>
> | extern int puts (const char *);
> | extern int printf (const char *, ...);
> | extern int dprintf (int, const char *, ...);
> | extern void *malloc (size_t);
> |
> | // Check varargs macros.  These examples are taken from C99 6.10.3.5.
> | // dprintf is used instead of fprintf to avoid needing to declare
> | // FILE and stderr.
> | #define debug(...) dprintf (2, __VA_ARGS__)
> | #define showlist(...) puts (#__VA_ARGS__)
> | #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
> | static void
> | test_varargs_macros (void)
> | {
> |   int x = 1234;
> |   int y = 5678;
> |   debug ("Flag");
> |   debug ("X = %d\n", x);
> |   showlist (The first, second, and third items.);
> |   report (x>y, "x is %d but y is %d", x, y);
> | }
> |
> | // Check long long types.
> | #define BIG64 18446744073709551615ull
> | #define BIG32 4294967295ul
> | #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
> | #if !BIG_OK
> |   #error "your preprocessor is broken"
> | #endif
> | #if BIG_OK
> | #else
> |   #error "your preprocessor is broken"
> | #endif
> | static long long int bignum = -9223372036854775807LL;
> | static unsigned long long int ubignum = BIG64;
> |
> | struct incomplete_array
> | {
> |   int datasize;
> |   double data[];
> | };
> |
> | struct named_init {
> |   int number;
> |   const wchar_t *name;
> |   double average;
> | };
> |
> | typedef const char *ccp;
> |
> | static inline int
> | test_restrict (ccp restrict text)
> | {
> |   // See if C++-style comments work.
> |   // Iterate through items via the restricted pointer.
> |   // Also check for declarations in for loops.
> |   for (unsigned int i = 0; *(text+i) != '\0'; ++i)
> |     continue;
> |   return 0;
> | }
> |
> | // Check varargs and va_copy.
> | static bool
> | test_varargs (const char *format, ...)
> | {
> |   va_list args;
> |   va_start (args, format);
> |   va_list args_copy;
> |   va_copy (args_copy, args);
> |
> |   const char *str = "";
> |   int number = 0;
> |   float fnumber = 0;
> |
> |   while (*format)
> |     {
> |       switch (*format++)
> | 	{
> | 	case 's': // string
> | 	  str = va_arg (args_copy, const char *);
> | 	  break;
> | 	case 'd': // int
> | 	  number = va_arg (args_copy, int);
> | 	  break;
> | 	case 'f': // float
> | 	  fnumber = va_arg (args_copy, double);
> | 	  break;
> | 	default:
> | 	  break;
> | 	}
> |     }
> |   va_end (args_copy);
> |   va_end (args);
> |
> |   return *str && number && fnumber;
> | }
> |
> |
> | // Does the compiler advertise C11 conformance?
> | #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L
> | # error "Compiler does not advertise C11 conformance"
> | #endif
> |
> | // Check _Alignas.
> | char _Alignas (double) aligned_as_double;
> | char _Alignas (0) no_special_alignment;
> | extern char aligned_as_int;
> | char _Alignas (0) _Alignas (int) aligned_as_int;
> |
> | // Check _Alignof.
> | enum
> | {
> |   int_alignment = _Alignof (int),
> |   int_array_alignment = _Alignof (int[100]),
> |   char_alignment = _Alignof (char)
> | };
> | _Static_assert (0 < -_Alignof (int), "_Alignof is signed");
> |
> | // Check _Noreturn.
> | int _Noreturn does_not_return (void) { for (;;) continue; }
> |
> | // Check _Static_assert.
> | struct test_static_assert
> | {
> |   int x;
> |   _Static_assert (sizeof (int) <= sizeof (long int),
> |                   "_Static_assert does not work in struct");
> |   long int y;
> | };
> |
> | // Check UTF-8 literals.
> | #define u8 syntax error!
> | char const utf8_literal[] = u8"happens to be ASCII" "another string";
> |
> | // Check duplicate typedefs.
> | typedef long *long_ptr;
> | typedef long int *long_ptr;
> | typedef long_ptr long_ptr;
> |
> | // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1.
> | struct anonymous
> | {
> |   union {
> |     struct { int i; int j; };
> |     struct { int k; long int l; } w;
> |   };
> |   int m;
> | } v1;
> |
> |
> | int
> | main (int argc, char **argv)
> | {
> |   int ok = 0;
> |
> | ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]);
> |
> |
> |   // Check bool.
> |   _Bool success = false;
> |   success |= (argc != 0);
> |
> |   // Check restrict.
> |   if (test_restrict ("String literal") == 0)
> |     success = true;
> |   char *restrict newvar = "Another string";
> |
> |   // Check varargs.
> |   success &= test_varargs ("s, d' f .", "string", 65, 34.234);
> |   test_varargs_macros ();
> |
> |   // Check flexible array members.
> |   struct incomplete_array *ia =
> |     malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
> |   ia->datasize = 10;
> |   for (int i = 0; i < ia->datasize; ++i)
> |     ia->data[i] = i * 1.234;
> |
> |   // Check named initializers.
> |   struct named_init ni = {
> |     .number = 34,
> |     .name = L"Test wide string",
> |     .average = 543.34343,
> |   };
> |
> |   ni.number = 58;
> |
> |   int dynamic_array[ni.number];
> |   dynamic_array[0] = argv[0][0];
> |   dynamic_array[ni.number - 1] = 543;
> |
> |   // work around unused variable warnings
> |   ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
> | 	 || dynamic_array[ni.number - 1] != 543);
> |
> |
> |   _Static_assert ((offsetof (struct anonymous, i)
> | 		   == offsetof (struct anonymous, w.k)),
> | 		  "Anonymous union alignment botch");
> |   v1.i = 2;
> |   v1.w.k = 5;
> |   ok |= v1.i != 5;
> |
> |   return ok;
> | }
> |
> configure:8180: /home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang -fsanitize=address -fsanitize=undefined -fsanitize=float-divide-by-zero -fsanitize=local-bounds -fsanitize-blacklist=/home/sberg/lo0/core/sanitize-ubsan-excludelist -std=gnu11 -c -g -O2  conftest.c >&5
> configure:8180: $? = 0
> configure:8201: result: -std=gnu11

Change-Id: I9122d0d853d0010155d57cb1d1d56f7c453d5208
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165904
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
tdf-gerrit pushed a commit that referenced this pull request Apr 11, 2024
Always run `QtGraphics_Controls::getNativeControlRegion`
in the main thread, as it may create a dummy `QLineEdit`
(see the `ControlType::MultilineEditbox` and
`ControlType::Editbox` cases) and creating Qt widgets
is only allowed in the main thread.

Without the following scenario runs into an assert
with a current Qt 6 dev debug build when using the
qt6 VCL plugin:

1) open sample document attachment 193089
   from tdf#160176
2) enable Form Design Toolbar
3) switch to Design mode
4) select label next to "Labelfield2" label
5) right-click, "Control Properties"
6) type anything for the help text and tab
   to the next UI element

Backtrace:

    ASSERT failure in QWidget: "Widgets must be created in the GUI thread.", file /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp, line 956

    Thread 45 "browserlistbox" received signal SIGABRT, Aborted.
    [Switching to Thread 0x7fff8d08d6c0 (LWP 203558)]
    __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  0x00007ffff78a81cf in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
    #2  0x00007ffff785a472 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
    #3  0x00007ffff78444b2 in __GI_abort () at ./stdlib/abort.c:79
    #4  0x00007fffe32f8540 in qAbort() () at /home/michi/development/git/qt5/qtbase/src/corelib/global/qassert.cpp:49
    #5  0x00007fffe330c393 in qt_message_fatal<QString&>(QtMsgType, QMessageLogContext const&, QString&) (context=..., message=...) at /home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:2056
    #6  0x00007fffe3305344 in qt_message(QtMsgType, const QMessageLogContext &, const char *, typedef __va_list_tag __va_list_tag *)
        (msgType=QtFatalMsg, context=..., msg=0x7fffe3981990 "ASSERT failure in %s: \"%s\", file %s, line %d", ap=0x7fff8d086178) at /home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:374
    #7  0x00007fffe330740f in QMessageLogger::fatal(char const*, ...) const (this=0x7fff8d0863c0, msg=0x7fffe3981990 "ASSERT failure in %s: \"%s\", file %s, line %d")
        at /home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:874
    #8  0x00007fffe32f8613 in qt_assert_x(char const*, char const*, char const*, int)
        (where=0x7fffe1becdf3 "QWidget", what=0x7fffe1becdc8 "Widgets must be created in the GUI thread.", file=0x7fffe1becca0 "/home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp", line=956)
        at /home/michi/development/git/qt5/qtbase/src/corelib/global/qassert.cpp:114
    #9  0x00007fffe144118c in QWidgetPrivate::init(QWidget*, QFlags<Qt::WindowType>) (this=0x7fff780054d0, parentWidget=0x0, f=...) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:956
    #10 0x00007fffe1440ca1 in QWidget::QWidget(QWidgetPrivate&, QWidget*, QFlags<Qt::WindowType>) (this=0x7fff8d086d00, dd=..., parent=0x0, f=...) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:872
    #11 0x00007fffe16a7d22 in QLineEdit::QLineEdit(QString const&, QWidget*) (this=0x7fff8d086d00, contents=..., parent=0x0) at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qlineedit.cpp:253
    #12 0x00007fffe16a7c98 in QLineEdit::QLineEdit(QWidget*) (this=0x7fff8d086d00, parent=0x0) at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qlineedit.cpp:239
    #13 0x00007fffe404aebc in QtGraphics_Controls::getNativeControlRegion(ControlType, ControlPart, tools::Rectangle const&, ControlState, ImplControlValue const&, rtl::OUString const&, tools::Rectangle&, tools::Rectangle&)
        (this=0x55555cbb13e0, type=ControlType::Editbox, part=ControlPart::Entire, controlRegion=..., controlState=(ControlState::ENABLED | ControlState::ROLLOVER), val=..., nativeBoundingRegion=..., nativeContentRegion=...)
        at vcl/qt6/../qt5/QtGraphics_Controls.cxx:784
    #14 0x00007fffee72945e in SalGraphics::GetNativeControlRegion(ControlType, ControlPart, tools::Rectangle const&, ControlState, ImplControlValue const&, tools::Rectangle&, tools::Rectangle&, OutputDevice const&)
        (this=0x55555eb28920, nType=ControlType::Editbox, nPart=ControlPart::Entire, rControlRegion=..., nState=(ControlState::ENABLED | ControlState::ROLLOVER), aValue=..., rNativeBoundingRegion=..., rNativeContentRegion=..., rOutDev=...)
        at /home/michi/development/git/libreoffice/vcl/source/gdi/salgdilayout.cxx:834
    #15 0x00007fffee3a7195 in OutputDevice::GetNativeControlRegion(ControlType, ControlPart, tools::Rectangle const&, ControlState, ImplControlValue const&, tools::Rectangle&, tools::Rectangle&) const
        (this=0x5555607cd870, nType=ControlType::Editbox, nPart=ControlPart::Entire, rControlRegion=..., nState=(ControlState::ENABLED | ControlState::ROLLOVER), aValue=..., rNativeBoundingRegion=..., rNativeContentRegion=...)
        at /home/michi/development/git/libreoffice/vcl/source/outdev/nativecontrols.cxx:313
    #16 0x00007fffede63b9d in ImplSmallBorderWindowView::DrawWindow(OutputDevice&, Point const*) (this=0x5555607c7c10, rRenderContext=...) at /home/michi/development/git/libreoffice/vcl/source/window/brdwin.cxx:699
    #17 0x00007fffede69900 in ImplBorderWindow::Paint(OutputDevice&, tools::Rectangle const&) (this=0x5555607c7ca0, rRenderContext=...) at /home/michi/development/git/libreoffice/vcl/source/window/brdwin.cxx:1628
    #18 0x00007fffede3e241 in PaintHelper::DoPaint(vcl::Region const*) (this=0x7fff8d088188, pRegion=0x7fff78006480) at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:313
    #19 0x00007fffede3feff in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags)
        (this=0x5555607c7ca0, pRegion=0x7fff78006480, nPaintFlags=(ImplPaintFlags::PaintAllChildren | ImplPaintFlags::PaintChildren | ImplPaintFlags::Erase)) at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:617
    #20 0x00007fffede3f791 in PaintHelper::~PaintHelper() (this=0x7fff8d0883c8) at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:552
    #21 0x00007fffede3ff86 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags)
        (this=0x55556002ead0, pRegion=0x7fff78005ec0, nPaintFlags=(ImplPaintFlags::PaintAllChildren | ImplPaintFlags::PaintChildren | ImplPaintFlags::Erase)) at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:623
    #22 0x00007fffede3f791 in PaintHelper::~PaintHelper() (this=0x7fff8d088608) at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:552
    #23 0x00007fffede3ff86 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags)
        (this=0x55555edac0e0, pRegion=0x7fff78005dc0, nPaintFlags=(ImplPaintFlags::PaintAllChildren | ImplPaintFlags::PaintChildren | ImplPaintFlags::Erase)) at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:623
    #24 0x00007fffede3f791 in PaintHelper::~PaintHelper() (this=0x7fff8d088848) at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:552
    #25 0x00007fffede3ff86 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags)
        (this=0x55555edab480, pRegion=0x7fff78005d80, nPaintFlags=(ImplPaintFlags::PaintAllChildren | ImplPaintFlags::PaintChildren | ImplPaintFlags::Erase)) at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:623
    #26 0x00007fffede3f791 in PaintHelper::~PaintHelper() (this=0x7fff8d088a88) at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:552
    #27 0x00007fffede3ff86 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags)
        (this=0x55555edaa900, pRegion=0x7fff78004c40, nPaintFlags=(ImplPaintFlags::PaintAllChildren | ImplPaintFlags::PaintChildren | ImplPaintFlags::Erase)) at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:623
    #28 0x00007fffede3f791 in PaintHelper::~PaintHelper() (this=0x7fff8d088cc8) at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:552
    #29 0x00007fffede3ff86 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags)
        (this=0x55555ed29400, pRegion=0x7fff78004c00, nPaintFlags=(ImplPaintFlags::PaintAllChildren | ImplPaintFlags::PaintChildren | ImplPaintFlags::Erase)) at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:623
    #30 0x00007fffede3f791 in PaintHelper::~PaintHelper() (this=0x7fff8d088f08) at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:552
    #31 0x00007fffede3ff86 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags)
        (this=0x55555eccc910, pRegion=0x7fff78005d40, nPaintFlags=(ImplPaintFlags::PaintAllChildren | ImplPaintFlags::PaintChildren | ImplPaintFlags::Erase)) at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:623
    #32 0x00007fffede3f791 in PaintHelper::~PaintHelper() (this=0x7fff8d089148) at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:552
    #33 0x00007fffede3ff86 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags)
        (this=0x55555eda7a70, pRegion=0x7fff78004ac0, nPaintFlags=(ImplPaintFlags::PaintAllChildren | ImplPaintFlags::PaintChildren | ImplPaintFlags::Erase)) at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:623
    --Type <RET> for more, q to quit, c to continue without paging--
    #34 0x00007fffede3f791 in PaintHelper::~PaintHelper() (this=0x7fff8d089388) at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:552
    #35 0x00007fffede3ff86 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags)
        (this=0x55555eda2210, pRegion=0x7fff78001230, nPaintFlags=(ImplPaintFlags::PaintAllChildren | ImplPaintFlags::PaintChildren | ImplPaintFlags::Erase)) at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:623
    #36 0x00007fffede3f791 in PaintHelper::~PaintHelper() (this=0x7fff8d0895c8) at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:552
    #37 0x00007fffede3ff86 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags)
        (this=0x55555ecd5d20, pRegion=0x7fff78002510, nPaintFlags=(ImplPaintFlags::PaintAllChildren | ImplPaintFlags::PaintChildren | ImplPaintFlags::Erase)) at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:623
    #38 0x00007fffede3f791 in PaintHelper::~PaintHelper() (this=0x7fff8d089808) at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:552
    #39 0x00007fffede3ff86 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags)
        (this=0x55555ecdae90, pRegion=0x7fff78001ae0, nPaintFlags=(ImplPaintFlags::PaintAllChildren | ImplPaintFlags::PaintChildren | ImplPaintFlags::Erase)) at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:623
    #40 0x00007fffede3f791 in PaintHelper::~PaintHelper() (this=0x7fff8d089a48) at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:552
    #41 0x00007fffede3ff86 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags)
        (this=0x55555bb5ddb0, pRegion=0x55555eb4e340, nPaintFlags=(ImplPaintFlags::PaintAllChildren | ImplPaintFlags::PaintChildren | ImplPaintFlags::Erase)) at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:623
    #42 0x00007fffede3f791 in PaintHelper::~PaintHelper() (this=0x7fff8d089c88) at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:552
    #43 0x00007fffede3ff86 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags)
        (this=0x55555ed5c6e0, pRegion=0x7fff78001310, nPaintFlags=(ImplPaintFlags::PaintAllChildren | ImplPaintFlags::PaintChildren | ImplPaintFlags::Erase)) at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:623
    #44 0x00007fffede3f791 in PaintHelper::~PaintHelper() (this=0x7fff8d089ec8) at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:552
    #45 0x00007fffede3ff86 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags) (this=0x55555eb3aa10, pRegion=0x0, nPaintFlags=(ImplPaintFlags::PaintAllChildren | ImplPaintFlags::PaintChildren | ImplPaintFlags::Erase))
        at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:623
    #46 0x00007fffede41a32 in vcl::Window::PaintImmediately() (this=0x5555607c7ca0) at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:1340
    #47 0x00007fffede415a0 in vcl::Window::PaintImmediately() (this=0x5555607c49b0) at /home/michi/development/git/libreoffice/vcl/source/window/paint.cxx:1280
    #48 0x00007fffee17f7ac in Edit::ImplInvalidateOrRepaint() (this=0x5555607c49b0) at /home/michi/development/git/libreoffice/vcl/source/control/edit.cxx:451
    #49 0x00007fffee182a52 in Edit::ImplAlignAndPaint() (this=0x5555607c49b0) at /home/michi/development/git/libreoffice/vcl/source/control/edit.cxx:1170
    #50 0x00007fffee183ef0 in Edit::ImplInsertText(rtl::OUString const&, Selection const*, bool) (this=0x5555607c49b0, rStr="ee", pNewSel=0x7fff8d08a6b8, bIsUserInput=false)
        at /home/michi/development/git/libreoffice/vcl/source/control/edit.cxx:885
    #51 0x00007fffee1841ca in Edit::ImplSetText(rtl::OUString const&, Selection const*) (this=0x5555607c49b0, rText="ee", pNewSelection=0x7fff8d08a6b8) at /home/michi/development/git/libreoffice/vcl/source/control/edit.cxx:918
    #52 0x00007fffee18cfd4 in Edit::SetText(rtl::OUString const&) (this=0x5555607c49b0, rStr="ee") at /home/michi/development/git/libreoffice/vcl/source/control/edit.cxx:2560
    #53 0x00007fffee8d974a in SalInstanceEntry::set_text(rtl::OUString const&) (this=0x5555607c4200, rText="ee") at /home/michi/development/git/libreoffice/vcl/source/app/salvtables.cxx:3383
    #54 0x00007fff7ef6054a in pcr::OEditControl::setValue(com::sun::star::uno::Any const&) (this=0x5555607c7660, _rValue=uno::Any("string": "ee"))
        at /home/michi/development/git/libreoffice/extensions/source/propctrlr/standardcontrol.cxx:200
    #55 0x00007fff7ed96819 in pcr::OBrowserListBox::impl_setControlAsPropertyValue(pcr::ListBoxLine const&, com::sun::star::uno::Any const&) (_rLine=..., _rPropertyValue=uno::Any("string": "ee"))
        at /home/michi/development/git/libreoffice/extensions/source/propctrlr/browserlistbox.cxx:551
    #56 0x00007fff7ed96485 in pcr::OBrowserListBox::SetPropertyValue(rtl::OUString const&, com::sun::star::uno::Any const&, bool) (this=0x55555eda22b0, _rEntryName="HelpText", _rValue=uno::Any("string": "ee"), _bUnknownValue=false)
        at /home/michi/development/git/libreoffice/extensions/source/propctrlr/browserlistbox.cxx:403
    #57 0x00007fff7ef432e8 in pcr::OPropertyEditor::SetPropertyValue(rtl::OUString const&, com::sun::star::uno::Any const&, bool) (this=0x55555ecdb3e0, rEntryName="HelpText", _rValue=uno::Any("string": "ee"), _bUnknownValue=false)
        at /home/michi/development/git/libreoffice/extensions/source/propctrlr/propertyeditor.cxx:277
    #58 0x00007fff7ef01d4f in pcr::OPropertyBrowserController::Commit(rtl::OUString const&, com::sun::star::uno::Any const&) (this=0x55555c5f1b40, rName="HelpText", _rValue=uno::Any("string": "ee"))
        at /home/michi/development/git/libreoffice/extensions/source/propctrlr/propcontroller.cxx:1337
    #59 0x00007fff7ed954ae in pcr::OBrowserListBox::valueChanged(com::sun::star::uno::Reference<com::sun::star::inspection::XPropertyControl> const&) (this=0x55555eda22b0, _rxControl=uno::Reference to (pcr::OEditControl *) 0x5555607c76b0)
        at /home/michi/development/git/libreoffice/extensions/source/propctrlr/browserlistbox.cxx:637
    #60 0x00007fff7ed95268 in pcr::PropertyControlContext_Impl::impl_processEvent_throw(comphelper::AnyEvent const&) (this=0x55555ed29270, _rEvent=...)
        at /home/michi/development/git/libreoffice/extensions/source/propctrlr/browserlistbox.cxx:291
    #61 0x00007fff7ed950b9 in pcr::PropertyControlContext_Impl::processEvent(comphelper::AnyEvent const&) (this=0x55555ed29270, _rEvent=...) at /home/michi/development/git/libreoffice/extensions/source/propctrlr/browserlistbox.cxx:272
    #62 0x00007ffff6118a2e in comphelper::AsyncEventNotifierBase::execute() (this=0x5555568d6620) at /home/michi/development/git/libreoffice/comphelper/source/misc/asyncnotification.cxx:139
    #63 0x00007ffff6119165 in comphelper::AsyncEventNotifier::execute() (this=0x5555568d6620) at /home/michi/development/git/libreoffice/comphelper/source/misc/asyncnotification.cxx:156
    #64 0x00007ffff7d0f6ec in salhelper::Thread::run() (this=0x5555568d6630) at /home/michi/development/git/libreoffice/salhelper/source/thread.cxx:39
    #65 0x00007ffff7d0ff2e in threadFunc(void*) (param=0x5555568d6640) at include/osl/thread.hxx:189
    #66 0x00007ffff7fa4b2d in osl_thread_start_Impl(void*) (pData=0x55555ecc3e40) at /home/michi/development/git/libreoffice/sal/osl/unx/thread.cxx:237
    #67 0x00007ffff78a645c in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:444
    #68 0x00007ffff7926bbc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Change-Id: I9e0b0d973997e3f4f50a9a31e9692325664fd262
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165995
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
tdf-gerrit pushed a commit that referenced this pull request Apr 15, 2024
(tdf#160430: Fix glyph bounds calculation, and use basegfx::B2DRectangle, 2024-04-01).
As reported by Stephan in https://gerrit.libreoffice.org/c/core/+/165553/6#message-fec1e45288c0e87d43c58f777ebe51b03c534d82:

 `CppunitTest_sw_rtfexport CPPUNIT_TEST_NAME=testMathEqarray::TestBody` now fails with

  vcl/source/gdi/sallayout.cxx:245:30: runtime error: inf is outside the range of representable values of type 'long'
   #0 in SalLayout::GetBoundRect(tools::Rectangle&) const at vcl/source/gdi/sallayout.cxx:245:30
   #1 in OutputDevice::GetTextBoundRect(tools::Rectangle&, rtl::OUString const&, int, int, int, unsigned long, KernArraySpan, std::span<unsigned char const, 18446744073709551615ul>, SalLayoutGlyphs const*) const at vcl/source/outdev/text.cxx:1932:28
   #2 in (anonymous namespace)::SmGetGlyphBoundRect(OutputDevice const&, rtl::OUString const&, tools::Rectangle&) at starmath/source/rect.cxx:80:32
   #3 in SmRect::SmRect(OutputDevice const&, SmFormat const*, rtl::OUString const&, unsigned short) at starmath/source/rect.cxx:224:21
   #4 in SmMathSymbolNode::AdaptToY(OutputDevice&, unsigned long) at starmath/source/node.cxx:2122:18
   #5 in SmBraceNode::Arrange(OutputDevice&, SmFormat const&) at starmath/source/node.cxx:1340:17
   #6 in SmBinHorNode::Arrange(OutputDevice&, SmFormat const&) at starmath/source/node.cxx:816:13
   #7 in SmLineNode::Arrange(OutputDevice&, SmFormat const&) at starmath/source/node.cxx:610:20
   #8 in SmTableNode::Arrange(OutputDevice&, SmFormat const&) at starmath/source/node.cxx:534:20
   #9 in SmDocShell::ArrangeFormula() at starmath/source/document.cxx:280:13
   #10 in SmDocShell::GetSize() at starmath/source/document.cxx:405:9
   #11 in SmDocShell::Repaint() at starmath/source/document.cxx:566:21
   #12 in SmDocShell::OnDocumentPrinterChanged(Printer*) at starmath/source/document.cxx:552:5
   #13 in SmDocShell::SetText(rtl::OUString const&) at starmath/source/document.cxx:188:9
   #14 in SmDocShell::readFormulaOoxml(oox::formulaimport::XmlStream&) at starmath/source/document.cxx:848:5
   #15 in SmModel::readFormulaOoxml(oox::formulaimport::XmlStream&) at starmath/source/unomodel.cxx:1105:22
   #16 in writerfilter::rtftok::RTFDocumentImpl::beforePopState(writerfilter::rtftok::RTFParserState&) at writerfilter/source/rtftok/rtfdocumentimpl.cxx:3010:30
   #17 in writerfilter::rtftok::RTFDocumentImpl::popState() at writerfilter/source/rtftok/rtfdocumentimpl.cxx:3666:23
   #18 in writerfilter::rtftok::RTFTokenizer::resolveParse() at writerfilter/source/rtftok/rtftokenizer.cxx:114:37
   #19 in writerfilter::rtftok::RTFDocumentImpl::resolve(writerfilter::Stream&) at writerfilter/source/rtftok/rtfdocumentimpl.cxx:856:27
   #20 in (anonymous namespace)::RtfFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at writerfilter/source/filter/RtfFilter.cxx:163:20
   #21 in SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) at sfx2/source/doc/objstor.cxx:2392:34
   #22 in SfxObjectShell::DoLoad(SfxMedium*) at sfx2/source/doc/objstor.cxx:760:23
   #23 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sfx2/source/doc/sfxbasemodel.cxx:1980:36
   #24 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&) at sfx2/source/view/frmload.cxx:720:28
   #25 in framework::LoadEnv::impl_loadContent() at framework/source/loadenv/loadenv.cxx:1176:37
   #26 in framework::LoadEnv::start() at framework/source/loadenv/loadenv.cxx:412:20
   #27 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) at framework/source/loadenv/loadenv.cxx:308:5
   #28 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&) at framework/source/loadenv/loadenv.cxx:168:14
   #29 in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/services/desktop.cxx:591:16
   #30 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 framework/source/services/desktop.cxx
   #31 in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at unotest/source/cpp/macros_test.cxx:71:62
   #32 in UnoApiTest::loadWithParams(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at test/source/unoapi_test.cxx:126:19
   #33 in UnoApiTest::load(rtl::OUString const&, char const*) at test/source/unoapi_test.cxx:108:5
   #34 in SwModelTestBase::loadURL(rtl::OUString const&, char const*) at sw/qa/unit/swmodeltestbase.cxx:441:20
   #35 in SwModelTestBase::loadAndReload(char const*) at sw/qa/unit/swmodeltestbase.cxx:466:5
   #36 in (anonymous namespace)::testMathEqarray::TestBody() at sw/qa/extras/rtfexport/rtfexport.cxx:198:5

Change-Id: I857861f5bc51a1e43bfbf5e0c9dbce542d673ca7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165664
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 51244eb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165844
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
tdf-gerrit pushed a commit that referenced this pull request Apr 25, 2024
This failure was seen:

/xmloff/source/text/txtparai.cxx:1816:37: runtime error: downcast of address 0x604000d86710 which does not point to an object of type 'XMLStyleHint_Impl'
0x604000d86710: note: object is of type 'XMLTextFrameHint_Impl'
 00 00 00 00  00 4b 83 40 b3 7f 00 00  70 bf 22 00 b0 60 00 00  70 bf 22 00 b0 60 00 00  06 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'XMLTextFrameHint_Impl'
    #0 0x7fb33f2d224d in XMLParaContext::endFastElement(int) /xmloff/source/text/txtparai.cxx:1816:37
    #1 0x7fb33dc76333 in SvXMLImport::endFastElement(int) /xmloff/source/core/xmlimp.cxx:885:15
    #2 0x7fb36ee0bfca in (anonymous namespace)::Entity::endElement() /sax/source/fastparser/fastparser.cxx:514:27
    #3 0x7fb36ee0b998 in sax_fastparser::FastSaxParserImpl::callbackEndElement() /sax/source/fastparser/fastparser.cxx:1331:17
    #4 0x7fb36edfb444 in (anonymous namespace)::call_callbackEndElement(void*, unsigned char const*, unsigned char const*, unsigned char const*) /sax/source/fastparser/fastparser.cxx:338:18
    #5 0x7fb3bacb8eaa in xmlParseEndTag2 /workdir/UnpackedTarball/libxml2/parser.c:10089:2
    #6 0x7fb3bac5fa45 in xmlParseTryOrFinish /workdir/UnpackedTarball/libxml2/parser.c:11867:14
    #7 0x7fb3bac533c4 in xmlParseChunk /workdir/UnpackedTarball/libxml2/parser.c:12150:5
    #8 0x7fb36edf6231 in sax_fastparser::FastSaxParserImpl::parse() /sax/source/fastparser/fastparser.cxx:1085:21
    #9 0x7fb36edefd18 in sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:890:9
    #10 0x7fb36ee11950 in sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:1470:13
    #11 0x7fb33dc60551 in SvXMLImport::parseStream(com::sun::star::xml::sax::InputSource const&) /xmloff/source/core/xmlimp.cxx:528:15
    #12 0x7fb31916b4f1 in (anonymous namespace)::ReadThroughComponent(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, com::sun::star::uno::Reference<com::sun::star::lang::XComponent> const&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, char const*, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&, rtl::OUString const&, bool, bool) /sw/source/filter/xml/swxml.cxx:181:26
    #13 0x7fb3191609f1 in (anonymous namespace)::ReadThroughComponent(com::sun::star::uno::Reference<com::sun::star::embed::XStorage> const&, com::sun::star::uno::Reference<com::sun::star::lang::XComponent> const&, char const*, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, char const*, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&, rtl::OUString const&, bool) /sw/source/filter/xml/swxml.cxx:323:16
    #14 0x7fb319159e4c in XMLReader::Read(SwDoc&, rtl::OUString const&, SwPaM&, rtl::OUString const&) /sw/source/filter/xml/swxml.cxx:833:16
    #15 0x7fb3187eda73 in SwReader::Read(Reader const&) /sw/source/filter/basflt/shellio.cxx:203:22
    #16 0x7fb3195ecd45 in SwDocShell::Load(SfxMedium&) /sw/source/uibase/app/docshini.cxx:533:37
    #17 0x7fb382833c33 in SfxObjectShell::LoadOwnFormat(SfxMedium&) /sfx2/source/doc/objstor.cxx:3619:20
    #18 0x7fb38283a353 in SfxObjectShell::DoLoad(SfxMedium*) /sfx2/source/doc/objstor.cxx:705:40
    #19 0x7fb382aca503 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/sfxbasemodel.cxx:1980:36
    #20 0x7fb38333d8c9 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&) /sfx2/source/view/frmload.cxx:720:28
    #21 0x7fb371713419 in framework::LoadEnv::impl_loadContent() /framework/source/loadenv/loadenv.cxx:1176:37
    #22 0x7fb37170a43b in framework::LoadEnv::start() /framework/source/loadenv/loadenv.cxx:412:20
    #23 0x7fb371702a79 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) /framework/source/loadenv/loadenv.cxx:308:5
    #24 0x7fb3716fe207 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&) /framework/source/loadenv/loadenv.cxx:168:14
    #25 0x7fb3717d23fd in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/services/desktop.cxx:591:16
    #26 0x7fb3717d2626 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&) /framework/source/services/desktop.cxx
    #27 0x7fb3869f5afa in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /unotest/source/cpp/macros_test.cxx:71:62
    #28 0x7fb38762dc56 in UnoApiTest::loadWithParams(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /test/source/unoapi_test.cxx:126:19
    #29 0x7fb38762cef8 in UnoApiTest::load(rtl::OUString const&, char const*) /test/source/unoapi_test.cxx:108:5
    #30 0x7fb38762e254 in UnoApiTest::loadFromFile(std::basic_string_view<char16_t, std::char_traits<char16_t> >, char const*) /test/source/unoapi_test.cxx:132:5
    #31 0x7fb38858966e in testPreserveJpg::TestBody() /filter/qa/unit/svg.cxx:52:5
    ...

See https://ci.libreoffice.org/job/lo_ubsan/3150/consoleFull#1179512796d893063f-7f3d-4b7e-b56f-4e0f225817cd

Change-Id: I1984ae555fada39fb6db6cadd326e5c8b9421b90
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166613
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
tdf-gerrit pushed a commit that referenced this pull request Apr 26, 2024
In the `GtkAccessibleInterface::get_at_context` implementations,
do not create a new `GtkATContext` if the accessible role has
changed.

This broke the apparent assumption that there's a 1:1 mapping
between `GtkAccessible` and `GtkATContext` and resulted in
segfaults seen quite often when starting LO Writer
with the gtk4 VCL plugin while Accerciser was also running.

For me, this was even more reproducible when running in rr
(crashed reliably on start).

LO has the `AccessibleEventId::ROLE_CHANGED` event type
to indicate role changes, but GTK 4 doesn't support
changing the initial role any more.

Quoting the
GtkAccessible doc [1]:

> The role cannot be changed after instantiating a
> GtkAccessible implementation.

And the accessibility section in the GTK 4 doc [2] says:

> Each role is part of the widget’s instance, and cannot be changed over
> time or as the result of a user action. Roles allows assistive
> technology applications to identify a UI control and decide how to
> present it to a user; if a part of the application’s UI changes role,
> the control needs to be removed and replaced with another one
> with the appropriate role.

Sample backtrace:

    Thread 1 received signal SIGSEGV, Segmentation fault.
    0x00007f0399aa0636 in get_parent_context_ref (accessible=0x55a141b5a9b0) at ../gtk/a11y/gtkatspicontext.c:462
    462           res = gtk_at_spi_root_to_ref (self->root);
    (rr) bt
    #0  0x00007f0399aa0636 in get_parent_context_ref (accessible=0x55a141b5a9b0) at ../gtk/a11y/gtkatspicontext.c:462
    #1  0x00007f0399aa43ba in gtk_at_spi_context_get_parent_ref (self=0x55a141b615c0) at ../gtk/a11y/gtkatspicontext.c:1956
    #2  0x00007f0399a9dc75 in collect_object (self=0x55a1469113a0, builder=0x7fff90e1a220, context=0x55a141b615c0) at ../gtk/a11y/gtkatspicache.c:131
    #3  0x00007f0399a9e2f2 in emit_add_accessible (self=0x55a1469113a0, context=0x55a141b615c0) at ../gtk/a11y/gtkatspicache.c:235
    #4  0x00007f0399a9eac1 in gtk_at_spi_cache_add_context (self=0x55a1469113a0, context=0x55a141b615c0) at ../gtk/a11y/gtkatspicache.c:436
    #5  0x00007f0399aa8152 in on_registration_reply (gobject=0x55a141b62060, result=0x55a14e28a890, user_data=0x55a141b64770) at ../gtk/a11y/gtkatspiroot.c:533
    #6  0x00007f039fac8ee3 in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
    #7  0x00007f039fac9b83 in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
    #8  0x00007f039fb269da in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
    #9  0x00007f039fac8ee3 in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
    #10 0x00007f039fac8f1d in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
    #11 0x00007f03a0b110d9 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #12 0x00007f03a0b14317 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #13 0x00007f03a0b14930 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #14 0x00007f039a877d9f in GtkSalData::Yield(bool, bool) (this=0x55a140869000, bWait=true, bHandleAllCurrentEvents=false) at vcl/unx/gtk4/../gtk3/gtkdata.cxx:405
    #15 0x00007f039a87dc63 in GtkInstance::DoYield(bool, bool) (this=0x55a140868eb0, bWait=true, bHandleAllCurrentEvents=false) at vcl/unx/gtk4/../gtk3/gtkinst.cxx:435
    #16 0x00007f03a539a64c in ImplYield(bool, bool) (i_bWait=true, i_bAllEvents=false) at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:394
    #17 0x00007f03a5399f5b in Application::Yield() () at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:482
    #18 0x00007f03a5399cf2 in Application::Execute() () at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:369
    #19 0x00007f03ae52304c in desktop::Desktop::Main() (this=0x7fff90e1c288) at /home/michi/development/git/libreoffice/desktop/source/app/app.cxx:1615
    #20 0x00007f03a53bcfbe in ImplSVMain() () at /home/michi/development/git/libreoffice/vcl/source/app/svmain.cxx:229
    #21 0x00007f03a53bf009 in SVMain() () at /home/michi/development/git/libreoffice/vcl/source/app/svmain.cxx:261
    #22 0x00007f03ae5a5a73 in soffice_main() () at /home/michi/development/git/libreoffice/desktop/source/app/sofficemain.cxx:93
    #23 0x000055a13fefca5d in sal_main () at /home/michi/development/git/libreoffice/desktop/source/app/main.c:51
    #24 0x000055a13fefca37 in main (argc=2, argv=0x7fff90e1c498) at /home/michi/development/git/libreoffice/desktop/source/app/main.c:49

From valgrind output:

    (soffice:972353): Gtk-CRITICAL **: 09:28:48.066: gtk_accessible_get_accessible_parent: assertion 'GTK_IS_ACCESSIBLE (self)' failed

    (soffice:972353): Gtk-CRITICAL **: 09:28:48.067: gtk_accessible_get_at_context: assertion 'GTK_IS_ACCESSIBLE (self)' failed
    ==972353== Thread 1:
    ==972353== Invalid read of size 8
    ==972353==    at 0x19077636: get_parent_context_ref (gtkatspicontext.c:462)
    ==972353==    by 0x1907B3B9: gtk_at_spi_context_get_parent_ref (gtkatspicontext.c:1956)
    ==972353==    by 0x19074C74: collect_object (gtkatspicache.c:131)
    ==972353==    by 0x190752F1: emit_add_accessible (gtkatspicache.c:235)
    ==972353==    by 0x19075AC0: gtk_at_spi_cache_add_context (gtkatspicache.c:436)
    ==972353==    by 0x1907F151: on_registration_reply (gtkatspiroot.c:533)
    ==972353==    by 0x12E72EE2: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.7800.4)
    ==972353==    by 0x12E73B82: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.7800.4)
    ==972353==    by 0x12ED09D9: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.7800.4)
    ==972353==    by 0x12E72EE2: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.7800.4)
    ==972353==    by 0x12E72F1C: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.7800.4)
    ==972353==    by 0x130620D8: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7800.4)
    ==972353==  Address 0x70 is not stack'd, malloc'd or (recently) free'd
    ==972353==

[1] https://docs.gtk.org/gtk4/iface.Accessible.html
[2] https://docs.gtk.org/gtk4/section-accessibility.html

Change-Id: I35196ca686e9d56f97bbf884da8b6492358e41fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166708
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
tdf-gerrit pushed a commit that referenced this pull request Apr 26, 2024
Similar to how the previous

    Change-Id: I35196ca686e9d56f97bbf884da8b6492358e41fc
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Fri Apr 26 09:45:39 2024 +0200

        gtk4 a11y: Don't create multiple AT contexts for same accessible

avoids creating multiple AT contexts for the same
accessible when the role changes, this commit addresses
another case in which 2 GtkATContexts could be created
for the OOoFixed which could result in segfault crashes:

The OOoFixed is a GtkWidget, and GTK's `gtk_widget_init`
already creates an AT context for widgets.
Then, a second AT context would be created because
`ooo_fixed_accessible_init` set an own implementation
for GtkAccessibleInterface::get_at_context that would
create a second AT context when it got called, resulting
in breaking the apparent assumption that there's a 1:1 mapping
between GtkAccessible and GtkATConetxt.

No longer override `GtkAccessibleInterface::get_at_context`
but live with the GtkATContext created for the GtkWidget,
even if that means an a11y role cannot explicitly be set
for these for now.
From a first quick look at the tree in Accerciser,
I only see one item changed its a11y role from panel to filler.

The main class used. e.g. for the document content is
LOAccessible, not OOoFixed, and setting the proper role
for instances of that class is unaffected, see
`lo_accessible_get_at_context`.

If setting the a11y role is relevant, this could be
done when initializing the OOoFixed instead by setting
the "accessible-role" property [1], tested with this demo
local change to set a dummy table-cell a11y role and
verifying in Accerciser that it was actually set:

    --- a/vcl/unx/gtk3/gtkframe.cxx
    +++ b/vcl/unx/gtk3/gtkframe.cxx
    @@ -993,7 +993,10 @@ void GtkSalFrame::InitCommon()
     #else
         m_pOverlay = GTK_OVERLAY(gtk_overlay_new());
     #if GTK_CHECK_VERSION(4,9,0)
    -    m_pFixedContainer = GTK_FIXED(g_object_new( ooo_fixed_get_type(), nullptr ));
    +    GValue aValue = G_VALUE_INIT;
    +    g_value_init (&aValue, GTK_TYPE_ACCESSIBLE_ROLE);
    +    g_value_set_enum(&aValue, GTK_ACCESSIBLE_ROLE_CELL);
    +    m_pFixedContainer = GTK_FIXED(g_object_new( ooo_fixed_get_type(), "accessible-role", aValue,  nullptr ));
     #else
         m_pFixedContainer = GTK_FIXED(gtk_fixed_new());
     #endif

Similar to how the dropped code did, this could use the
a11y role from the corresponding `vcl::Window`, which is
currently not passed, but that could be adjusted, e.g.
by either passing the window or its accessible info
to `SalInstance::CreateFrame`/`SalInstance::CreateChildFrame`.
See `Window::ImplInit`, where the `vcl::Window` is currently
only set via `SalFrame::SetCallback` after the call to
`SalInstance::CreateFrame`/`SalInstance::CreateChildFrame`.

Without this commit, for me, this crash happened about 10-30 %
of the time when starting LO Writer with the gtk4 VCL plugin in rr,
when Accerciser was running already.

Backtrace for first AT context creation (from `gtk_widget_init`):

    1 gtk_at_context_create gtkatcontext.c 671 0x7f677daf129e
    2 create_at_context gtkwidget.c 8574 0x7f677dd6bcd9
    3 gtk_widget_init gtkwidget.c 2392 0x7f677dd5edbc
    4 g_type_create_instance 0x7f678ed8f2a3
    5 ?? 0x7f678ed72500
    6 g_object_new_with_properties 0x7f678ed73b96
    7 g_object_new 0x7f678ed74a41
    8 GtkSalFrame::InitCommon gtkframe.cxx 996 0x7f677edb9243
    9 GtkSalFrame::Init gtkframe.cxx 1785 0x7f677edb7bca
    10 GtkSalFrame::GtkSalFrame gtkframe.cxx 510 0x7f677edb726d
    11 GtkInstance::CreateFrame gtkinst.cxx 273 0x7f677ec7cebc
    12 vcl::Window::ImplInit window.cxx 1057 0x7f6788cf7f49
    13 ImplBorderWindow::ImplInit brdwin.cxx 1555 0x7f6788a6d45b
    14 ImplBorderWindow::ImplBorderWindow brdwin.cxx 1584 0x7f6788a6da21
    15 VclPtrInstance<ImplBorderWindow>::VclPtrInstance<vcl::Window *&, SystemParentData *&, long&, BorderWindowStyle&> vclptr.hxx 280 0x7f6788d31049
    16 WorkWindow::ImplInit wrkwin.cxx 51 0x7f6788d2f809
    17 IntroWindow::IntroWindow introwin.cxx 35 0x7f6788bb7ee0
    18 (anonymous namespace)::SplashScreenWindow::SplashScreenWindow splash.cxx 122 0x7f677c1cee61
    19 VclPtr<(anonymous namespace)::SplashScreenWindow>::Create<(anonymous namespace)::SplashScreen *> vclptr.hxx 129 0x7f677c1cc86b
    20 (anonymous namespace)::SplashScreen::SplashScreen splash.cxx 145 0x7f677c1cc5f8
    21 desktop_SplashScreen_get_implementation splash.cxx 616 0x7f677c1cc4f9
    22 std::__invoke_impl<com::sun::star::uno::XInterface *, com::sun::star::uno::XInterface * ( *&)(com::sun::star::uno::XComponentContext *, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&), com::sun::star::uno::XComponentContext *, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&> invoke.h 61 0x7f67907ef7a8
    23 std::__invoke_r<com::sun::star::uno::XInterface *, com::sun::star::uno::XInterface * ( *&)(com::sun::star::uno::XComponentContext *, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&), com::sun::star::uno::XComponentContext *, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&> invoke.h 114 0x7f67907ef745
    24 std::_Function_handler<com::sun::star::uno::XInterface * (com::sun::star::uno::XComponentContext *, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&), com::sun::star::uno::XInterface * ( *)(com::sun::star::uno::XComponentContext *, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&)>::_M_invoke(std::_Any_data const&, com::sun::star::uno::XComponentContext *&&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) std_function.h 290 0x7f67907ef63d
    25 std::function<com::sun::star::uno::XInterface * (com::sun::star::uno::XComponentContext *, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&)>::operator()(com::sun::star::uno::XComponentContext *, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) const std_function.h 591 0x7f67907b6848
    26 cppuhelper::ServiceManager::Data::Implementation::doCreateInstanceWithArguments servicemanager.cxx 725 0x7f679079f26f
    27 cppuhelper::ServiceManager::Data::Implementation::createInstanceWithArguments servicemanager.cxx 696 0x7f679079f143
    28 cppuhelper::ServiceManager::createInstanceWithArgumentsAndContext servicemanager.cxx 1021 0x7f67907a56c5
    29 non-virtual thunk to cppuhelper::ServiceManager::createInstanceWithArgumentsAndContext(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) servicemanager.cxx 1022 0x7f67907a577c
    30 desktop::Desktop::OpenSplashScreen app.cxx 2449 0x7f6792723b2c
    31 desktop::Desktop::Main app.cxx 1299 0x7f6792721362
    32 ImplSVMain svmain.cxx 229 0x7f67895bcfbe
    33 SVMain svmain.cxx 261 0x7f67895bf009
    34 soffice_main sofficemain.cxx 93 0x7f67927a5a73
    35 sal_main main.c 51 0x55fa1fbf7a5d
    36 main main.c 49 0x55fa1fbf7a37

Backtrace for second AT context creation:

    1 gtk_at_context_create gtkatcontext.c 671 0x7f677daf129e
    2 get_at_context a11y.cxx 806 0x7f677ec389b6
    3 gtk_accessible_get_at_context gtkaccessible.c 105 0x7f677dae2d4b
    4 gtk_accessible_platform_changed gtkaccessible.c 1081 0x7f677dae427d
    5 gtk_widget_set_focusable gtkwidget.c 5255 0x7f677dd65086
    6 GtkSalFrame::InitCommon gtkframe.cxx 1157 0x7f677edb9d15
    7 GtkSalFrame::Init gtkframe.cxx 1785 0x7f677edb7bca
    8 GtkSalFrame::GtkSalFrame gtkframe.cxx 510 0x7f677edb726d
    9 GtkInstance::CreateFrame gtkinst.cxx 273 0x7f677ec7cebc
    10 vcl::Window::ImplInit window.cxx 1057 0x7f6788cf7f49
    11 ImplBorderWindow::ImplInit brdwin.cxx 1555 0x7f6788a6d45b
    12 ImplBorderWindow::ImplBorderWindow brdwin.cxx 1584 0x7f6788a6da21
    13 VclPtrInstance<ImplBorderWindow>::VclPtrInstance<vcl::Window *&, SystemParentData *&, long&, BorderWindowStyle&> vclptr.hxx 280 0x7f6788d31049
    14 WorkWindow::ImplInit wrkwin.cxx 51 0x7f6788d2f809
    15 IntroWindow::IntroWindow introwin.cxx 35 0x7f6788bb7ee0
    16 (anonymous namespace)::SplashScreenWindow::SplashScreenWindow splash.cxx 122 0x7f677c1cee61
    17 VclPtr<(anonymous namespace)::SplashScreenWindow>::Create<(anonymous namespace)::SplashScreen *> vclptr.hxx 129 0x7f677c1cc86b
    18 (anonymous namespace)::SplashScreen::SplashScreen splash.cxx 145 0x7f677c1cc5f8
    19 desktop_SplashScreen_get_implementation splash.cxx 616 0x7f677c1cc4f9
    20 std::__invoke_impl<com::sun::star::uno::XInterface *, com::sun::star::uno::XInterface * ( *&)(com::sun::star::uno::XComponentContext *, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&), com::sun::star::uno::XComponentContext *, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&> invoke.h 61 0x7f67907ef7a8
    21 std::__invoke_r<com::sun::star::uno::XInterface *, com::sun::star::uno::XInterface * ( *&)(com::sun::star::uno::XComponentContext *, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&), com::sun::star::uno::XComponentContext *, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&> invoke.h 114 0x7f67907ef745
    22 std::_Function_handler<com::sun::star::uno::XInterface * (com::sun::star::uno::XComponentContext *, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&), com::sun::star::uno::XInterface * ( *)(com::sun::star::uno::XComponentContext *, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&)>::_M_invoke(std::_Any_data const&, com::sun::star::uno::XComponentContext *&&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) std_function.h 290 0x7f67907ef63d
    23 std::function<com::sun::star::uno::XInterface * (com::sun::star::uno::XComponentContext *, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&)>::operator()(com::sun::star::uno::XComponentContext *, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) const std_function.h 591 0x7f67907b6848
    24 cppuhelper::ServiceManager::Data::Implementation::doCreateInstanceWithArguments servicemanager.cxx 725 0x7f679079f26f
    25 cppuhelper::ServiceManager::Data::Implementation::createInstanceWithArguments servicemanager.cxx 696 0x7f679079f143
    26 cppuhelper::ServiceManager::createInstanceWithArgumentsAndContext servicemanager.cxx 1021 0x7f67907a56c5
    27 non-virtual thunk to cppuhelper::ServiceManager::createInstanceWithArgumentsAndContext(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) servicemanager.cxx 1022 0x7f67907a577c
    28 desktop::Desktop::OpenSplashScreen app.cxx 2449 0x7f6792723b2c
    29 desktop::Desktop::Main app.cxx 1299 0x7f6792721362
    30 ImplSVMain svmain.cxx 229 0x7f67895bcfbe
    31 SVMain svmain.cxx 261 0x7f67895bf009
    32 soffice_main sofficemain.cxx 93 0x7f67927a5a73
    33 sal_main main.c 51 0x55fa1fbf7a5d
    34 main main.c 49 0x55fa1fbf7a37

Backtrace of the segfault:

    Thread 1 received signal SIGSEGV, Segmentation fault.
    0x00007f677deaec8e in GTK_IS_ACCESSIBLE_TEXT (ptr=0x55fa21196bb0) at ../gtk/gtkaccessibletext.h:35
    35      G_DECLARE_INTERFACE (GtkAccessibleText, gtk_accessible_text, GTK, ACCESSIBLE_TEXT, GtkAccessible)
    (rr) bt
    #0  0x00007f677deaec8e in GTK_IS_ACCESSIBLE_TEXT (ptr=0x55fa21196bb0) at ../gtk/gtkaccessibletext.h:35
    #1  0x00007f677deb1d88 in gtk_atspi_connect_text_signals (accessible=0x55fa21196bb0, text_changed=0x7f677dea1365 <emit_text_changed>, selection_changed=0x7f677dea140b <emit_text_selection_changed>, data=0x55fa2119d860)
        at ../gtk/a11y/gtkatspitext.c:1037
    #2  0x00007f677dea2fea in register_object (root=0x55fa2119e210, context=0x55fa2119d860) at ../gtk/a11y/gtkatspicontext.c:1442
    #3  0x00007f677dea8138 in on_registration_reply (gobject=0x55fa21179030, result=0x55fa39240d80, user_data=0x55fa2117a4a0) at ../gtk/a11y/gtkatspiroot.c:531
    #4  0x00007f6783cc8ee3 in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
    #5  0x00007f6783cc9b83 in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
    #6  0x00007f6783d269da in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
    #7  0x00007f6783cc8ee3 in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
    #8  0x00007f6783cc8f1d in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
    #9  0x00007f6785b110d9 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #10 0x00007f6785b14317 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #11 0x00007f6785b14930 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #12 0x00007f677ec77d0f in GtkSalData::Yield(bool, bool) (this=0x55fa1fe8e000, bWait=true, bHandleAllCurrentEvents=false) at vcl/unx/gtk4/../gtk3/gtkdata.cxx:405
    #13 0x00007f677ec7dbd3 in GtkInstance::DoYield(bool, bool) (this=0x55fa1fe8deb0, bWait=true, bHandleAllCurrentEvents=false) at vcl/unx/gtk4/../gtk3/gtkinst.cxx:435
    #14 0x00007f678959a64c in ImplYield(bool, bool) (i_bWait=true, i_bAllEvents=false) at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:394
    #15 0x00007f6789599f5b in Application::Yield() () at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:482
    #16 0x00007f6789599cf2 in Application::Execute() () at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:369
    #17 0x00007f679272304c in desktop::Desktop::Main() (this=0x7ffdf3dcc768) at /home/michi/development/git/libreoffice/desktop/source/app/app.cxx:1615
    #18 0x00007f67895bcfbe in ImplSVMain() () at /home/michi/development/git/libreoffice/vcl/source/app/svmain.cxx:229
    #19 0x00007f67895bf009 in SVMain() () at /home/michi/development/git/libreoffice/vcl/source/app/svmain.cxx:261
    #20 0x00007f67927a5a73 in soffice_main() () at /home/michi/development/git/libreoffice/desktop/source/app/sofficemain.cxx:93
    #21 0x000055fa1fbf7a5d in sal_main () at /home/michi/development/git/libreoffice/desktop/source/app/main.c:51
    #22 0x000055fa1fbf7a37 in main (argc=2, argv=0x7ffdf3dcc978) at /home/michi/development/git/libreoffice/desktop/source/app/main.c:49

[1] https://docs.gtk.org/gtk4/property.Accessible.accessible-role.html

Change-Id: If4fdcd249aaada846934c3e967d654e3266ad73d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166709
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants