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

Master imath #34

Closed
wants to merge 18 commits into from
Closed

Conversation

jrheinlaender
Copy link

No description provided.

Change-Id: Ief3b41e74ebab7463b11f6d0ab7aa97a3b84c1ac
…d iMath

Change-Id: I5088e7ea45a90d727f6e072fe705058196abddee
Change-Id: Id80c8021b75cda92b9e40489d27688d535461d8e
Change-Id: I494bf826a6bbf2d52223b1def30c7463aea73721
Note: Currently symlinked to avoid duplication
Change-Id: Id9219fe0ec3f84d55ef79924e03a7647b7d918a4
Change-Id: I2eb9feab2da5fdad89088a46da7477fd58f74f6d
…talled

Change-Id: I7a642e2a4d9aefcc528833d34f841f43b77c42f5
Change-Id: I63b4339b061d25e16d31e1b0ee0fa3d8d0c6bd5b
Change-Id: I005d72ff10f4011d80b527c49b84d0372e2f37a8
Change-Id: I2c232c9d8021f51e1235fd4b3babb20058d37421
Change-Id: Ie1dbaf8e609bfcc929b9b74b04e20846c7af8a93
Change-Id: Iefed43e09b2a263d2cd8fa82a9daa7d6cd69c3c1
Change-Id: Iaba8a733a641aa177abc4a6939a795d8cc04c474
Change-Id: Ifd26ab2263cca7ea5b808a138e208a195ed19914
Change-Id: I2c83805876d5e4ba5f742f4ed859ae07944720a4
Change-Id: Ia6c8bf56a2445c4defde3a992eb292a19d56e1ee
Change-Id: I0ca7f595274a8fc3dd0569aeb244a61a0866ed9d
Change-Id: If1ff35f061b85f2275f1d02eac07a2fde9f6d5da
@github-actions
Copy link

Thank you for your contribution. We use GitHub as a read-only mirror, so please submit your patch into our own code review system: https://wiki.documentfoundation.org/Development/GetInvolved

@github-actions github-actions bot closed this Sep 18, 2022
jrheinlaender pushed a commit to jrheinlaender/lo-core that referenced this pull request Sep 18, 2022
PaintImmediately normally checks to see if there are paints pending
on any of the original candidates parents, and if there are, optimizes
painting by painting from the top windows that is avaiting being
painted.

But in JunitTest_sc_unoapi_3 sometimes the ScGridWindow parent of the
StatusBar happens to have outstanding paint requests when the immediate
paint of the StatusBar is requested and there is deadlock on calling
ScGridWindow::Paint where the soffice main thread wants to lock the
SolarMutex at

> #0: 0x00000001a110e270 libsystem_kernel.dylib`__psynch_cvwait + 8
> #1: 0x00000001a114883c libsystem_pthread.dylib`_pthread_cond_wait + 1236
> LibreOffice#2: 0x0000000101081dd8 libc++.1.0.dylib`std::__1::condition_variable::wait at ~/llvm/build/include/c++/v1/__threading_support:337:10
> LibreOffice#3: 0x0000000101081dd4 libc++.1.0.dylib`std::__1::condition_variable::wait at ~/github.com/llvm/llvm-project/libcxx/src/condition_variable.cpp:46:14
> LibreOffice#4: 0x0000000112a011d4 libvclplug_osxlo.dylib`void std::__1::condition_variable::wait<SalYieldMutex::doAcquire(unsigned int)::$_0> at ~/llvm/inst/include/c++/v1/__mutex_base:398:9
> LibreOffice#5: 0x0000000112a00f98 libvclplug_osxlo.dylib`SalYieldMutex::doAcquire at vcl/osx/salinst.cxx:221:36
> LibreOffice#6: 0x0000000115e6b920 libvcllo.dylib`comphelper::SolarMutex::acquire at include/comphelper/solarmutex.hxx:86:5
> LibreOffice#7: 0x0000000116637178 libvcllo.dylib`SalInstance::AcquireYieldMutex at vcl/source/app/salvtables.cxx:149:73
> LibreOffice#8: 0x00000001166f0c38 libvcllo.dylib`Application::AcquireSolarMutex at vcl/source/app/svapp.cxx:594:25
> LibreOffice#9: 0x0000000112a07b38 libvclplug_osxlo.dylib`SolarMutexReleaser::~SolarMutexReleaser at include/vcl/svapp.hxx:1447:29
> LibreOffice#10: 0x0000000112a03320 libvclplug_osxlo.dylib`SolarMutexReleaser::~SolarMutexReleaser at include/vcl/svapp.hxx:1447:27
> LibreOffice#11: 0x0000000112a02d40 libvclplug_osxlo.dylib`AquaSalInstance::DoYield at vcl/osx/salinst.cxx:559:9
> LibreOffice#12: 0x00000001166f01c0 libvcllo.dylib`ImplYield at vcl/source/app/svapp.cxx:475:48
> LibreOffice#13: 0x00000001166efbc8 libvcllo.dylib`Application::Yield at vcl/source/app/svapp.cxx:559:5
> LibreOffice#14: 0x00000001166ef958 libvcllo.dylib`Application::Execute at vcl/source/app/svapp.cxx:453:13
> LibreOffice#15: 0x00000001017a41a8 libsofficeapp.dylib`desktop::Desktop::Main at desktop/source/app/app.cxx:1604:13

while another thread

> #0: 0x00000001a110e270 libsystem_kernel.dylib`__psynch_cvwait + 8
> #1: 0x00000001a114883c libsystem_pthread.dylib`_pthread_cond_wait + 1236
> LibreOffice#2: 0x00000001a20e87c8 Foundation`-[NSOperation waitUntilFinished] + 580
> LibreOffice#3: 0x00000001a11d8210 CoreFoundation`_CFXNotificationPost + 812
> LibreOffice#4: 0x00000001a209dc98 Foundation`-[NSNotificationCenter postNotificationName:object:userInfo:] + 96
> LibreOffice#5: 0x00000001a3d6de0c AppKit`-[NSMenu insertItem:atIndex:] + 624
> LibreOffice#6: 0x00000001a3f92784 AppKit`-[NSApplication(NSServicesMenuPrivate) _fillSpellCheckerPopupButton:] + 1888
> LibreOffice#7: 0x00000001a3f91bf0 AppKit`-[NSSpellChecker _fillSpellCheckerPopupButton:] + 84
> LibreOffice#8: 0x00000001a3f90ae8 AppKit`-[NSSpellChecker init] + 284
> LibreOffice#9: 0x00000001a3f909bc AppKit`__36+[NSSpellChecker sharedSpellChecker]_block_invoke + 20
> LibreOffice#10: 0x00000001a0f841b4 libdispatch.dylib`_dispatch_client_callout + 20
> LibreOffice#11: 0x00000001a0f85a34 libdispatch.dylib`_dispatch_once_callout + 32
> LibreOffice#12: 0x00000001a3f909a4 AppKit`+[NSSpellChecker sharedSpellChecker] + 140
> LibreOffice#13: 0x000000028e51d364 libMacOSXSpelllo.dylib`MacSpellChecker::getLocales at lingucomponent/source/spellcheck/macosxspell/macspellimp.mm:117:42
> LibreOffice#14: 0x00000001120a99d8 liblnglo.dylib`LngSvcMgr::GetAvailableSpellSvcs_Impl at linguistic/source/lngsvcmgr.cxx:963:67
> LibreOffice#15: 0x00000001120ad1dc liblnglo.dylib`LngSvcMgr::getAvailableServices at linguistic/source/lngsvcmgr.cxx:1381:9
> LibreOffice#16: 0x00000001120ada4c liblnglo.dylib`LngSvcMgr::getAvailableLocales at linguistic/source/lngsvcmgr.cxx:1445:42
> LibreOffice#17: 0x00000001120a1d28 liblnglo.dylib`LngSvcMgr::UpdateAll at linguistic/source/lngsvcmgr.cxx:657:49
> LibreOffice#18: 0x00000001120a0fec liblnglo.dylib`LngSvcMgr::LngSvcMgr at linguistic/source/lngsvcmgr.cxx:414:5
> LibreOffice#19: 0x00000001120a2c50 liblnglo.dylib`LngSvcMgr::LngSvcMgr at linguistic/source/lngsvcmgr.cxx:402:1
> LibreOffice#20: 0x00000001120b1248 liblnglo.dylib`::linguistic_LngSvcMgr_get_implementation at linguistic/source/lngsvcmgr.cxx:1826:30
[...]
> LibreOffice#30: 0x000000010449a164 libeditenglo.dylib`com::sun::star::linguistic2::LinguServiceManager::create at workdir/UnoApiHeadersTarget/offapi/normal/com/sun/star/linguistic2/LinguServiceManager.hpp:38:129
> LibreOffice#31: 0x00000001044973d4 libeditenglo.dylib`GetLngSvcMgr_Impl at editeng/source/misc/unolingu.cxx:60:52
> LibreOffice#32: 0x000000010449bbb0 libeditenglo.dylib`(anonymous namespace)::SpellDummy_Impl::GetSpell_Impl at editeng/source/misc/unolingu.cxx:216:61
> LibreOffice#33: 0x000000010449b548 libeditenglo.dylib`(anonymous namespace)::SpellDummy_Impl::isValid at editeng/source/misc/unolingu.cxx:248:5
> LibreOffice#34: 0x000000010439f2a0 libeditenglo.dylib`ImpEditEngine::DoOnlineSpelling at editeng/source/editeng/impedit4.cxx:2268:37
> LibreOffice#35: 0x00000001042a3a14 libeditenglo.dylib`EditEngine::CompleteOnlineSpelling at editeng/source/editeng/editeng.cxx:2394:25
> LibreOffice#36: 0x000000028fb26974 libsclo.dylib`sc::SpellCheckContext::ensureResults at sc/source/ui/view/spellcheckcontext.cxx:339:15
> LibreOffice#37: 0x000000028fb2648c libsclo.dylib`sc::SpellCheckContext::isMisspelled const at sc/source/ui/view/spellcheckcontext.cxx:219:43
> LibreOffice#38: 0x000000028fabd63c libsclo.dylib`ScOutputData::LayoutStrings at sc/source/ui/view/output2.cxx:1640:61
> LibreOffice#39: 0x000000028fabc79c libsclo.dylib`ScOutputData::DrawStrings at sc/source/ui/view/output2.cxx:1471:5
> LibreOffice#40: 0x000000028fa788e4 libsclo.dylib`ScGridWindow::DrawContent at sc/source/ui/view/gridwin4.cxx:914:21
[...]
> #59: 0x0000000115d6a9c0 libvcllo.dylib`vcl::Window::ImplCallPaint at vcl/source/window/paint.cxx:623:1
> #60: 0x0000000115d6cc78 libvcllo.dylib`vcl::Window::PaintImmediately at vcl/source/window/paint.cxx:1335:24
> #61: 0x0000000115f47d7c libvcllo.dylib`StatusBar::StartProgressMode at vcl/source/window/status.cxx:1327:9
> #62: 0x00000001066ff8c4 libfwklo.dylib`framework::ProgressBarWrapper::start at framework/source/uielement/progressbarwrapper.cxx:111:21
> #63: 0x000000010671edfc libfwklo.dylib`framework::StatusIndicatorInterfaceWrapper::start at framework/source/uielement/statusindicatorinterfacewrapper.cxx:50:27
> #64: 0x00000001099ae138 libsfxlo.dylib`SfxProgress::SetState at sfx2/source/bastyp/progress.cxx:230:32
> #65: 0x000000028e94e558 libsclo.dylib`ScProgress::SetState at sc/inc/progress.hxx:85:52
> #66: 0x000000028ec7f954 libsclo.dylib`ScTable::Sort at sc/source/core/data/table3.cxx:1817:28
> #67: 0x000000028e931380 libsclo.dylib`ScDocument::Sort at sc/source/core/data/documen3.cxx:1450:23
> #68: 0x000000028f43ad90 libsclo.dylib`ScDBDocFunc::Sort at sc/source/ui/docshell/dbdocfun.cxx:611:14
> #69: 0x000000028f798e18 libsclo.dylib`ScCellRangeObj::sort at sc/source/ui/unoobj/cellsuno.cxx:5317:17
> #70: 0x0000000106268964 libgcc3_uno.dylib`callVirtualFunction at bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx:38:5
[...]
> #73: 0x000000012252f650 libbinaryurplo.dylib`binaryurp::IncomingRequest::execute_throw const at binaryurp/source/incomingrequest.cxx:236:13

Change-Id: Iecfbc7673a2c67851aede3f7ca8be24ee75d1b21
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139713
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
jrheinlaender pushed a commit to jrheinlaender/lo-core that referenced this pull request Sep 18, 2022
UITest_chart: tdf122011.tdf122011.test_tdf122011

ERROR: AddressSanitizer: heap-use-after-free on address 0x61e00007a13e at pc 0x7f9a88217e2b bp 0x7f9a901e7ab0 sp 0x7f9a901e7aa8
READ of size 1 at 0x61e00007a13e thread T53
    #0 ScDocument::IsInDtorClear() const sc/inc/document.hxx:2421:56
    #1 ScChart2DataSequence::ExternalRefListener::~ExternalRefListener() sc/source/ui/unoobj/chart2uno.cxx:2897:26
    LibreOffice#4 ScChart2DataSequence::~ScChart2DataSequence() sc/source/ui/unoobj/chart2uno.cxx:2458:1
    LibreOffice#6 cppu::OWeakObject::release() cppuhelper/source/weak.cxx:230:9
    LibreOffice#8 com::sun::star::uno::Reference<com::sun::star::chart2::data::XDataSequence>::~Reference() include/com/sun/star/uno/Reference.hxx:114:22
    LibreOffice#9 chart::LabeledDataSequence::~LabeledDataSequence() chart2/source/tools/LabeledDataSequence.cxx:89:1
    LibreOffice#11 cppu::OWeakObject::release() cppuhelper/source/weak.cxx:230:9
    LibreOffice#12 cppu::WeakImplHelper<com::sun::star::chart2::data::XLabeledDataSequence2, com::sun::star::lang::XServiceInfo>::release() include/cppuhelper/implbase.hxx:115:66
    LibreOffice#13 com::sun::star::uno::Reference<com::sun::star::chart2::data::XLabeledDataSequence>::~Reference() include/com/sun/star/uno/Reference.hxx:114:22
    LibreOffice#20 chart::DataSeries::~DataSeries() chart2/source/model/main/DataSeries.cxx:218:1
    LibreOffice#24 chart::DataSeries::release() chart2/source/model/main/DataSeries.cxx:537:1
    LibreOffice#25 rtl::Reference<chart::DataSeries>::~Reference() include/rtl/ref.hxx:129:22
    LibreOffice#32 std::__debug::vector<rtl::Reference<chart::DataSeries>, std::allocator<rtl::Reference<chart::DataSeries> > >::clear() /usr/bin/../lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11/debug/vector:720:9
    LibreOffice#33 chart::ChartType::~ChartType() chart2/source/model/template/ChartType.cxx:65:19
    LibreOffice#34 chart::ColumnChartType::~ColumnChartType() chart2/source/model/template/ColumnChartType.cxx:134:2
    LibreOffice#36 cppu::OWeakObject::release() cppuhelper/source/weak.cxx:230:9
    LibreOffice#38 chart::ChartType::release() chart2/source/model/template/ChartType.cxx:330:1
    LibreOffice#39 rtl::Reference<chart::ChartType>::~Reference() include/rtl/ref.hxx:129:22
    #46 chart::BaseCoordinateSystem::~BaseCoordinateSystem() chart2/source/model/main/BaseCoordinateSystem.cxx:185:1
    #47 chart::CartesianCoordinateSystem::~CartesianCoordinateSystem() chart2/source/model/main/CartesianCoordinateSystem.cxx:53:2
    #49 cppu::OWeakObject::release() cppuhelper/source/weak.cxx:230:9
    #51 chart::BaseCoordinateSystem::release() chart2/source/model/main/BaseCoordinateSystem.cxx:406:1
    #52 rtl::Reference<chart::BaseCoordinateSystem>::~Reference() include/rtl/ref.hxx:129:22
    #53 chart::VCoordinateSystem::~VCoordinateSystem() chart2/source/view/axes/VCoordinateSystem.cxx:89:1
    #55 chart::VCartesianCoordinateSystem::~VCartesianCoordinateSystem() chart2/source/view/axes/VCartesianCoordinateSystem.cxx:69:1
    #65 chart::ChartView::impl_deleteCoordinateSystems() chart2/source/view/main/ChartView.cxx:1091:20
    #66 chart::ChartView::~ChartView() chart2/source/view/main/ChartView.cxx:1085:5
    #68 cppu::OWeakObject::release() cppuhelper/source/weak.cxx:230:9
    #70 rtl::Reference<chart::ChartView>::~Reference() include/rtl/ref.hxx:129:22
    #71 chart::ChartModel::~ChartModel() chart2/source/model/main/ChartModel.cxx:183:1
    #73 cppu::OWeakObject::release() cppuhelper/source/weak.cxx:230:9
    #75 rtl::Reference<chart::ChartModel>::clear() include/rtl/ref.hxx:196:19
    #76 chart::CreationWizardUnoDlg::disposing() chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx:235:19
    #77 cppu::OComponentHelper::dispose() cppuhelper/source/component.cxx:161:17
    #78 chart::CreationWizardUnoDlg::notifyTermination(com::sun::star::lang::EventObject const&) chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx:140:5
    #79 framework::Desktop::impl_sendNotifyTerminationEvent() framework/source/services/desktop.cxx:1649:79
    #80 framework::Desktop::terminate() framework/source/services/desktop.cxx:282:13

0x61e00007a13e is located 2238 bytes inside of 2712-byte region [0x61e000079880,0x61e00007a318)
freed by thread T53 here:
    #0 0x4fe267 in operator delete(void*) (instdir/program/soffice.bin+0x4fe267)
    #1 ScDocShell::~ScDocShell() sc/source/ui/docshell/docsh.cxx:2899:1
    LibreOffice#2 SvRefBase::ReleaseRef() include/tools/ref.hxx:163:29
    LibreOffice#3 tools::SvRef<SfxObjectShell>::~SvRef() include/tools/ref.hxx:56:36
    LibreOffice#4 IMPL_SfxBaseModel_DataContainer::~IMPL_SfxBaseModel_DataContainer() sfx2/source/doc/sfxbasemodel.cxx:245:5
    LibreOffice#12 SfxBaseModel::dispose() sfx2/source/doc/sfxbasemodel.cxx:757:13
    LibreOffice#13 SfxBaseModel::close(unsigned char) sfx2/source/doc/sfxbasemodel.cxx:1482:5
    LibreOffice#14 SfxBaseModel::dispose() sfx2/source/doc/sfxbasemodel.cxx:718:13
    LibreOffice#15 gcc3::callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, double*) bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:77:5

Change-Id: I4ac7a702c50f9519a0f982ece9776c2d449c43ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132242
Tested-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit c87bbaa)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132183
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
jrheinlaender pushed a commit to jrheinlaender/lo-core that referenced this pull request Sep 18, 2022
See frame LibreOffice#5 and frame #45 where

both the same DNDEventDispatcher object and both functions lock m_aMutex which is a std::mutex since

commit 8de81db
Date:   Mon Aug 2 09:21:17 2021 +0200

    osl::Mutex->std::mutex in DNDEventDispatcher

 #0  0x00007ff094530c40 in __lll_lock_wait () at /lib64/libc.so.6
 #1  0x00007ff0945371d2 in pthread_mutex_lock@@GLIBC_2.2.5 () at /lib64/libc.so.6
 LibreOffice#2  0x00007ff08b901663 in __gthread_mutex_lock(pthread_mutex_t*) (__mutex=0x1a32c60)
     at /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/x86_64-redhat-linux/bits/gthr-default.h:749
 LibreOffice#3  0x00007ff08b9024d5 in std::mutex::lock() (this=0x1a32c60) at /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/std_mutex.h:100
 LibreOffice#4  0x00007ff08b9018f3 in std::scoped_lock<std::mutex>::scoped_lock(std::mutex&) (this=0x7ffdd0d79240, __m=...)
     at /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/mutex:731
 LibreOffice#5  0x00007ff08b9006a8 in DNDEventDispatcher::dragOver(com::sun::star::datatransfer::dnd::DropTargetDragEvent const&) (this=0x1a32c10, dtde=...)
     at vcl/source/window/dndeventdispatcher.cxx:156
 LibreOffice#6  0x00007ff075f47658 in GtkInstDropTarget::fire_dragOver(com::sun::star::datatransfer::dnd::DropTargetDragEvent const&) (this=0x199eb40, dtde=...)
     at vcl/unx/gtk3/gtkinst.cxx:1710
 LibreOffice#7  0x00007ff0760a7010 in GtkInstDropTarget::signalDragMotion(_GtkWidget*, _GdkDragContext*, int, int, unsigned int)
     (this=0x199eb40, pWidget=0x1c67e40, context=0x1957450, x=89, y=175, time=0) at vcl/unx/gtk3/gtkframe.cxx:5026
 LibreOffice#8  0x00007ff07609bb77 in GtkSalFrame::signalDragMotion(_GtkWidget*, _GdkDragContext*, int, int, unsigned int, void*)
     (pWidget=0x1c67e40, context=0x1957450, x=89, y=175, time=0, frame=0x19b7d70) at vcl/unx/gtk3/gtkframe.cxx:4922
 LibreOffice#9  0x00007ff075649527 in _gtk_marshal_BOOLEAN__OBJECT_INT_INT_UINTv () at /lib64/libgtk-3.so.0
 LibreOffice#10 0x00007ff0865dcd5b in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
 LibreOffice#11 0x00007ff0865ddeb8 in g_signal_emit_by_name () at /lib64/libgobject-2.0.so.0
 LibreOffice#12 0x00007ff07595b491 in gtk_drag_dest_motion.lto_priv () at /lib64/libgtk-3.so.0
 LibreOffice#13 0x00007ff0757b8f7d in gtk_main_do_event () at /lib64/libgtk-3.so.0
 LibreOffice#14 0x00007ff0754e5463 in _gdk_event_emit () at /lib64/libgdk-3.so.0
 LibreOffice#15 0x00007ff075518056 in gdk_event_source_dispatch () at /lib64/libgdk-3.so.0
 LibreOffice#16 0x00007ff0864c3faf in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
 LibreOffice#17 0x00007ff0865192c8 in g_main_context_iterate.constprop () at /lib64/libglib-2.0.so.0
 LibreOffice#18 0x00007ff0864c1940 in g_main_context_iteration () at /lib64/libglib-2.0.so.0
 LibreOffice#19 0x00007ff075f3e60f in GtkSalData::Yield(bool, bool) (this=0x952930, bWait=false, bHandleAllCurrentEvents=false) at vcl/unx/gtk3/gtkdata.cxx:405
 LibreOffice#20 0x00007ff075f43e43 in GtkInstance::DoYield(bool, bool) (this=0x9527e0, bWait=false, bHandleAllCurrentEvents=false) at vcl/unx/gtk3/gtkinst.cxx:428
 LibreOffice#21 0x00007ff08c2dc5df in ImplYield(bool, bool) (i_bWait=false, i_bAllEvents=false) at vcl/source/app/svapp.cxx:474
 LibreOffice#22 0x00007ff08c2dc24d in Application::Reschedule(bool) (i_bAllEvents=false) at vcl/source/app/svapp.cxx:493
 LibreOffice#23 0x00007ff091eeeb55 in SbiRuntime::Step() (this=0xa21eb20) at basic/source/runtime/runtime.cxx:801
 LibreOffice#24 0x00007ff091e0e659 in (anonymous namespace)::RunInitGuard::run() (this=0x76a6290) at basic/source/classes/sbxmod.cxx:1015
 LibreOffice#25 0x00007ff091e0d135 in SbModule::Run(SbMethod*) (this=0xa0ada00, pMeth=0xa16d7e0) at basic/source/classes/sbxmod.cxx:1176
 LibreOffice#26 0x00007ff091e0c503 in SbModule::Notify(SfxBroadcaster&, SfxHint const&) (this=0xa0ada00, rBC=..., rHint=...) at basic/source/classes/sbxmod.cxx:775
 LibreOffice#27 0x00007ff090b3ee6e in SfxBroadcaster::Broadcast(SfxHint const&) (this=0xa231de0, rHint=...) at svl/source/notify/SfxBroadcaster.cxx:39
 LibreOffice#28 0x00007ff091e1372e in SbMethod::Broadcast(SfxHintId) (this=0xa231ca0, nHintId=SfxHintId::BasicDataWanted) at basic/source/classes/sbxmod.cxx:2113
 LibreOffice#29 0x00007ff091f6ddfa in SbxObject::Call(rtl::OUString const&, SbxArray*) (this=0xa258670, rName="DTL_dragOver", pParam=0xa1e47d0)
     at basic/source/sbx/sbxobj.cxx:274
 LibreOffice#30 0x00007ff091d9dd76 in StarBASIC::Call(rtl::OUString const&, SbxArray*) (this=0xa258670, rName="DTL_dragOver", pParam=0xa1e47d0)
     at basic/source/classes/sb.cxx:1324
 LibreOffice#31 0x00007ff091dd7127 in (anonymous namespace)::BasicAllListener_Impl::firing_impl(com::sun::star::script::AllEventObject const&, com::sun::star::uno::Any*)
     (this=0xa2344a0, Event=..., pRet=0x0) at basic/source/classes/sbunoobj.cxx:3831
 LibreOffice#32 0x00007ff091dd6ba1 in (anonymous namespace)::BasicAllListener_Impl::firing(com::sun::star::script::AllEventObject const&) (this=0xa2344a0, Event=...)
     at basic/source/classes/sbunoobj.cxx:3855
 LibreOffice#33 0x00007ff091dd792f in (anonymous namespace)::InvocationToAllListenerMapper::invoke(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&, com::sun::star::uno::Sequence<short>&, com::sun::star::uno::Sequence<com::sun::star::uno::Any>&)
     (this=0xa110b70, FunctionName="dragOver", Params=uno::Sequence of length 1 = {...}) at basic/source/classes/sbunoobj.cxx:3983
 LibreOffice#34 0x00007ff091dd7be7 in non-virtual thunk to (anonymous namespace)::InvocationToAllListenerMapper::invoke(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&, com::sun::star::uno::Sequence<short>&, com::sun::star::uno::Sequence<com::sun::star::uno::Any>&) ()
     at /home/caolan/LibreOffice/core/instdir/program/libsblo.so
 LibreOffice#35 0x00007ff072d19921 in gcc3::callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, double*)
     (pThis=0xa110b98, nVtableIndex=4, pRegisterReturn=0x7ffdd0d7b5c0, pReturnTypeRef=0xa875c0, bSimpleReturn=false, pStack=0x7ffdd0d7b5e0, nStack=0, pGPR=0x7ffdd0d7b900, pFPR=0x7ffdd0d7b8c0) at bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:77
 LibreOffice#36 0x00007ff072d184fc in cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void*, void**, _uno_Any**)
     (pThis=0xa238bb0, aVtableSlot=..., pReturnTypeRef=0xa875c0, nParams=4, pParams=0x2470e40, pUnoReturn=0x7ffdd0d7bb80, pUnoArgs=0x7ffdd0d7bbb0, ppUnoExc=0x7ffdd0d7bb60) at bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:233
 LibreOffice#37 0x00007ff072d17c58 in unoInterfaceProxyDispatch(uno_Interface*, typelib_TypeDescription const*, void*, void**, uno_Any**)
     (pUnoI=0xa238bb0, pMemberDescr=0x24c98c0, pReturn=0x7ffdd0d7bb80, pArgs=0x7ffdd0d7bbb0, ppException=0x7ffdd0d7bb60)
     at bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:413
 LibreOffice#38 0x00007ff0472645ca in stoc_invadp::(anonymous namespace)::AdapterImpl::invoke(_typelib_TypeDescription const*, void*, void**, _uno_Any**)
     (this=0xa112060, pMemberType=0xa11be80, pReturn=0x7ffdd0d7c4f0, pArgs=0x7ffdd0d7bca0, ppException=0x7ffdd0d7bde0)
     at stoc/source/invocation_adapterfactory/iafactory.cxx:457
 LibreOffice#39 0x00007ff04726379d in stoc_invadp::adapter_dispatch(_uno_Interface*, _typelib_TypeDescription const*, void*, void**, _uno_Any**)
     (pUnoI=0xa118a50, pMemberType=0xa11be80, pReturn=0x7ffdd0d7c4f0, pArgs=0x7ffdd0d7bca0, ppException=0x7ffdd0d7bde0)
     at stoc/source/invocation_adapterfactory/iafactory.cxx:605
 LibreOffice#40 0x00007ff072d04e95 in cpp2uno_call(bridges::cpp_uno::shared::CppInterfaceProxy*, _typelib_TypeDescription const*, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void**, void**, void**, unsigned long*)
     (pThis=0xa11b350, pMemberTypeDescr=0xa11be80, pReturnTypeRef=0x939280, nParams=1, pParams=0xa112460, gpreg=0x7ffdd0d7c520, fpreg=0x7ffdd0d7c540, ovrflw=0x7ffdd0d7c590, pRegisterReturn=0x7ffdd0d7c4f0) at bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx:191
 LibreOffice#41 0x00007ff072d04611 in cpp_vtable_call(sal_Int32, sal_Int32, void**, void**, void**, sal_uInt64*)
     (nFunctionIndex=7, nVtableOffset=0, gpreg=0x7ffdd0d7c510, fpreg=0x7ffdd0d7c540, ovrflw=0x7ffdd0d7c590, pRegisterReturn=0x7ffdd0d7c4f0)
     at bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx:389
 LibreOffice#42 0x00007ff072d29836 in privateSnippetExecutor () at /home/caolan/LibreOffice/core/instdir/program/libgcc3_uno.so
 LibreOffice#43 0x00007ff08b903787 in DNDListenerContainer::fireDragOverEvent(com::sun::star::uno::Reference<com::sun::star::datatransfer::dnd::XDropTargetDragContext> const&, signed char, int, int, signed char)
     (this=0x5a444c0, context=uno::Reference to ((anonymous namespace)::GtkDropTargetDragContext *) 0xa1dda68, dropAction=1 '\001', locationX=89, locationY=33, sourceActions=3 '\003') at vcl/source/window/dndlistenercontainer.cxx:224
 #44 0x00007ff08b900b7d in DNDEventDispatcher::fireDragOverEvent(vcl::Window*, com::sun::star::uno::Reference<com::sun::star::datatransfer::dnd::XDropTargetDragContext> const&, signed char, Point const&, signed char)
     (pWindow=0x5a27060, xContext=uno::Reference to ((anonymous namespace)::GtkDropTargetDragContext *) 0xa1dda68, nDropAction=1 '\001', rLocation=Point = {...}, nSourceActions=3 '\003') at vcl/source/window/dndeventdispatcher.cxx:297
 #45 0x00007ff08b9007f5 in DNDEventDispatcher::dragOver(com::sun::star::datatransfer::dnd::DropTargetDragEvent const&) (this=0x1a32c10, dtde=...)
     at vcl/source/window/dndeventdispatcher.cxx:178
 #46 0x00007ff075f47658 in GtkInstDropTarget::fire_dragOver(com::sun::star::datatransfer::dnd::DropTargetDragEvent const&) (this=0x199eb40, dtde=...)
    at vcl/unx/gtk3/gtkinst.cxx:1710

Change-Id: I06f24ac50d6d029803d46974162e1afec898d866
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136391
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
dennisfrancis pushed a commit to dennisfrancis/core that referenced this pull request Oct 13, 2022
See frame LibreOffice#5 and frame #45 where

both the same DNDEventDispatcher object and both functions lock m_aMutex which is a std::mutex since

commit 8de81db
Date:   Mon Aug 2 09:21:17 2021 +0200

    osl::Mutex->std::mutex in DNDEventDispatcher

 #0  0x00007ff094530c40 in __lll_lock_wait () at /lib64/libc.so.6
 LibreOffice#1  0x00007ff0945371d2 in pthread_mutex_lock@@GLIBC_2.2.5 () at /lib64/libc.so.6
 LibreOffice#2  0x00007ff08b901663 in __gthread_mutex_lock(pthread_mutex_t*) (__mutex=0x1a32c60)
     at /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/x86_64-redhat-linux/bits/gthr-default.h:749
 LibreOffice#3  0x00007ff08b9024d5 in std::mutex::lock() (this=0x1a32c60) at /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/std_mutex.h:100
 LibreOffice#4  0x00007ff08b9018f3 in std::scoped_lock<std::mutex>::scoped_lock(std::mutex&) (this=0x7ffdd0d79240, __m=...)
     at /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/mutex:731
 LibreOffice#5  0x00007ff08b9006a8 in DNDEventDispatcher::dragOver(com::sun::star::datatransfer::dnd::DropTargetDragEvent const&) (this=0x1a32c10, dtde=...)
     at vcl/source/window/dndeventdispatcher.cxx:156
 LibreOffice#6  0x00007ff075f47658 in GtkInstDropTarget::fire_dragOver(com::sun::star::datatransfer::dnd::DropTargetDragEvent const&) (this=0x199eb40, dtde=...)
     at vcl/unx/gtk3/gtkinst.cxx:1710
 LibreOffice#7  0x00007ff0760a7010 in GtkInstDropTarget::signalDragMotion(_GtkWidget*, _GdkDragContext*, int, int, unsigned int)
     (this=0x199eb40, pWidget=0x1c67e40, context=0x1957450, x=89, y=175, time=0) at vcl/unx/gtk3/gtkframe.cxx:5026
 LibreOffice#8  0x00007ff07609bb77 in GtkSalFrame::signalDragMotion(_GtkWidget*, _GdkDragContext*, int, int, unsigned int, void*)
     (pWidget=0x1c67e40, context=0x1957450, x=89, y=175, time=0, frame=0x19b7d70) at vcl/unx/gtk3/gtkframe.cxx:4922
 LibreOffice#9  0x00007ff075649527 in _gtk_marshal_BOOLEAN__OBJECT_INT_INT_UINTv () at /lib64/libgtk-3.so.0
 LibreOffice#10 0x00007ff0865dcd5b in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
 LibreOffice#11 0x00007ff0865ddeb8 in g_signal_emit_by_name () at /lib64/libgobject-2.0.so.0
 LibreOffice#12 0x00007ff07595b491 in gtk_drag_dest_motion.lto_priv () at /lib64/libgtk-3.so.0
 LibreOffice#13 0x00007ff0757b8f7d in gtk_main_do_event () at /lib64/libgtk-3.so.0
 LibreOffice#14 0x00007ff0754e5463 in _gdk_event_emit () at /lib64/libgdk-3.so.0
 LibreOffice#15 0x00007ff075518056 in gdk_event_source_dispatch () at /lib64/libgdk-3.so.0
 LibreOffice#16 0x00007ff0864c3faf in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
 LibreOffice#17 0x00007ff0865192c8 in g_main_context_iterate.constprop () at /lib64/libglib-2.0.so.0
 LibreOffice#18 0x00007ff0864c1940 in g_main_context_iteration () at /lib64/libglib-2.0.so.0
 LibreOffice#19 0x00007ff075f3e60f in GtkSalData::Yield(bool, bool) (this=0x952930, bWait=false, bHandleAllCurrentEvents=false) at vcl/unx/gtk3/gtkdata.cxx:405
 LibreOffice#20 0x00007ff075f43e43 in GtkInstance::DoYield(bool, bool) (this=0x9527e0, bWait=false, bHandleAllCurrentEvents=false) at vcl/unx/gtk3/gtkinst.cxx:428
 LibreOffice#21 0x00007ff08c2dc5df in ImplYield(bool, bool) (i_bWait=false, i_bAllEvents=false) at vcl/source/app/svapp.cxx:474
 LibreOffice#22 0x00007ff08c2dc24d in Application::Reschedule(bool) (i_bAllEvents=false) at vcl/source/app/svapp.cxx:493
 LibreOffice#23 0x00007ff091eeeb55 in SbiRuntime::Step() (this=0xa21eb20) at basic/source/runtime/runtime.cxx:801
 LibreOffice#24 0x00007ff091e0e659 in (anonymous namespace)::RunInitGuard::run() (this=0x76a6290) at basic/source/classes/sbxmod.cxx:1015
 LibreOffice#25 0x00007ff091e0d135 in SbModule::Run(SbMethod*) (this=0xa0ada00, pMeth=0xa16d7e0) at basic/source/classes/sbxmod.cxx:1176
 LibreOffice#26 0x00007ff091e0c503 in SbModule::Notify(SfxBroadcaster&, SfxHint const&) (this=0xa0ada00, rBC=..., rHint=...) at basic/source/classes/sbxmod.cxx:775
 LibreOffice#27 0x00007ff090b3ee6e in SfxBroadcaster::Broadcast(SfxHint const&) (this=0xa231de0, rHint=...) at svl/source/notify/SfxBroadcaster.cxx:39
 LibreOffice#28 0x00007ff091e1372e in SbMethod::Broadcast(SfxHintId) (this=0xa231ca0, nHintId=SfxHintId::BasicDataWanted) at basic/source/classes/sbxmod.cxx:2113
 LibreOffice#29 0x00007ff091f6ddfa in SbxObject::Call(rtl::OUString const&, SbxArray*) (this=0xa258670, rName="DTL_dragOver", pParam=0xa1e47d0)
     at basic/source/sbx/sbxobj.cxx:274
 LibreOffice#30 0x00007ff091d9dd76 in StarBASIC::Call(rtl::OUString const&, SbxArray*) (this=0xa258670, rName="DTL_dragOver", pParam=0xa1e47d0)
     at basic/source/classes/sb.cxx:1324
 LibreOffice#31 0x00007ff091dd7127 in (anonymous namespace)::BasicAllListener_Impl::firing_impl(com::sun::star::script::AllEventObject const&, com::sun::star::uno::Any*)
     (this=0xa2344a0, Event=..., pRet=0x0) at basic/source/classes/sbunoobj.cxx:3831
 LibreOffice#32 0x00007ff091dd6ba1 in (anonymous namespace)::BasicAllListener_Impl::firing(com::sun::star::script::AllEventObject const&) (this=0xa2344a0, Event=...)
     at basic/source/classes/sbunoobj.cxx:3855
 LibreOffice#33 0x00007ff091dd792f in (anonymous namespace)::InvocationToAllListenerMapper::invoke(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&, com::sun::star::uno::Sequence<short>&, com::sun::star::uno::Sequence<com::sun::star::uno::Any>&)
     (this=0xa110b70, FunctionName="dragOver", Params=uno::Sequence of length 1 = {...}) at basic/source/classes/sbunoobj.cxx:3983
 LibreOffice#34 0x00007ff091dd7be7 in non-virtual thunk to (anonymous namespace)::InvocationToAllListenerMapper::invoke(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&, com::sun::star::uno::Sequence<short>&, com::sun::star::uno::Sequence<com::sun::star::uno::Any>&) ()
     at /home/caolan/LibreOffice/core/instdir/program/libsblo.so
 LibreOffice#35 0x00007ff072d19921 in gcc3::callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, double*)
     (pThis=0xa110b98, nVtableIndex=4, pRegisterReturn=0x7ffdd0d7b5c0, pReturnTypeRef=0xa875c0, bSimpleReturn=false, pStack=0x7ffdd0d7b5e0, nStack=0, pGPR=0x7ffdd0d7b900, pFPR=0x7ffdd0d7b8c0) at bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:77
 LibreOffice#36 0x00007ff072d184fc in cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void*, void**, _uno_Any**)
     (pThis=0xa238bb0, aVtableSlot=..., pReturnTypeRef=0xa875c0, nParams=4, pParams=0x2470e40, pUnoReturn=0x7ffdd0d7bb80, pUnoArgs=0x7ffdd0d7bbb0, ppUnoExc=0x7ffdd0d7bb60) at bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:233
 LibreOffice#37 0x00007ff072d17c58 in unoInterfaceProxyDispatch(uno_Interface*, typelib_TypeDescription const*, void*, void**, uno_Any**)
     (pUnoI=0xa238bb0, pMemberDescr=0x24c98c0, pReturn=0x7ffdd0d7bb80, pArgs=0x7ffdd0d7bbb0, ppException=0x7ffdd0d7bb60)
     at bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:413
 LibreOffice#38 0x00007ff0472645ca in stoc_invadp::(anonymous namespace)::AdapterImpl::invoke(_typelib_TypeDescription const*, void*, void**, _uno_Any**)
     (this=0xa112060, pMemberType=0xa11be80, pReturn=0x7ffdd0d7c4f0, pArgs=0x7ffdd0d7bca0, ppException=0x7ffdd0d7bde0)
     at stoc/source/invocation_adapterfactory/iafactory.cxx:457
 LibreOffice#39 0x00007ff04726379d in stoc_invadp::adapter_dispatch(_uno_Interface*, _typelib_TypeDescription const*, void*, void**, _uno_Any**)
     (pUnoI=0xa118a50, pMemberType=0xa11be80, pReturn=0x7ffdd0d7c4f0, pArgs=0x7ffdd0d7bca0, ppException=0x7ffdd0d7bde0)
     at stoc/source/invocation_adapterfactory/iafactory.cxx:605
 LibreOffice#40 0x00007ff072d04e95 in cpp2uno_call(bridges::cpp_uno::shared::CppInterfaceProxy*, _typelib_TypeDescription const*, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void**, void**, void**, unsigned long*)
     (pThis=0xa11b350, pMemberTypeDescr=0xa11be80, pReturnTypeRef=0x939280, nParams=1, pParams=0xa112460, gpreg=0x7ffdd0d7c520, fpreg=0x7ffdd0d7c540, ovrflw=0x7ffdd0d7c590, pRegisterReturn=0x7ffdd0d7c4f0) at bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx:191
 LibreOffice#41 0x00007ff072d04611 in cpp_vtable_call(sal_Int32, sal_Int32, void**, void**, void**, sal_uInt64*)
     (nFunctionIndex=7, nVtableOffset=0, gpreg=0x7ffdd0d7c510, fpreg=0x7ffdd0d7c540, ovrflw=0x7ffdd0d7c590, pRegisterReturn=0x7ffdd0d7c4f0)
     at bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx:389
 LibreOffice#42 0x00007ff072d29836 in privateSnippetExecutor () at /home/caolan/LibreOffice/core/instdir/program/libgcc3_uno.so
 LibreOffice#43 0x00007ff08b903787 in DNDListenerContainer::fireDragOverEvent(com::sun::star::uno::Reference<com::sun::star::datatransfer::dnd::XDropTargetDragContext> const&, signed char, int, int, signed char)
     (this=0x5a444c0, context=uno::Reference to ((anonymous namespace)::GtkDropTargetDragContext *) 0xa1dda68, dropAction=1 '\001', locationX=89, locationY=33, sourceActions=3 '\003') at vcl/source/window/dndlistenercontainer.cxx:224
 #44 0x00007ff08b900b7d in DNDEventDispatcher::fireDragOverEvent(vcl::Window*, com::sun::star::uno::Reference<com::sun::star::datatransfer::dnd::XDropTargetDragContext> const&, signed char, Point const&, signed char)
     (pWindow=0x5a27060, xContext=uno::Reference to ((anonymous namespace)::GtkDropTargetDragContext *) 0xa1dda68, nDropAction=1 '\001', rLocation=Point = {...}, nSourceActions=3 '\003') at vcl/source/window/dndeventdispatcher.cxx:297
 #45 0x00007ff08b9007f5 in DNDEventDispatcher::dragOver(com::sun::star::datatransfer::dnd::DropTargetDragEvent const&) (this=0x1a32c10, dtde=...)
     at vcl/source/window/dndeventdispatcher.cxx:178
 #46 0x00007ff075f47658 in GtkInstDropTarget::fire_dragOver(com::sun::star::datatransfer::dnd::DropTargetDragEvent const&) (this=0x199eb40, dtde=...)
    at vcl/unx/gtk3/gtkinst.cxx:1710

Change-Id: I06f24ac50d6d029803d46974162e1afec898d866
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136391
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
GeassCore pushed a commit to GeassCore/core that referenced this pull request Nov 12, 2022
See frame LibreOffice#5 and frame #45 where

both the same DNDEventDispatcher object and both functions lock m_aMutex which is a std::mutex since

commit 8de81db
Date:   Mon Aug 2 09:21:17 2021 +0200

    osl::Mutex->std::mutex in DNDEventDispatcher

 #0  0x00007ff094530c40 in __lll_lock_wait () at /lib64/libc.so.6
 LibreOffice#1  0x00007ff0945371d2 in pthread_mutex_lock@@GLIBC_2.2.5 () at /lib64/libc.so.6
 LibreOffice#2  0x00007ff08b901663 in __gthread_mutex_lock(pthread_mutex_t*) (__mutex=0x1a32c60)
     at /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/x86_64-redhat-linux/bits/gthr-default.h:749
 LibreOffice#3  0x00007ff08b9024d5 in std::mutex::lock() (this=0x1a32c60) at /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/std_mutex.h:100
 LibreOffice#4  0x00007ff08b9018f3 in std::scoped_lock<std::mutex>::scoped_lock(std::mutex&) (this=0x7ffdd0d79240, __m=...)
     at /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/mutex:731
 LibreOffice#5  0x00007ff08b9006a8 in DNDEventDispatcher::dragOver(com::sun::star::datatransfer::dnd::DropTargetDragEvent const&) (this=0x1a32c10, dtde=...)
     at vcl/source/window/dndeventdispatcher.cxx:156
 LibreOffice#6  0x00007ff075f47658 in GtkInstDropTarget::fire_dragOver(com::sun::star::datatransfer::dnd::DropTargetDragEvent const&) (this=0x199eb40, dtde=...)
     at vcl/unx/gtk3/gtkinst.cxx:1710
 LibreOffice#7  0x00007ff0760a7010 in GtkInstDropTarget::signalDragMotion(_GtkWidget*, _GdkDragContext*, int, int, unsigned int)
     (this=0x199eb40, pWidget=0x1c67e40, context=0x1957450, x=89, y=175, time=0) at vcl/unx/gtk3/gtkframe.cxx:5026
 LibreOffice#8  0x00007ff07609bb77 in GtkSalFrame::signalDragMotion(_GtkWidget*, _GdkDragContext*, int, int, unsigned int, void*)
     (pWidget=0x1c67e40, context=0x1957450, x=89, y=175, time=0, frame=0x19b7d70) at vcl/unx/gtk3/gtkframe.cxx:4922
 LibreOffice#9  0x00007ff075649527 in _gtk_marshal_BOOLEAN__OBJECT_INT_INT_UINTv () at /lib64/libgtk-3.so.0
 LibreOffice#10 0x00007ff0865dcd5b in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
 LibreOffice#11 0x00007ff0865ddeb8 in g_signal_emit_by_name () at /lib64/libgobject-2.0.so.0
 LibreOffice#12 0x00007ff07595b491 in gtk_drag_dest_motion.lto_priv () at /lib64/libgtk-3.so.0
 LibreOffice#13 0x00007ff0757b8f7d in gtk_main_do_event () at /lib64/libgtk-3.so.0
 LibreOffice#14 0x00007ff0754e5463 in _gdk_event_emit () at /lib64/libgdk-3.so.0
 LibreOffice#15 0x00007ff075518056 in gdk_event_source_dispatch () at /lib64/libgdk-3.so.0
 LibreOffice#16 0x00007ff0864c3faf in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
 LibreOffice#17 0x00007ff0865192c8 in g_main_context_iterate.constprop () at /lib64/libglib-2.0.so.0
 LibreOffice#18 0x00007ff0864c1940 in g_main_context_iteration () at /lib64/libglib-2.0.so.0
 LibreOffice#19 0x00007ff075f3e60f in GtkSalData::Yield(bool, bool) (this=0x952930, bWait=false, bHandleAllCurrentEvents=false) at vcl/unx/gtk3/gtkdata.cxx:405
 LibreOffice#20 0x00007ff075f43e43 in GtkInstance::DoYield(bool, bool) (this=0x9527e0, bWait=false, bHandleAllCurrentEvents=false) at vcl/unx/gtk3/gtkinst.cxx:428
 LibreOffice#21 0x00007ff08c2dc5df in ImplYield(bool, bool) (i_bWait=false, i_bAllEvents=false) at vcl/source/app/svapp.cxx:474
 LibreOffice#22 0x00007ff08c2dc24d in Application::Reschedule(bool) (i_bAllEvents=false) at vcl/source/app/svapp.cxx:493
 LibreOffice#23 0x00007ff091eeeb55 in SbiRuntime::Step() (this=0xa21eb20) at basic/source/runtime/runtime.cxx:801
 LibreOffice#24 0x00007ff091e0e659 in (anonymous namespace)::RunInitGuard::run() (this=0x76a6290) at basic/source/classes/sbxmod.cxx:1015
 LibreOffice#25 0x00007ff091e0d135 in SbModule::Run(SbMethod*) (this=0xa0ada00, pMeth=0xa16d7e0) at basic/source/classes/sbxmod.cxx:1176
 LibreOffice#26 0x00007ff091e0c503 in SbModule::Notify(SfxBroadcaster&, SfxHint const&) (this=0xa0ada00, rBC=..., rHint=...) at basic/source/classes/sbxmod.cxx:775
 LibreOffice#27 0x00007ff090b3ee6e in SfxBroadcaster::Broadcast(SfxHint const&) (this=0xa231de0, rHint=...) at svl/source/notify/SfxBroadcaster.cxx:39
 LibreOffice#28 0x00007ff091e1372e in SbMethod::Broadcast(SfxHintId) (this=0xa231ca0, nHintId=SfxHintId::BasicDataWanted) at basic/source/classes/sbxmod.cxx:2113
 LibreOffice#29 0x00007ff091f6ddfa in SbxObject::Call(rtl::OUString const&, SbxArray*) (this=0xa258670, rName="DTL_dragOver", pParam=0xa1e47d0)
     at basic/source/sbx/sbxobj.cxx:274
 LibreOffice#30 0x00007ff091d9dd76 in StarBASIC::Call(rtl::OUString const&, SbxArray*) (this=0xa258670, rName="DTL_dragOver", pParam=0xa1e47d0)
     at basic/source/classes/sb.cxx:1324
 LibreOffice#31 0x00007ff091dd7127 in (anonymous namespace)::BasicAllListener_Impl::firing_impl(com::sun::star::script::AllEventObject const&, com::sun::star::uno::Any*)
     (this=0xa2344a0, Event=..., pRet=0x0) at basic/source/classes/sbunoobj.cxx:3831
 LibreOffice#32 0x00007ff091dd6ba1 in (anonymous namespace)::BasicAllListener_Impl::firing(com::sun::star::script::AllEventObject const&) (this=0xa2344a0, Event=...)
     at basic/source/classes/sbunoobj.cxx:3855
 LibreOffice#33 0x00007ff091dd792f in (anonymous namespace)::InvocationToAllListenerMapper::invoke(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&, com::sun::star::uno::Sequence<short>&, com::sun::star::uno::Sequence<com::sun::star::uno::Any>&)
     (this=0xa110b70, FunctionName="dragOver", Params=uno::Sequence of length 1 = {...}) at basic/source/classes/sbunoobj.cxx:3983
 LibreOffice#34 0x00007ff091dd7be7 in non-virtual thunk to (anonymous namespace)::InvocationToAllListenerMapper::invoke(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&, com::sun::star::uno::Sequence<short>&, com::sun::star::uno::Sequence<com::sun::star::uno::Any>&) ()
     at /home/caolan/LibreOffice/core/instdir/program/libsblo.so
 LibreOffice#35 0x00007ff072d19921 in gcc3::callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, double*)
     (pThis=0xa110b98, nVtableIndex=4, pRegisterReturn=0x7ffdd0d7b5c0, pReturnTypeRef=0xa875c0, bSimpleReturn=false, pStack=0x7ffdd0d7b5e0, nStack=0, pGPR=0x7ffdd0d7b900, pFPR=0x7ffdd0d7b8c0) at bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:77
 LibreOffice#36 0x00007ff072d184fc in cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void*, void**, _uno_Any**)
     (pThis=0xa238bb0, aVtableSlot=..., pReturnTypeRef=0xa875c0, nParams=4, pParams=0x2470e40, pUnoReturn=0x7ffdd0d7bb80, pUnoArgs=0x7ffdd0d7bbb0, ppUnoExc=0x7ffdd0d7bb60) at bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:233
 LibreOffice#37 0x00007ff072d17c58 in unoInterfaceProxyDispatch(uno_Interface*, typelib_TypeDescription const*, void*, void**, uno_Any**)
     (pUnoI=0xa238bb0, pMemberDescr=0x24c98c0, pReturn=0x7ffdd0d7bb80, pArgs=0x7ffdd0d7bbb0, ppException=0x7ffdd0d7bb60)
     at bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:413
 LibreOffice#38 0x00007ff0472645ca in stoc_invadp::(anonymous namespace)::AdapterImpl::invoke(_typelib_TypeDescription const*, void*, void**, _uno_Any**)
     (this=0xa112060, pMemberType=0xa11be80, pReturn=0x7ffdd0d7c4f0, pArgs=0x7ffdd0d7bca0, ppException=0x7ffdd0d7bde0)
     at stoc/source/invocation_adapterfactory/iafactory.cxx:457
 LibreOffice#39 0x00007ff04726379d in stoc_invadp::adapter_dispatch(_uno_Interface*, _typelib_TypeDescription const*, void*, void**, _uno_Any**)
     (pUnoI=0xa118a50, pMemberType=0xa11be80, pReturn=0x7ffdd0d7c4f0, pArgs=0x7ffdd0d7bca0, ppException=0x7ffdd0d7bde0)
     at stoc/source/invocation_adapterfactory/iafactory.cxx:605
 LibreOffice#40 0x00007ff072d04e95 in cpp2uno_call(bridges::cpp_uno::shared::CppInterfaceProxy*, _typelib_TypeDescription const*, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void**, void**, void**, unsigned long*)
     (pThis=0xa11b350, pMemberTypeDescr=0xa11be80, pReturnTypeRef=0x939280, nParams=1, pParams=0xa112460, gpreg=0x7ffdd0d7c520, fpreg=0x7ffdd0d7c540, ovrflw=0x7ffdd0d7c590, pRegisterReturn=0x7ffdd0d7c4f0) at bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx:191
 LibreOffice#41 0x00007ff072d04611 in cpp_vtable_call(sal_Int32, sal_Int32, void**, void**, void**, sal_uInt64*)
     (nFunctionIndex=7, nVtableOffset=0, gpreg=0x7ffdd0d7c510, fpreg=0x7ffdd0d7c540, ovrflw=0x7ffdd0d7c590, pRegisterReturn=0x7ffdd0d7c4f0)
     at bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx:389
 LibreOffice#42 0x00007ff072d29836 in privateSnippetExecutor () at /home/caolan/LibreOffice/core/instdir/program/libgcc3_uno.so
 LibreOffice#43 0x00007ff08b903787 in DNDListenerContainer::fireDragOverEvent(com::sun::star::uno::Reference<com::sun::star::datatransfer::dnd::XDropTargetDragContext> const&, signed char, int, int, signed char)
     (this=0x5a444c0, context=uno::Reference to ((anonymous namespace)::GtkDropTargetDragContext *) 0xa1dda68, dropAction=1 '\001', locationX=89, locationY=33, sourceActions=3 '\003') at vcl/source/window/dndlistenercontainer.cxx:224
 #44 0x00007ff08b900b7d in DNDEventDispatcher::fireDragOverEvent(vcl::Window*, com::sun::star::uno::Reference<com::sun::star::datatransfer::dnd::XDropTargetDragContext> const&, signed char, Point const&, signed char)
     (pWindow=0x5a27060, xContext=uno::Reference to ((anonymous namespace)::GtkDropTargetDragContext *) 0xa1dda68, nDropAction=1 '\001', rLocation=Point = {...}, nSourceActions=3 '\003') at vcl/source/window/dndeventdispatcher.cxx:297
 #45 0x00007ff08b9007f5 in DNDEventDispatcher::dragOver(com::sun::star::datatransfer::dnd::DropTargetDragEvent const&) (this=0x1a32c10, dtde=...)
     at vcl/source/window/dndeventdispatcher.cxx:178
 #46 0x00007ff075f47658 in GtkInstDropTarget::fire_dragOver(com::sun::star::datatransfer::dnd::DropTargetDragEvent const&) (this=0x199eb40, dtde=...)
    at vcl/unx/gtk3/gtkinst.cxx:1710

Change-Id: I06f24ac50d6d029803d46974162e1afec898d866
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136390
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.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 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 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 Feb 12, 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 Feb 22, 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>
(cherry picked from commit a1f175f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146695
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
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 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
`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 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 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 May 18, 2024
Fixes this crash/assertion seen when starting Writer with
the qt6 VCL plugin with a fresh user profile with qtbase debug
build (as of commit 70a2e7f32b9f9ce19d1538f14fbde7b0d1e77ffd):

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

Change-Id: Ic611eb26b140c060cba4d81603e506806cf43bab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167778
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
tdf-gerrit pushed a commit that referenced this pull request May 18, 2024
Fixes this crash/assertion seen when starting Writer with
the qt6 VCL plugin with a fresh user profile with qtbase debug
build (as of commit 70a2e7f32b9f9ce19d1538f14fbde7b0d1e77ffd):

    ASSERT failure in QCoreApplication::sendEvent: "Cannot send events to objects owned by a different thread. Current thread 0x0x7fff9c454020. Receiver 'QtMainWindowClassWindow' (of type 'QWidgetWindow') was created in thread 0x0x55555560dc50", file /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp, line 547

    Thread 19 "soffice.bin" received signal SIGABRT, Aborted.
    [Switching to Thread 0x7fffada006c0 (LWP 10947)]
    __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
    44      ./nptl/pthread_kill.c: No such file or directory.
    (gdb) bt
    #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
    #1  0x00007ffff78a6b7f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
    #2  0x00007ffff78584e2 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
    #3  0x00007ffff78414ed in __GI_abort () at ./stdlib/abort.c:79
    #4  0x00007fffe34f95c9 in qAbort() () at /home/michi/development/git/qt5/qtbase/src/corelib/global/qassert.cpp:49
    #5  0x00007fffe350d459 in qt_message_fatal<QString&>(QtMsgType, QMessageLogContext const&, QString&) (context=..., message=...) at /home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:2112
    #6  0x00007fffe35063e6 in qt_message(QtMsgType, const QMessageLogContext &, const char *, typedef __va_list_tag __va_list_tag *)
        (msgType=QtFatalMsg, context=..., msg=0x7fffe3b8afa8 "ASSERT failure in %s: \"%s\", file %s, line %d", ap=0x7fffad9fb108) at /home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:380
    #7  0x00007fffe35084b1 in QMessageLogger::fatal(char const*, ...) const (this=0x7fffad9fb350, msg=0x7fffe3b8afa8 "ASSERT failure in %s: \"%s\", file %s, line %d")
        at /home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:880
    #8  0x00007fffe34f969c in qt_assert_x(char const*, char const*, char const*, int)
        (where=0x7fffe3bae469 "QCoreApplication::sendEvent", what=0x7fff9cd289a0 "Cannot send events to objects owned by a different thread. Current thread 0x0x7fff9c454020. Receiver 'QtMainWindowClassWindow' (of type 'QWidgetWindow') was created in thread 0x0x55555560dc50", file=0x7fffe3bae098 "/home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp", line=547) at /home/michi/development/git/qt5/qtbase/src/corelib/global/qassert.cpp:114
    #9  0x00007fffe35f54e6 in QCoreApplicationPrivate::checkReceiverThread(QObject*) (receiver=0x55555bb8b4a0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:547
    #10 0x00007fffe15a786e in QApplication::notify(QObject*, QEvent*) (this=0x55555560d9d0, receiver=0x55555bb8b4a0, e=0x7fffad9fb7f0) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:2580
    #11 0x00007fffe35f68be in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x55555bb8b4a0, event=0x7fffad9fb7f0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1154
    #12 0x00007fffe35f7677 in QCoreApplication::sendEvent(QObject*, QEvent*) (receiver=0x55555bb8b4a0, event=0x7fffad9fb7f0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1598
    #13 0x00007fffe24f6299 in QWindowPrivate::create(bool) (this=0x5555569bd9a0, recursive=false) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindow.cpp:589
    #14 0x00007fffe24f6759 in QWindow::create() (this=0x55555bb8b4a0) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindow.cpp:720
    #15 0x00007fffe1643f45 in QWidgetPrivate::create() (this=0x55555b24c140) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:1341
    #16 0x00007fffe16433c3 in QWidget::create(unsigned long long, bool, bool) (this=0x5555572554a0, window=0, initializeWindow=true, destroyOldWindow=true) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:1206
    #17 0x00007fffe1649dd5 in QWidget::setWindowState(QFlags<Qt::WindowState>) (this=0x5555572554a0, newstate=...) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:2946
    #18 0x00007fffe4235db6 in QtFrame::SetWindowStateImpl(QFlags<Qt::WindowState>) (this=0x55555bba8cf0, eState=...) at vcl/qt6/../qt5/QtFrame.cxx:340
    #19 0x00007fffe4237fc0 in QtFrame::SetWindowState(vcl::WindowData const*) (this=0x55555bba8cf0, pState=0x7fffad9fbdc0) at vcl/qt6/../qt5/QtFrame.cxx:677
    #20 0x00007fffee0a4c63 in SystemWindow::SetWindowState(vcl::WindowData const&) (this=0x7fff9d689d50, rData=...) at /home/michi/development/git/libreoffice/vcl/source/window/syswin.cxx:708
    #21 0x00007fffee0a5802 in SystemWindow::SetWindowState(std::basic_string_view<char16_t, std::char_traits<char16_t> >) (this=0x7fff9d689d50, rStr=u",,,;4;") at /home/michi/development/git/libreoffice/vcl/source/window/syswin.cxx:840
    #22 0x00007ffff4ddc4c4 in framework::LoadEnv::impl_applyPersistentWindowState(com::sun::star::uno::Reference<com::sun::star::awt::XWindow> const&) (this=0x7fffad9fcbb8, xWindow=uno::Reference to (VCLXTopWindow *) 0x7fff9c003810)
        at /home/michi/development/git/libreoffice/framework/source/loadenv/loadenv.cxx:1809
    #23 0x00007ffff4dd6f5b in framework::LoadEnv::impl_loadContent() (this=0x7fffad9fcbb8) at /home/michi/development/git/libreoffice/framework/source/loadenv/loadenv.cxx:1081
    #24 0x00007ffff4dd48e4 in framework::LoadEnv::start() (this=0x7fffad9fcbb8) at /home/michi/development/git/libreoffice/framework/source/loadenv/loadenv.cxx:412
    #25 0x00007ffff4dd21b2 in framework::LoadEnv::startLoading(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, rtl::OUString const&, int, LoadEnvFeatures)
        (this=0x7fffad9fcbb8, sURL="file:///home/michi/development/git/libreoffice/instdir/program/../program/opencl/cl-test.ods", lMediaDescriptor=uno::Sequence of length 1 = {...}, xBaseFrame=uno::Reference to (framework::Desktop *) 0x5555569d5c68, sTarget="_blank", nSearchFlags=0, eFeature=LoadEnvFeatures::NONE) at /home/michi/development/git/libreoffice/framework/source/loadenv/loadenv.cxx:308
    #26 0x00007ffff4dd0998 in framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference<com::sun::star::frame::XComponentLoader> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)
        (xLoader=uno::Reference to (framework::Desktop *) 0x5555569d5c78, xContext=uno::Reference to (cppu::(anonymous namespace)::ComponentContext *) 0x555555623d38, sURL="file:///home/michi/development/git/libreoffice/instdir/program/../program/opencl/cl-test.ods", sTarget="_blank", nSearchFlags=0, lArgs=uno::Sequence of length 1 = {...}) at /home/michi/development/git/libreoffice/framework/source/loadenv/loadenv.cxx:168
    #27 0x00007ffff4e06a3f in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)
        (this=0x5555569d5c00, sURL="file:///home/michi/development/git/libreoffice/instdir/program/../program/opencl/cl-test.ods", sTargetFrameName="_blank", nSearchFlags=0, lArguments=uno::Sequence of length 1 = {...})
        at /home/michi/development/git/libreoffice/framework/source/services/desktop.cxx:592
    #28 0x00007ffff4e06b34 in non-virtual thunk to framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) ()
        at /home/michi/development/git/libreoffice/instdir/program/libfwklo.so
    #29 0x00007ffff7ba9147 in desktop::testOpenCLCompute(com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> const&, rtl::OUString const&)
        (xDesktop=uno::Reference to (framework::Desktop *) 0x5555569d5c58, rURL="file:///home/michi/development/git/libreoffice/instdir/program/../program/opencl/cl-test.ods")
        at /home/michi/development/git/libreoffice/desktop/source/app/opencl.cxx:132
    #30 0x00007ffff7ba7f54 in desktop::Desktop::CheckOpenCLCompute(com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> const&) (xDesktop=uno::Reference to (framework::Desktop *) 0x5555569d5c58)
        at /home/michi/development/git/libreoffice/desktop/source/app/opencl.cxx:241
    #31 0x00007ffff7b5719d in std::__invoke_impl<void, void (*)(com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> const&), com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> >(std::__invoke_other, void (*&&)(com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> const&), com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2>&&)
        (__f=@0x555556fbe460: 0x7ffff7ba7760 <desktop::Desktop::CheckOpenCLCompute(com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> const&)>, __args=...)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:61
    #32 0x00007ffff7b5712d in std::__invoke<void (*)(com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> const&), com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> >(void (*&&)(com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> const&), com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2>&&)
        (__fn=@0x555556fbe460: 0x7ffff7ba7760 <desktop::Desktop::CheckOpenCLCompute(com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> const&)>, __args=...)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:96
    #33 0x00007ffff7b57102 in std::thread::_Invoker<std::tuple<void (*)(com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> const&), com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> > >::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) (this=0x555556fbe458) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_thread.h:292
    #34 0x00007ffff7b570c5 in std::thread::_Invoker<std::tuple<void (*)(com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> const&), com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> > >::operator()()
        (this=0x555556fbe458) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_thread.h:299
    #35 0x00007ffff7b56e69 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)(com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> const&), com::sun::star::uno::Reference<com::sun::star::frame::XDesktop2> > > >::_M_run() (this=0x555556fbe450) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_thread.h:244
    #36 0x00007ffff74dee24 in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
    #37 0x00007ffff78a4dbb in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:444
    #38 0x00007ffff79269f8 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

Change-Id: I35024670cf4e4a6c00762be71fa051cc9417ef75
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167779
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
tdf-gerrit pushed a commit that referenced this pull request Jun 1, 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 Jun 13, 2024
Trying to start LO with the gen/x11 VCL plugin in my KDE Plasma 5
Wayland session triggered this assert:

    soffice.bin: .../libreoffice/sal/rtl/strtmpl.hxx:148: sal_Int32 rtl::str::getLength(const T *) [T = char]: Assertion `pStr' failed.

    Thread 1 "soffice.bin" 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  0x00007ffff78a6b6f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
    #2  0x00007ffff78584e2 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
    #3  0x00007ffff78414ed in __GI_abort () at ./stdlib/abort.c:79
    #4  0x00007ffff7841415 in __assert_fail_base
        (fmt=0x7ffff79b7ba8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x7ffff7ea47e1 "pStr", file=file@entry=0x7ffff7e9fa78 ".../libreoffice/sal/rtl/strtmpl.hxx", line=line@entry=148, function=function@entry=0x7ffff7ea58ba "sal_Int32 rtl::str::getLength(const T *) [T = char]") at ./assert/assert.c:92
    #5  0x00007ffff7851002 in __assert_fail
        (assertion=0x7ffff7ea47e1 "pStr", file=0x7ffff7e9fa78 ".../libreoffice/sal/rtl/strtmpl.hxx", line=148, function=0x7ffff7ea58ba "sal_Int32 rtl::str::getLength(const T *) [T = char]") at ./assert/assert.c:101
    #6  0x00007ffff7f33e2b in rtl::str::getLength<char>(char const*) (pStr=0x0) at sal/rtl/strtmpl.hxx:148
    #7  0x00007ffff7f36ac9 in rtl::str::newFromStr<_rtl_String>(_rtl_String**, std::remove_extent<decltype (_rtl_String::buffer)>::type const*) (ppThis=0x7fffffff7970, pCharStr=0x0) at sal/rtl/strtmpl.hxx:862
    #8  0x00007ffff7f32e9d in rtl_string_newFromStr(rtl_String**, char const*) (ppThis=0x7fffffff7970, pCharStr=0x0) at .../libreoffice/sal/rtl/string.cxx:567
    #9  0x00007fffe46efea7 in rtl::OString::OString<char*>(char* const&, rtl::libreoffice_internal::CharPtrDetector<char*, rtl::libreoffice_internal::Dummy>::Type) (this=0x7fffffff7970, value=@0x7fffffff7978: 0x0)
        at include/rtl/string.hxx:315
    #10 0x00007fffe4711954 in SessionManagerClient::open(SalSession*) (pSession=0x5555567f1bf0) at .../libreoffice/vcl/unx/generic/app/sm.cxx:514
    #11 0x00007fffe4710f94 in X11SalInstance::CreateSalSession() (this=0x5555555ee3d0) at .../libreoffice/vcl/unx/generic/app/sm.cxx:73
    #12 0x00007fffee985cfc in (anonymous namespace)::VCLSession::VCLSession() (this=0x555556903480) at .../libreoffice/vcl/source/app/session.cxx:115
    #13 0x00007fffee985ba9 in com_sun_star_frame_VCLSessionManagerClient_get_implementation(com::sun::star::uno::XComponentContext*, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) ()
        at .../libreoffice/vcl/source/app/session.cxx:411
    #14 0x00007ffff5bed248 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=@0x5555557170f8: 0x7fffee985b80 <com_sun_star_frame_VCLSessionManagerClient_get_implementation(com::sun::star::uno::XComponentContext*, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&)>, __args=@0x7fffffff8600: 0x5555555e7f08, __args=empty uno::Sequence) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:61
    #15 0x00007ffff5bed1e5 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=@0x5555557170f8: 0x7fffee985b80 <com_sun_star_frame_VCLSessionManagerClient_get_implementation(com::sun::star::uno::XComponentContext*, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&)>, __args=@0x7fffffff8600: 0x5555555e7f08, __args=empty uno::Sequence) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:114
    #16 0x00007ffff5bed0dd 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=@0x7fffffff8600: 0x5555555e7f08, __args=empty uno::Sequence) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_function.h:290
    #17 0x00007ffff5bb8d98 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=0x5555557170f8, __args=0x5555555e7f08, __args=empty uno::Sequence) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_function.h:591
    #18 0x00007ffff5ba1599 in cppuhelper::ServiceManager::Data::Implementation::doCreateInstance(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&)
        (this=0x555555717040, context=uno::Reference to (cppu::(anonymous namespace)::ComponentContext *) 0x5555555e7f08) at .../libreoffice/cppuhelper/source/servicemanager.cxx:701
    #19 0x00007ffff5ba1461 in cppuhelper::ServiceManager::Data::Implementation::createInstance(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, bool)
        (this=0x555555717040, context=uno::Reference to (cppu::(anonymous namespace)::ComponentContext *) 0x5555555e7f08, singletonRequest=false) at .../libreoffice/cppuhelper/source/servicemanager.cxx:670
    #20 0x00007ffff5ba73ad in cppuhelper::ServiceManager::createInstanceWithContext(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&)
        (this=0x555555618b60, aServiceSpecifier="com.sun.star.frame.SessionManagerClient", Context=uno::Reference to (cppu::(anonymous namespace)::ComponentContext *) 0x5555555e7f08)
        at .../libreoffice/cppuhelper/source/servicemanager.cxx:1002
    #21 0x00007ffff5ba7d94 in non-virtual thunk to cppuhelper::ServiceManager::createInstanceWithContext(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) ()
        at .../libreoffice/instdir/program/libuno_cppuhelpergcc3.so.3
    #22 0x00007ffff4e6a528 in (anonymous namespace)::SessionListener::initialize(com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) (this=0x555556935c80, args=uno::Sequence of length 1 = {...})
        at .../libreoffice/framework/source/services/sessionlistener.cxx:254
    #23 0x00007ffff5ba1b79 in cppuhelper::ServiceManager::Data::Implementation::doCreateInstanceWithArguments(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) (this=0x555555684900, context=uno::Reference to (cppu::(anonymous namespace)::ComponentContext *) 0x5555555e7f08, arguments=uno::Sequence of length 1 = {...})
        at .../libreoffice/cppuhelper/source/servicemanager.cxx:727
    #24 0x00007ffff5ba19e3 in cppuhelper::ServiceManager::Data::Implementation::createInstanceWithArguments(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, bool, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) (this=0x555555684900, context=uno::Reference to (cppu::(anonymous namespace)::ComponentContext *) 0x5555555e7f08, singletonRequest=false, arguments=uno::Sequence of length 1 = {...})
        at .../libreoffice/cppuhelper/source/servicemanager.cxx:689
    #25 0x00007ffff5ba7e35 in 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&) (this=0x555555618b60, ServiceSpecifier="com.sun.star.frame.SessionListener", Arguments=uno::Sequence of length 1 = {...}, Context=uno::Reference to (cppu::(anonymous namespace)::ComponentContext *) 0x5555555e7f08)
        at .../libreoffice/cppuhelper/source/servicemanager.cxx:1014
    #26 0x00007ffff5ba7eec in 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&) () at .../libreoffice/cppuhelper/source/servicemanager.cxx:1015
    #27 0x00007ffff7b3787f in com::sun::star::frame::SessionListener::createWithOnQuitFlag(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, unsigned char)
        (the_context=uno::Reference to (cppu::(anonymous namespace)::ComponentContext *) 0x5555555e7f08, AllowUserInteractionOnQuit=0 '\000') at workdir/UnoApiHeadersTarget/offapi/normal/com/sun/star/frame/SessionListener.hpp:48
    #28 0x00007ffff7b2c353 in desktop::Desktop::OpenClients() () at .../libreoffice/desktop/source/app/app.cxx:2094
    #29 0x00007ffff7b2b0a3 in desktop::Desktop::OpenClients_Impl(void*) (this=0x7fffffffd708) at .../libreoffice/desktop/source/app/app.cxx:1952
    #30 0x00007ffff7b2939d in desktop::Desktop::LinkStubOpenClients_Impl(void*, void*) (instance=0x7fffffffd708, data=0x0) at .../libreoffice/desktop/source/app/app.cxx:1936
    --Type <RET> for more, q to quit, c to continue without paging--
    #31 0x00007fffee140c78 in Link<void*, void>::Call(void*) const (this=0x555556f67218, data=0x0) at include/tools/link.hxx:111
    #32 0x00007fffee13c959 in ImplHandleUserEvent(ImplSVEvent*) (pSVEvent=0x555556f67210) at .../libreoffice/vcl/source/window/winproc.cxx:2287
    #33 0x00007fffee139310 in ImplWindowFrameProc(vcl::Window*, SalEvent, void const*) (_pWindow=0x555556dcc250, nEvent=SalEvent::UserEvent, pEvent=0x555556f67210)
        at .../libreoffice/vcl/source/window/winproc.cxx:2851
    #34 0x00007fffeedb53e0 in SalFrame::CallCallback(SalEvent, void const*) const (this=0x5555568f41f0, nEvent=SalEvent::UserEvent, pEvent=0x555556f67210) at vcl/inc/salframe.hxx:312
    #35 0x00007fffeeddff6f in SalGenericDisplay::ProcessEvent(SalUserEventList::SalUserEvent) (this=0x5555567e8960, aEvent=...) at .../libreoffice/vcl/unx/generic/app/gendisp.cxx:66
    #36 0x00007fffee8d856d in SalUserEventList::DispatchUserEvents(bool)::$_0::operator()() const (this=0x7fffffffb240) at .../libreoffice/vcl/source/app/salusereventlist.cxx:119
    #37 0x00007fffee8d8414 in SalUserEventList::DispatchUserEvents(bool) (this=0x5555567e8960, bHandleAllCurrentEvents=false) at .../libreoffice/vcl/source/app/salusereventlist.cxx:120
    #38 0x00007fffeeddfec5 in SalGenericDisplay::DispatchInternalEvent(bool) (this=0x5555567e8960, bHandleAllCurrentEvent=false) at .../libreoffice/vcl/unx/generic/app/gendisp.cxx:51
    #39 0x00007fffe46feb44 in SalX11Display::Yield() (this=0x5555567e8960) at .../libreoffice/vcl/unx/generic/app/saldisp.cxx:1860
    #40 0x00007fffe46f2e97 in DisplayYield(int, void*) (fd=5, data=0x5555567e8960) at .../libreoffice/vcl/unx/generic/app/saldisp.cxx:321
    #41 0x00007fffe46ee64c in (anonymous namespace)::YieldEntry::HandleNextEvent() const (this=0x7fffe47fe078 <yieldTable+200>) at .../libreoffice/vcl/unx/generic/app/saldata.cxx:559
    #42 0x00007fffe46ede15 in SalXLib::Yield(bool, bool) (this=0x5555555ee6e0, bWait=true, bHandleAllCurrentEvents=false) at .../libreoffice/vcl/unx/generic/app/saldata.cxx:655
    #43 0x00007fffe470ce8d in X11SalInstance::DoYield(bool, bool) (this=0x5555555ee3d0, bWait=true, bHandleAllCurrentEvents=false) at .../libreoffice/vcl/unx/generic/app/salinst.cxx:192
    #44 0x00007fffee9b8e6c in ImplYield(bool, bool) (i_bWait=true, i_bAllEvents=false) at .../libreoffice/vcl/source/app/svapp.cxx:384
    #45 0x00007fffee9b877b in Application::Yield() () at .../libreoffice/vcl/source/app/svapp.cxx:472
    #46 0x00007fffee9b8512 in Application::Execute() () at .../libreoffice/vcl/source/app/svapp.cxx:359
    #47 0x00007ffff7b26f10 in desktop::Desktop::Main() (this=0x7fffffffd708) at .../libreoffice/desktop/source/app/app.cxx:1652
    #48 0x00007fffee9dba7e in ImplSVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:229
    #49 0x00007fffee9ddaa9 in SVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:261
    #50 0x00007ffff7baaa7c in soffice_main() () at .../libreoffice/desktop/source/app/sofficemain.cxx:99
    #51 0x0000555555555a5d in sal_main () at .../libreoffice/desktop/source/app/main.c:51
    #52 0x0000555555555a37 in main (argc=2, argv=0x7fffffffd918) at .../libreoffice/desktop/source/app/main.c:49

`SmcOpenConnection` in frame 10 above failed, `pClientID` is null:

    (gdb) frame 10
    #10 0x00007fffe4711954 in SessionManagerClient::open (pSession=0x5555567f1bf0) at .../libreoffice/vcl/unx/generic/app/sm.cxx:514
    514                 m_aClientID = OString(pClientID);
    (gdb) p pClientID
    $1 = 0x0
    (gdb) l
    509                                                       aErrBuf );
    510                 if( !m_pSmcConnection )
    511                     SAL_INFO("vcl.sm.debug", "  SmcOpenConnection failed: " << aErrBuf);
    512                 else
    513                     SAL_INFO("vcl.sm.debug", "  SmcOpenConnection succeeded, client ID is " << pClientID );
    514                 m_aClientID = OString(pClientID);
    515                 free( pClientID );
    516                 pClientID = nullptr;
    517             }
    518
    (gdb) p aErrBuf
    $2 = "None of the authentication protocols specified are supported", '\000' <repeats 963 times>

Add a null check.

Quoting from [1]:

> If SmcOpenConnection succeeds, it returns an opaque connection pointer of type SmcConn and
> the client_id_ret argument contains the client ID to be used for this session.

[1] https://www.x.org/releases/X11R7.6/doc/libSM/SMlib.html

Change-Id: I412b5a68e88548718231354b0410c56bc0f0bb90
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168771
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
tdf-gerrit pushed a commit that referenced this pull request Jun 13, 2024
Trying to start LO with the gen/x11 VCL plugin in my KDE Plasma 5
Wayland session triggered this assert:

    soffice.bin: .../libreoffice/sal/rtl/strtmpl.hxx:148: sal_Int32 rtl::str::getLength(const T *) [T = char]: Assertion `pStr' failed.

    Thread 1 "soffice.bin" 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  0x00007ffff78a6b6f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
    #2  0x00007ffff78584e2 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
    #3  0x00007ffff78414ed in __GI_abort () at ./stdlib/abort.c:79
    #4  0x00007ffff7841415 in __assert_fail_base
        (fmt=0x7ffff79b7ba8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x7ffff7ea47e1 "pStr", file=file@entry=0x7ffff7e9fa78 ".../libreoffice/sal/rtl/strtmpl.hxx", line=line@entry=148, function=function@entry=0x7ffff7ea58ba "sal_Int32 rtl::str::getLength(const T *) [T = char]") at ./assert/assert.c:92
    #5  0x00007ffff7851002 in __assert_fail
        (assertion=0x7ffff7ea47e1 "pStr", file=0x7ffff7e9fa78 ".../libreoffice/sal/rtl/strtmpl.hxx", line=148, function=0x7ffff7ea58ba "sal_Int32 rtl::str::getLength(const T *) [T = char]") at ./assert/assert.c:101
    #6  0x00007ffff7f33e2b in rtl::str::getLength<char>(char const*) (pStr=0x0) at sal/rtl/strtmpl.hxx:148
    #7  0x00007ffff7f36ac9 in rtl::str::newFromStr<_rtl_String>(_rtl_String**, std::remove_extent<decltype (_rtl_String::buffer)>::type const*) (ppThis=0x7fffffff7970, pCharStr=0x0) at sal/rtl/strtmpl.hxx:862
    #8  0x00007ffff7f32e9d in rtl_string_newFromStr(rtl_String**, char const*) (ppThis=0x7fffffff7970, pCharStr=0x0) at .../libreoffice/sal/rtl/string.cxx:567
    #9  0x00007fffe46efea7 in rtl::OString::OString<char*>(char* const&, rtl::libreoffice_internal::CharPtrDetector<char*, rtl::libreoffice_internal::Dummy>::Type) (this=0x7fffffff7970, value=@0x7fffffff7978: 0x0)
        at include/rtl/string.hxx:315
    #10 0x00007fffe4711954 in SessionManagerClient::open(SalSession*) (pSession=0x5555567f1bf0) at .../libreoffice/vcl/unx/generic/app/sm.cxx:514
    #11 0x00007fffe4710f94 in X11SalInstance::CreateSalSession() (this=0x5555555ee3d0) at .../libreoffice/vcl/unx/generic/app/sm.cxx:73
    #12 0x00007fffee985cfc in (anonymous namespace)::VCLSession::VCLSession() (this=0x555556903480) at .../libreoffice/vcl/source/app/session.cxx:115
    #13 0x00007fffee985ba9 in com_sun_star_frame_VCLSessionManagerClient_get_implementation(com::sun::star::uno::XComponentContext*, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) ()
        at .../libreoffice/vcl/source/app/session.cxx:411
    #14 0x00007ffff5bed248 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=@0x5555557170f8: 0x7fffee985b80 <com_sun_star_frame_VCLSessionManagerClient_get_implementation(com::sun::star::uno::XComponentContext*, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&)>, __args=@0x7fffffff8600: 0x5555555e7f08, __args=empty uno::Sequence) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:61
    #15 0x00007ffff5bed1e5 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=@0x5555557170f8: 0x7fffee985b80 <com_sun_star_frame_VCLSessionManagerClient_get_implementation(com::sun::star::uno::XComponentContext*, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&)>, __args=@0x7fffffff8600: 0x5555555e7f08, __args=empty uno::Sequence) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:114
    #16 0x00007ffff5bed0dd 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=@0x7fffffff8600: 0x5555555e7f08, __args=empty uno::Sequence) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_function.h:290
    #17 0x00007ffff5bb8d98 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=0x5555557170f8, __args=0x5555555e7f08, __args=empty uno::Sequence) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_function.h:591
    #18 0x00007ffff5ba1599 in cppuhelper::ServiceManager::Data::Implementation::doCreateInstance(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&)
        (this=0x555555717040, context=uno::Reference to (cppu::(anonymous namespace)::ComponentContext *) 0x5555555e7f08) at .../libreoffice/cppuhelper/source/servicemanager.cxx:701
    #19 0x00007ffff5ba1461 in cppuhelper::ServiceManager::Data::Implementation::createInstance(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, bool)
        (this=0x555555717040, context=uno::Reference to (cppu::(anonymous namespace)::ComponentContext *) 0x5555555e7f08, singletonRequest=false) at .../libreoffice/cppuhelper/source/servicemanager.cxx:670
    #20 0x00007ffff5ba73ad in cppuhelper::ServiceManager::createInstanceWithContext(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&)
        (this=0x555555618b60, aServiceSpecifier="com.sun.star.frame.SessionManagerClient", Context=uno::Reference to (cppu::(anonymous namespace)::ComponentContext *) 0x5555555e7f08)
        at .../libreoffice/cppuhelper/source/servicemanager.cxx:1002
    #21 0x00007ffff5ba7d94 in non-virtual thunk to cppuhelper::ServiceManager::createInstanceWithContext(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) ()
        at .../libreoffice/instdir/program/libuno_cppuhelpergcc3.so.3
    #22 0x00007ffff4e6a528 in (anonymous namespace)::SessionListener::initialize(com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) (this=0x555556935c80, args=uno::Sequence of length 1 = {...})
        at .../libreoffice/framework/source/services/sessionlistener.cxx:254
    #23 0x00007ffff5ba1b79 in cppuhelper::ServiceManager::Data::Implementation::doCreateInstanceWithArguments(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) (this=0x555555684900, context=uno::Reference to (cppu::(anonymous namespace)::ComponentContext *) 0x5555555e7f08, arguments=uno::Sequence of length 1 = {...})
        at .../libreoffice/cppuhelper/source/servicemanager.cxx:727
    #24 0x00007ffff5ba19e3 in cppuhelper::ServiceManager::Data::Implementation::createInstanceWithArguments(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, bool, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) (this=0x555555684900, context=uno::Reference to (cppu::(anonymous namespace)::ComponentContext *) 0x5555555e7f08, singletonRequest=false, arguments=uno::Sequence of length 1 = {...})
        at .../libreoffice/cppuhelper/source/servicemanager.cxx:689
    #25 0x00007ffff5ba7e35 in 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&) (this=0x555555618b60, ServiceSpecifier="com.sun.star.frame.SessionListener", Arguments=uno::Sequence of length 1 = {...}, Context=uno::Reference to (cppu::(anonymous namespace)::ComponentContext *) 0x5555555e7f08)
        at .../libreoffice/cppuhelper/source/servicemanager.cxx:1014
    #26 0x00007ffff5ba7eec in 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&) () at .../libreoffice/cppuhelper/source/servicemanager.cxx:1015
    #27 0x00007ffff7b3787f in com::sun::star::frame::SessionListener::createWithOnQuitFlag(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, unsigned char)
        (the_context=uno::Reference to (cppu::(anonymous namespace)::ComponentContext *) 0x5555555e7f08, AllowUserInteractionOnQuit=0 '\000') at workdir/UnoApiHeadersTarget/offapi/normal/com/sun/star/frame/SessionListener.hpp:48
    #28 0x00007ffff7b2c353 in desktop::Desktop::OpenClients() () at .../libreoffice/desktop/source/app/app.cxx:2094
    #29 0x00007ffff7b2b0a3 in desktop::Desktop::OpenClients_Impl(void*) (this=0x7fffffffd708) at .../libreoffice/desktop/source/app/app.cxx:1952
    #30 0x00007ffff7b2939d in desktop::Desktop::LinkStubOpenClients_Impl(void*, void*) (instance=0x7fffffffd708, data=0x0) at .../libreoffice/desktop/source/app/app.cxx:1936
    --Type <RET> for more, q to quit, c to continue without paging--
    #31 0x00007fffee140c78 in Link<void*, void>::Call(void*) const (this=0x555556f67218, data=0x0) at include/tools/link.hxx:111
    #32 0x00007fffee13c959 in ImplHandleUserEvent(ImplSVEvent*) (pSVEvent=0x555556f67210) at .../libreoffice/vcl/source/window/winproc.cxx:2287
    #33 0x00007fffee139310 in ImplWindowFrameProc(vcl::Window*, SalEvent, void const*) (_pWindow=0x555556dcc250, nEvent=SalEvent::UserEvent, pEvent=0x555556f67210)
        at .../libreoffice/vcl/source/window/winproc.cxx:2851
    #34 0x00007fffeedb53e0 in SalFrame::CallCallback(SalEvent, void const*) const (this=0x5555568f41f0, nEvent=SalEvent::UserEvent, pEvent=0x555556f67210) at vcl/inc/salframe.hxx:312
    #35 0x00007fffeeddff6f in SalGenericDisplay::ProcessEvent(SalUserEventList::SalUserEvent) (this=0x5555567e8960, aEvent=...) at .../libreoffice/vcl/unx/generic/app/gendisp.cxx:66
    #36 0x00007fffee8d856d in SalUserEventList::DispatchUserEvents(bool)::$_0::operator()() const (this=0x7fffffffb240) at .../libreoffice/vcl/source/app/salusereventlist.cxx:119
    #37 0x00007fffee8d8414 in SalUserEventList::DispatchUserEvents(bool) (this=0x5555567e8960, bHandleAllCurrentEvents=false) at .../libreoffice/vcl/source/app/salusereventlist.cxx:120
    #38 0x00007fffeeddfec5 in SalGenericDisplay::DispatchInternalEvent(bool) (this=0x5555567e8960, bHandleAllCurrentEvent=false) at .../libreoffice/vcl/unx/generic/app/gendisp.cxx:51
    #39 0x00007fffe46feb44 in SalX11Display::Yield() (this=0x5555567e8960) at .../libreoffice/vcl/unx/generic/app/saldisp.cxx:1860
    #40 0x00007fffe46f2e97 in DisplayYield(int, void*) (fd=5, data=0x5555567e8960) at .../libreoffice/vcl/unx/generic/app/saldisp.cxx:321
    #41 0x00007fffe46ee64c in (anonymous namespace)::YieldEntry::HandleNextEvent() const (this=0x7fffe47fe078 <yieldTable+200>) at .../libreoffice/vcl/unx/generic/app/saldata.cxx:559
    #42 0x00007fffe46ede15 in SalXLib::Yield(bool, bool) (this=0x5555555ee6e0, bWait=true, bHandleAllCurrentEvents=false) at .../libreoffice/vcl/unx/generic/app/saldata.cxx:655
    #43 0x00007fffe470ce8d in X11SalInstance::DoYield(bool, bool) (this=0x5555555ee3d0, bWait=true, bHandleAllCurrentEvents=false) at .../libreoffice/vcl/unx/generic/app/salinst.cxx:192
    #44 0x00007fffee9b8e6c in ImplYield(bool, bool) (i_bWait=true, i_bAllEvents=false) at .../libreoffice/vcl/source/app/svapp.cxx:384
    #45 0x00007fffee9b877b in Application::Yield() () at .../libreoffice/vcl/source/app/svapp.cxx:472
    #46 0x00007fffee9b8512 in Application::Execute() () at .../libreoffice/vcl/source/app/svapp.cxx:359
    #47 0x00007ffff7b26f10 in desktop::Desktop::Main() (this=0x7fffffffd708) at .../libreoffice/desktop/source/app/app.cxx:1652
    #48 0x00007fffee9dba7e in ImplSVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:229
    #49 0x00007fffee9ddaa9 in SVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:261
    #50 0x00007ffff7baaa7c in soffice_main() () at .../libreoffice/desktop/source/app/sofficemain.cxx:99
    #51 0x0000555555555a5d in sal_main () at .../libreoffice/desktop/source/app/main.c:51
    #52 0x0000555555555a37 in main (argc=2, argv=0x7fffffffd918) at .../libreoffice/desktop/source/app/main.c:49

`SmcOpenConnection` in frame 10 above failed, `pClientID` is null:

    (gdb) frame 10
    #10 0x00007fffe4711954 in SessionManagerClient::open (pSession=0x5555567f1bf0) at .../libreoffice/vcl/unx/generic/app/sm.cxx:514
    514                 m_aClientID = OString(pClientID);
    (gdb) p pClientID
    $1 = 0x0
    (gdb) l
    509                                                       aErrBuf );
    510                 if( !m_pSmcConnection )
    511                     SAL_INFO("vcl.sm.debug", "  SmcOpenConnection failed: " << aErrBuf);
    512                 else
    513                     SAL_INFO("vcl.sm.debug", "  SmcOpenConnection succeeded, client ID is " << pClientID );
    514                 m_aClientID = OString(pClientID);
    515                 free( pClientID );
    516                 pClientID = nullptr;
    517             }
    518
    (gdb) p aErrBuf
    $2 = "None of the authentication protocols specified are supported", '\000' <repeats 963 times>

Add a null check.

Quoting from [1]:

> If SmcOpenConnection succeeds, it returns an opaque connection pointer of type SmcConn and
> the client_id_ret argument contains the client ID to be used for this session.

[1] https://www.x.org/releases/X11R7.6/doc/libSM/SMlib.html

Change-Id: I412b5a68e88548718231354b0410c56bc0f0bb90
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168771
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
(cherry picked from commit 542e590)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168796
tdf-gerrit pushed a commit that referenced this pull request Jun 19, 2024
...in code newly introduced in 135ce25
"tdf#146487 Don't show generic diagram title when there is an empty title
given", which caused CppunitTest_chart2_export2 to fail with

> /oox/inc/drawingml/chart/plotareaconverter.hxx:78:62: runtime error: load of value 222, which is not a valid value for type 'bool'
>     #0 0x7f95cd9ed87c in oox::drawingml::chart::PlotAreaConverter::isSingleSeriesTitle() const /oox/inc/drawingml/chart/plotareaconverter.hxx:78:62
>     #1 0x7f95cd9e506f in oox::drawingml::chart::ChartSpaceConverter::convertFromModel(com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&, com::sun::star::awt::Point const&) /oox/source/drawingml/chart/chartspaceconverter.cxx:189:53
>     #2 0x7f95cd9b6c34 in oox::drawingml::chart::ChartConverter::convertFromModel(oox::core::XmlFilterBase&, oox::drawingml::chart::ChartSpaceModel&, com::sun::star::uno::Reference<com::sun::star::chart2::XChartDocument> const&, com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&, com::sun::star::awt::Point const&, com::sun::star::awt::Size const&) /oox/source/drawingml/chart/chartconverter.cxx:93:20
>     #3 0x7f95ce548f59 in oox::drawingml::Shape::finalizeXShape(oox::core::XmlFilterBase&, com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&) /oox/source/drawingml/shape.cxx:2245:50
>     #4 0x7f95438150b2 in oox::xls::Shape::finalizeXShape(oox::core::XmlFilterBase&, com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&) /sc/source/filter/oox/drawingfragment.cxx:113:30
>     #5 0x7f95ce5267bb in oox::drawingml::Shape::createAndInsert(oox::core::XmlFilterBase&, rtl::OUString const&, oox::drawingml::Theme const*, com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&, bool, bool, basegfx::B2DHomMatrix&, oox::drawingml::FillProperties const&, std::shared_ptr<oox::drawingml::Shape>) /oox/source/drawingml/shape.cxx:1964:9
>     #6 0x7f95ce4edb54 in oox::drawingml::Shape::addShape(oox::core::XmlFilterBase&, oox::drawingml::Theme const*, com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&, basegfx::B2DHomMatrix const&, oox::drawingml::FillProperties const&, std::__debug::map<rtl::OUString, std::shared_ptr<oox::drawingml::Shape>, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, std::shared_ptr<oox::drawingml::Shape> > > >*, std::shared_ptr<oox::drawingml::Shape>) /oox/source/drawingml/shape.cxx:366:41
>     #7 0x7f954381ef79 in oox::xls::DrawingFragment::onEndElement() /sc/source/filter/oox/drawingfragment.cxx:335:30
>     #8 0x7f95cdcaee54 in oox::core::ContextHandler2Helper::implEndElement(int) /oox/source/core/contexthandler2.cxx:125:9
>     #9 0x7f95cdd5c116 in oox::core::FragmentHandler2::endFastElement(int) /oox/source/core/fragmenthandler2.cxx:91:5
>     #10 0x7f95caf68fca in (anonymous namespace)::Entity::endElement() /sax/source/fastparser/fastparser.cxx:514:27
>     #11 0x7f95caf68998 in sax_fastparser::FastSaxParserImpl::callbackEndElement() /sax/source/fastparser/fastparser.cxx:1331:17
>     #12 0x7f95caf58444 in (anonymous namespace)::call_callbackEndElement(void*, unsigned char const*, unsigned char const*, unsigned char const*) /sax/source/fastparser/fastparser.cxx:338:18
>     #13 0x7f960adebeda in xmlParseEndTag2 /workdir/UnpackedTarball/libxml2/parser.c:10090:2
>     #14 0x7f960ad929b5 in xmlParseTryOrFinish /workdir/UnpackedTarball/libxml2/parser.c:11868:14
>     #15 0x7f960ad86334 in xmlParseChunk /workdir/UnpackedTarball/libxml2/parser.c:12151:5
>     #16 0x7f95caf53231 in sax_fastparser::FastSaxParserImpl::parse() /sax/source/fastparser/fastparser.cxx:1085:21
>     #17 0x7f95caf4cd18 in sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:890:9
>     #18 0x7f95caf6e950 in sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:1470:13
>     #19 0x7f95cdce50d1 in oox::core::FastParser::parseStream(com::sun::star::xml::sax::InputSource const&, bool) /oox/source/core/fastparser.cxx:121:15
>     #20 0x7f95cdce5868 in oox::core::FastParser::parseStream(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, rtl::OUString const&) /oox/source/core/fastparser.cxx:129:5
>     #21 0x7f95cddbb234 in oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&) /oox/source/core/xmlfilterbase.cxx:414:21
>     #22 0x7f95cddb9b8d in oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&) /oox/source/core/xmlfilterbase.cxx:344:12
>     #23 0x7f95441ceaa8 in oox::xls::WorkbookHelper::importOoxFragment(rtl::Reference<oox::core::FragmentHandler> const&) /sc/source/filter/oox/workbookhelper.cxx:1046:27
>     #24 0x7f95442797f1 in oox::xls::WorksheetGlobals::finalizeDrawings() /sc/source/filter/oox/worksheethelper.cxx:1373:9
>     #25 0x7f95442789e0 in oox::xls::WorksheetGlobals::finalizeDrawingImport() /sc/source/filter/oox/worksheethelper.cxx:996:5
>     #26 0x7f954428744d in oox::xls::WorksheetHelper::finalizeDrawingImport() /sc/source/filter/oox/worksheethelper.cxx:1637:17
>     #27 0x7f95441771de in oox::xls::WorkbookFragment::finalizeImport() /sc/source/filter/oox/workbookfragment.cxx:511:18
>     #28 0x7f95cdd5b3ae in oox::core::FragmentHandler2::endDocument() /oox/source/core/fragmenthandler2.cxx:53:5
>     #29 0x7f95caf4cfc2 in sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:896:36
>     #30 0x7f95caf6e950 in sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:1470:13
>     #31 0x7f95cdce50d1 in oox::core::FastParser::parseStream(com::sun::star::xml::sax::InputSource const&, bool) /oox/source/core/fastparser.cxx:121:15
>     #32 0x7f95cdce5868 in oox::core::FastParser::parseStream(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, rtl::OUString const&) /oox/source/core/fastparser.cxx:129:5
>     #33 0x7f95cddbb234 in oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&) /oox/source/core/xmlfilterbase.cxx:414:21
>     #34 0x7f95cddb9b8d in oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&) /oox/source/core/xmlfilterbase.cxx:344:12
>     #35 0x7f95435c4daa in oox::xls::ExcelFilter::importDocument() /sc/source/filter/oox/excelfilter.cxx:113:25
>     #36 0x7f95cdcf953b in oox::core::FilterBase::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /oox/source/core/filterbase.cxx:488:49
>     #37 0x7f95435c7733 in oox::xls::ExcelFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sc/source/filter/oox/excelfilter.cxx:176:25
>     #38 0x7f95857c5b40 in SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) /sfx2/source/doc/objstor.cxx:2393:34
>     #39 0x7f9585781c6a in SfxObjectShell::DoLoad(SfxMedium*) /sfx2/source/doc/objstor.cxx:761:23
>     #40 0x7f95859a9652 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/sfxbasemodel.cxx:1980:36
>     #41 0x7f95862145e9 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
>     #42 0x7f95536a9900 in framework::LoadEnv::impl_loadContent() /framework/source/loadenv/loadenv.cxx:1176:37
>     #43 0x7f95536a091b in framework::LoadEnv::start() /framework/source/loadenv/loadenv.cxx:412:20
>     #44 0x7f9553698f59 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
>     #45 0x7f95536946e7 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
>     #46 0x7f955376867d 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
>     #47 0x7f95537688a6 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
>     #48 0x7f9569f7cafa 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
>     #49 0x7f9580718c56 in UnoApiTest::loadWithParams(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /test/source/unoapi_test.cxx:126:19
>     #50 0x7f9580717ef8 in UnoApiTest::load(rtl::OUString const&, char const*) /test/source/unoapi_test.cxx:108:5
>     #51 0x7f9580719254 in UnoApiTest::loadFromFile(std::basic_string_view<char16_t, std::char_traits<char16_t> >, char const*) /test/source/unoapi_test.cxx:132:5
>     #52 0x7f95d8bf1018 in testTdf123647::TestBody() /chart2/qa/extras/chart2export2.cxx:1242:5

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

Change-Id: I870d811e78b8c55b84627ae609f98f623465dd9d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162294
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
(cherry picked from commit 3fb9859)
tdf-gerrit pushed a commit that referenced this pull request Jun 26, 2024
Handle the case where `XAccessible::getAccessibleContext`
returns an empty reference, as e.g.
`VCLXWindow::getAccessibleContext` does when already
disposed.

Fixes an assert/crash seen with the gtk4 VCL plugin
when experimenting with missing menu item handling
in Writer's "Tools" -> "Bibliography Database",
expanding the search filter menu, then closing the dialog
and LO altogether.

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.
    (rr) 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  0x00007fe8f96a6b6f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
    #2  0x00007fe8f96584e2 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
    #3  0x00007fe8f96414ed in __GI_abort () at ./stdlib/abort.c:79
    #4  0x00007fe8f9641415 in __assert_fail_base
        (fmt=0x7fe8f97b7ba8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x7fe8e5f1ba3a "_pInterface != NULL", file=file@entry=0x7fe8e5f46536 ".../libreoffice/include/com/sun/star/uno/Reference.h", line=line@entry=387, function=function@entry=0x7fe8e5f41e71 "interface_type *com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleContext>::operator->() const [interface_type = com::sun::star::accessibility::XAccessibleContext]") at ./assert/assert.c:92
    #5  0x00007fe8f9651002 in __assert_fail
        (assertion=0x7fe8e5f1ba3a "_pInterface != NULL", file=0x7fe8e5f46536 ".../libreoffice/include/com/sun/star/uno/Reference.h", line=387, function=0x7fe8e5f41e71 "interface_type *com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleContext>::operator->() const [interface_type = com::sun::star::accessibility::XAccessibleContext]") at ./assert/assert.c:101
    #6  0x00007fe8e6034e42 in com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleContext>::operator->() const (this=0x7ffe3fddc640) at include/com/sun/star/uno/Reference.h:387
    #7  0x00007fe8e6038c14 in map_accessible_role(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessible> const&) (rAccessible=uno::Reference to (VCLXWindow *) 0x5603d155bba8)
        at .../libreoffice/vcl/unx/gtk4/a11y.cxx:56
    #8  0x00007fe8e6038a16 in lo_accessible_get_property(_GObject*, unsigned int, _GValue*, _GParamSpec*) (object=0x5603e5e9fde0, property_id=2, value=0x7ffe3fddca00, pspec=0x5603bfdc1820)
        at .../libreoffice/vcl/unx/gtk4/a11y.cxx:559
    #9  0x00007fe8f47be345 in g_object_get_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #10 0x00007fe8f47be8b7 in g_object_get () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #11 0x00007fe8e54d81f8 in gtk_accessible_get_accessible_role (self=self@entry=0x5603e5e9fde0) at ../gtk/gtkaccessible.c:296
    #12 0x00007fe8e54d9447 in gtk_accessible_should_present (self=self@entry=0x5603e5e9fde0) at ../gtk/gtkaccessible.c:1304
    #13 0x00007fe8e575dab8 in get_index_in (parent=parent@entry=0x5603e4203030, child=child@entry=0x5603e5ea13a0) at ../gtk/a11y/gtkatspicontext.c:398
    #14 0x00007fe8e5760213 in gtk_at_spi_context_child_change (ctx=0x5603e41f8670, change=GTK_ACCESSIBLE_CHILD_CHANGE_REMOVED, child=0x5603e5ea13a0) at ../gtk/a11y/gtkatspicontext.c:1260
    #15 0x00007fe8e575ed8f in gtk_at_spi_context_state_change
        (ctx=0x5603e5ea15a0, changed_states=GTK_ACCESSIBLE_STATE_CHANGE_HIDDEN, changed_properties=0, changed_relations=<optimized out>, states=0x5603e5ea1770, properties=0x5603e5ea16b0, relations=0x5603e5ea1710)
        at ../gtk/a11y/gtkatspicontext.c:979
    #16 0x00007fe8e54e2bdf in gtk_at_context_update (self=0x5603e5ea15a0) at ../gtk/gtkatcontext.c:831
    #17 0x00007fe8e54d839a in gtk_accessible_update_state (self=self@entry=0x5603e5ea13a0, first_state=first_state@entry=GTK_ACCESSIBLE_STATE_HIDDEN) at ../gtk/gtkaccessible.c:364
    #18 0x00007fe8e5684d4b in gtk_widget_unmap (widget=0x5603e5ea13a0) at ../gtk/gtkwidget.c:2895
    #19 gtk_widget_unmap (widget=0x5603e5ea13a0) at ../gtk/gtkwidget.c:2879
    #20 0x00007fe8e5684e25 in gtk_widget_real_hide (widget=0x5603e5ea13a0) at ../gtk/gtkwidget.c:2811
    #21 0x00007fe8f47b4939 in  () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #22 0x00007fe8f47ca33f in  () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #23 0x00007fe8f47cff06 in g_signal_emit_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #24 0x00007fe8f47cffc3 in g_signal_emit () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
    #25 0x00007fe8e56872cd in gtk_widget_hide (widget=0x5603e5ea13a0) at ../gtk/gtkwidget.c:2787
    #26 0x00007fe8e61de10e in GtkSalObjectWidgetClip::Show(bool) (this=0x5603dafec8f0, bVisible=false) at vcl/unx/gtk4/../gtk3/gtkobject.cxx:534
    #27 0x00007fe8efc96b3d in vcl::Window::ImplSysObjClip(vcl::Region const*) (this=0x5603e5ebb940, pOldRegion=0x0) at .../libreoffice/vcl/source/window/clipping.cxx:352
    #28 0x00007fe8efc96fa0 in vcl::Window::ImplSetClipFlagChildren(bool) (this=0x5603e5ebb940, bSysObjOnlySmaller=false) at .../libreoffice/vcl/source/window/clipping.cxx:424
    #29 0x00007fe8efc97227 in vcl::Window::ImplSetClipFlag(bool) (this=0x5603e5ebb940, bSysObjOnlySmaller=false) at .../libreoffice/vcl/source/window/clipping.cxx:466
    #30 0x00007fe8eff2307b in vcl::Window::Show(bool, ShowFlags) (this=0x5603e5ebb940, bVisible=false, nFlags=ShowFlags::NONE) at .../libreoffice/vcl/source/window/window.cxx:2238
    #31 0x00007fe8efc6a189 in vcl::Window::Hide() (this=0x5603e5ebb940) at include/vcl/window.hxx:881
    #32 0x00007fe8efeac189 in SystemChildWindow::dispose() (this=0x5603e5ebb940) at .../libreoffice/vcl/source/window/syschild.cxx:121
    #33 0x00007fe8f01cd7ca in VclReferenceBase::disposeOnce() (this=0x5603e5ebb950) at .../libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
    #34 0x00007fe8e61ad349 in VclPtr<SystemChildWindow>::disposeAndClear() (this=0x5603e5ea49f0) at include/vcl/vclptr.hxx:207
    #35 0x00007fe8e60a30ca in (anonymous namespace)::GtkInstanceBuilder::~GtkInstanceBuilder() (this=0x5603e5ea4900) at vcl/unx/gtk4/../gtk3/gtkinst.cxx:24349
    #36 0x00007fe8e60a3169 in (anonymous namespace)::GtkInstanceBuilder::~GtkInstanceBuilder() (this=0x5603e5ea4900) at vcl/unx/gtk4/../gtk3/gtkinst.cxx:24342
    #37 0x00007fe8efe748cf in std::default_delete<weld::Builder>::operator()(weld::Builder*) const (this=0x5603e41d6730, __ptr=0x5603e5ea4900) at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/unique_ptr.h:99
    #38 0x00007fe8efe747fc in std::__uniq_ptr_impl<weld::Builder, std::default_delete<weld::Builder> >::reset(weld::Builder*) (this=0x5603e41d6730, __p=0x0)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/unique_ptr.h:211
    #39 0x00007fe8efff1ffd in std::unique_ptr<weld::Builder, std::default_delete<weld::Builder> >::reset(weld::Builder*) (this=0x5603e41d6730, __p=0x0)
        at /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/unique_ptr.h:509
    #40 0x00007fe8efff16b3 in InterimItemWindow::dispose() (this=0x5603e41d6660) at .../libreoffice/vcl/source/control/InterimItemWindow.cxx:49
    #41 0x00007fe8a6f57e51 in EditControl::dispose() (this=0x5603e41d6660) at .../libreoffice/extensions/source/bibliography/toolbar.cxx:209
    #42 0x00007fe8f01cd7ca in VclReferenceBase::disposeOnce() (this=0x5603e41d67b8) at .../libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
    #43 0x00007fe8a6f5d5f6 in VclPtr<EditControl>::disposeAndClear() (this=0x5603e5e8e9f0) at include/vcl/vclptr.hxx:207
    #44 0x00007fe8a6f5a13c in BibToolBar::dispose() (this=0x5603e5e8e580) at .../libreoffice/extensions/source/bibliography/toolbar.cxx:272
    #45 0x00007fe8f01cd7ca in VclReferenceBase::disposeOnce() (this=0x5603e5e8ea68) at .../libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
    #46 0x00007fe8a6edbf09 in VclPtr<BibToolBar>::disposeAndClear() (this=0x5603e06c1578) at include/vcl/vclptr.hxx:207
    #47 0x00007fe8a6edab2e in bib::BibBeamer::dispose() (this=0x5603e06c1340) at .../libreoffice/extensions/source/bibliography/bibbeam.cxx:205
    #48 0x00007fe8f01cd7ca in VclReferenceBase::disposeOnce() (this=0x5603e06c1588) at .../libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
    #49 0x00007fe8a6ef2b49 in VclPtr<vcl::Window>::disposeAndClear() (this=0x7ffe3fdddcb0) at include/vcl/vclptr.hxx:207
    #50 0x00007fe8a6ef173a in BibWindowContainer::dispose() (this=0x5603e70e5ed0) at .../libreoffice/extensions/source/bibliography/bibcont.cxx:81
    #51 0x00007fe8f01cd7ca in VclReferenceBase::disposeOnce() (this=0x5603e70e5ef8) at .../libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
    #52 0x00007fe8a6ef2b49 in VclPtr<vcl::Window>::disposeAndClear() (this=0x7ffe3fdddd90) at include/vcl/vclptr.hxx:207
    #53 0x00007fe8a6ef2043 in BibBookContainer::dispose() (this=0x5603de460610) at .../libreoffice/extensions/source/bibliography/bibcont.cxx:126
    #54 0x00007fe8f01cd7ca in VclReferenceBase::disposeOnce() (this=0x5603de460878) at .../libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
    #55 0x00007fe8f1d624a9 in VclPtr<vcl::Window>::disposeAndClear() (this=0x7ffe3fddded8) at include/vcl/vclptr.hxx:207
    #56 0x00007fe8f1d52fe4 in VCLXWindow::dispose() (this=0x5603d155bb40) at .../libreoffice/toolkit/source/awt/vclxwindow.cxx:926
    #57 0x00007fe8f6c28644 in (anonymous namespace)::XFrameImpl::setComponent(com::sun::star::uno::Reference<com::sun::star::awt::XWindow> const&, com::sun::star::uno::Reference<com::sun::star::frame::XController> const&)
        (this=0x5603e4174370, xComponentWindow=empty uno::Reference, xController=empty uno::Reference) at .../libreoffice/framework/source/services/frame.cxx:1525
    #58 0x00007fe8f6c2abc8 in (anonymous namespace)::XFrameImpl::close(unsigned char) (this=0x5603e4174370, bDeliverOwnership=0 '\000') at .../libreoffice/framework/source/services/frame.cxx:1707
    #59 0x00007fe8f6a3a23a in framework::pattern::frame::closeIt(com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&) (xResource=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x5603e41743e0)
        at framework/source/inc/pattern/frame.hxx:57
    #60 0x00007fe8f6a38445 in framework::CloseDispatcher::implts_closeFrame() (this=0x5603e93410a0) at .../libreoffice/framework/source/dispatch/closedispatcher.cxx:500
    #61 0x00007fe8f6a37ab1 in framework::CloseDispatcher::impl_asyncCallback(LinkParamNone*) (this=0x5603e93410a0) at .../libreoffice/framework/source/dispatch/closedispatcher.cxx:379
    #62 0x00007fe8f6a35fed in framework::CloseDispatcher::LinkStubimpl_asyncCallback(void*, LinkParamNone*) (instance=0x5603e93410a0, data=0x0) at .../libreoffice/framework/source/dispatch/closedispatcher.cxx:246
    #63 0x00007fe8efc40828 in Link<LinkParamNone*, void>::Call(LinkParamNone*) const (this=0x5603eb162878, data=0x0) at include/tools/link.hxx:111
    #64 0x00007fe8f06cff25 in vcl::EventPoster::DoEvent_Impl(void*) (this=0x5603eb162870) at .../libreoffice/vcl/source/helper/evntpost.cxx:52
    #65 0x00007fe8f06cfedd in vcl::EventPoster::LinkStubDoEvent_Impl(void*, void*) (instance=0x5603eb162870, data=0x0) at .../libreoffice/vcl/source/helper/evntpost.cxx:48
    #66 0x00007fe8eff4ca78 in Link<void*, void>::Call(void*) const (this=0x5603dfaf31a8, data=0x0) at include/tools/link.hxx:111
    #67 0x00007fe8eff48759 in ImplHandleUserEvent(ImplSVEvent*) (pSVEvent=0x5603dfaf31a0) at .../libreoffice/vcl/source/window/winproc.cxx:2287
    #68 0x00007fe8eff45110 in ImplWindowFrameProc(vcl::Window*, SalEvent, void const*) (_pWindow=0x5603c9d5cf10, nEvent=SalEvent::UserEvent, pEvent=0x5603dfaf31a0)
        at .../libreoffice/vcl/source/window/winproc.cxx:2851
    #69 0x00007fe8f0bd5ba0 in SalFrame::CallCallback(SalEvent, void const*) const (this=0x5603cb949f00, nEvent=SalEvent::UserEvent, pEvent=0x5603dfaf31a0) at vcl/inc/salframe.hxx:312
    #70 0x00007fe8f0c0072f in SalGenericDisplay::ProcessEvent(SalUserEventList::SalUserEvent) (this=0x5603bec36aa0, aEvent=...) at .../libreoffice/vcl/unx/generic/app/gendisp.cxx:66
    #71 0x00007fe8f06e433d in SalUserEventList::DispatchUserEvents(bool)::$_0::operator()() const (this=0x7ffe3fddefd0) at .../libreoffice/vcl/source/app/salusereventlist.cxx:119
    #72 0x00007fe8f06e41e4 in SalUserEventList::DispatchUserEvents(bool) (this=0x5603bec36aa0, bHandleAllCurrentEvents=false) at .../libreoffice/vcl/source/app/salusereventlist.cxx:120
    #73 0x00007fe8f0c00685 in SalGenericDisplay::DispatchInternalEvent(bool) (this=0x5603bec36aa0, bHandleAllCurrentEvent=false) at .../libreoffice/vcl/unx/generic/app/gendisp.cxx:51
    #74 0x00007fe8e607b706 in call_userEventFn(void*) (data=0x5603beaa55d0) at vcl/unx/gtk4/../gtk3/gtkdata.cxx:824
    #75 0x00007fe8ead1ce3f in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #76 0x00007fe8ead1eec7 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #77 0x00007fe8ead1f4e0 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #78 0x00007fe8e607a2bf in GtkSalData::Yield(bool, bool) (this=0x5603beaa55d0, bWait=true, bHandleAllCurrentEvents=false) at vcl/unx/gtk4/../gtk3/gtkdata.cxx:405
    #79 0x00007fe8e6080123 in GtkInstance::DoYield(bool, bool) (this=0x5603beaa5480, bWait=true, bHandleAllCurrentEvents=false) at vcl/unx/gtk4/../gtk3/gtkinst.cxx:429
    #80 0x00007fe8f07c4d5c in ImplYield(bool, bool) (i_bWait=true, i_bAllEvents=false) at .../libreoffice/vcl/source/app/svapp.cxx:384
    #81 0x00007fe8f07c466b in Application::Yield() () at .../libreoffice/vcl/source/app/svapp.cxx:472
    #82 0x00007fe8f07c4402 in Application::Execute() () at .../libreoffice/vcl/source/app/svapp.cxx:359
    #83 0x00007fe8f9926be0 in desktop::Desktop::Main() (this=0x7ffe3fde1018) at .../libreoffice/desktop/source/app/app.cxx:1652
    #84 0x00007fe8f07e796e in ImplSVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:229
    #85 0x00007fe8f07e9999 in SVMain() () at .../libreoffice/vcl/source/app/svmain.cxx:261
    #86 0x00007fe8f99a9b2c in soffice_main() () at .../libreoffice/desktop/source/app/sofficemain.cxx:99
    #87 0x00005603bca36a5d in sal_main () at .../libreoffice/desktop/source/app/main.c:51
    #88 0x00005603bca36a37 in main (argc=2, argv=0x7ffe3fde1228) at .../libreoffice/desktop/source/app/main.c:49

Change-Id: Ia3f19d700de66c72f2896595a0e387bd3c42d7ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169451
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
tdf-gerrit pushed a commit that referenced this pull request Aug 30, 2024
Besides the obvious cases handled in previous commit

    Change-Id: Ifa84a038fc56f34958cd732caeb9c436b48b3c75
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Fri Aug 30 10:12:21 2024 +0200

        tdf#162696 qt weld: Do GUI things in main thread

, the destruction of `QtInstanceDialog::m_pDialog` (that
previously implicitly happened due to it being a
`std::unique_ptr`) also needs to happen in the main
thread.

Otherwise, it triggers this assert with a debug Qt build
for the tdf#162696 of installing an extension via drag'n'drop
into the start center:

    ASSERT failure in QCoreApplication::sendEvent: "Cannot send events to objects owned by a different thread. Current thread QThread(0x7f4b14003390). Receiver 'QDialog(0x562e6ba77450)' was created in thread QThread(0x562e69709f60, name = "Qt mainThread")", file /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp, line 551
    terminate called after throwing an instance of 'com::sun::star::uno::RuntimeException'

    Fatal exception: Signal 6
    Stack:
    #0 sal::backtrace_get(unsigned int) at /home/michi/development/git/libreoffice/sal/osl/unx/backtraceapi.cxx:42
    #1 (anonymous namespace)::printStack(int) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:289
    #2 (anonymous namespace)::callSystemHandler(int, siginfo_t*, void*) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:330
    #3 (anonymous namespace)::signalHandlerFunction(int, siginfo_t*, void*) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:427
    #4 /lib/x86_64-linux-gnu/libc.so.6(+0x3f590) [0x7f4be7455590]
    #5 __pthread_kill_implementation at ./nptl/pthread_kill.c:44 (discriminator 1)
    #6 raise at ./signal/../sysdeps/posix/raise.c:27
    #7 abort at ./stdlib/abort.c:81
    #8 /lib/x86_64-linux-gnu/libstdc++.so.6(+0xa1a3d) [0x7f4be70a1a3d]
    #9 /lib/x86_64-linux-gnu/libstdc++.so.6(+0xb306a) [0x7f4be70b306a]
    #10 std::unexpected() in /lib/x86_64-linux-gnu/libstdc++.so.6
    #11 /home/michi/development/git/qt5/qtbase/lib/libQt6Core.so.6(+0xed562) [0x7f4bd2eed562]
    #12 QMessageLogger::fatal() const at /home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:901
    #13 qt_assert_x(char const*, char const*, char const*, int) at /home/michi/development/git/qt5/qtbase/src/corelib/global/qassert.cpp:0
    #14 QCoreApplicationPrivate::checkReceiverThread(QObject*) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:0
    #15 QApplication::notify(QObject*, QEvent*) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:2583
    #16 QCoreApplication::notifyInternal2(QObject*, QEvent*) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1170
    #17 QCoreApplication::sendEvent(QObject*, QEvent*) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1614
    #18 QWidgetPrivate::setVisible(bool) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:8415
    #19 QDialogPrivate::setVisible(bool) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qdialog.cpp:832
    #20 QMessageBoxPrivate::setVisible(bool) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qmessagebox.cpp:1676
    #21 QDialog::setVisible(bool) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qdialog.cpp:750
    #22 QWidget::hide() at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:8176
    #23 QDialog::~QDialog() at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qdialog.cpp:390
    #24 QMessageBox::~QMessageBox() at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qmessagebox.cpp:879
    #25 QMessageBox::~QMessageBox() at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qmessagebox.cpp:878
    #26 std::default_delete<QDialog>::operator()(QDialog*) const at /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:94
    #27 std::unique_ptr<QDialog, std::default_delete<QDialog>>::~unique_ptr() at /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:398
    #28 QtInstanceDialog::~QtInstanceDialog() at /home/michi/development/git/libreoffice/vcl/inc/qt6/../qt5/QtInstanceDialog.hxx:14
    #29 QtInstanceMessageDialog::~QtInstanceMessageDialog() at /home/michi/development/git/libreoffice/vcl/inc/qt6/../qt5/QtInstanceMessageDialog.hxx:16
    #30 QtInstanceMessageDialog::~QtInstanceMessageDialog() at /home/michi/development/git/libreoffice/vcl/inc/qt6/../qt5/QtInstanceMessageDialog.hxx:16
    #31 QtInstanceMessageDialog::~QtInstanceMessageDialog() at /home/michi/development/git/libreoffice/vcl/inc/qt6/../qt5/QtInstanceMessageDialog.hxx:16
    #32 std::default_delete<weld::MessageDialog>::operator()(weld::MessageDialog*) const at /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:94
    #33 std::__uniq_ptr_impl<weld::MessageDialog, std::default_delete<weld::MessageDialog>>::reset(weld::MessageDialog*) at /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:206
    #34 std::unique_ptr<weld::MessageDialog, std::default_delete<weld::MessageDialog>>::reset(weld::MessageDialog*) at /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:504
    #35 dp_gui::DialogHelper::installExtensionWarn(std::basic_string_view<char16_t, std::char_traits<char16_t>>) at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_dialog2.cxx:379
    #36 dp_gui::(anonymous namespace)::ProgressCmdEnv::handle(com::sun::star::uno::Reference<com::sun::star::task::XInteractionRequest> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx:477
    #37 dp_misc::interactContinuation(com::sun::star::uno::Any const&, com::sun::star::uno::Type const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&, bool*, bool*) at /home/michi/development/git/libreoffice/desktop/source/deployment/misc/dp_interact.cxx:114
    #38 dp_manager::ExtensionManager::checkInstall(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:1315
    #39 dp_manager::ExtensionManager::doChecksForAddExtension(com::sun::star::uno::Reference<com::sun::star::deployment::XPackageManager> const&, com::sun::star::uno::Sequence<com::sun::star::beans::NamedValue> const&, com::sun::star::uno::Reference<com::sun::star::deployment::XPackage> const&, com::sun::star::uno::Reference<com::sun::star::task::XAbortChannel> const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&, com::sun::star::uno::Reference<com::sun::star::deployment::XPackage>&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:565
    #40 dp_manager::ExtensionManager::addExtension(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::NamedValue> const&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::task::XAbortChannel> const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:655
    #41 non-virtual thunk to dp_manager::ExtensionManager::addExtension(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::NamedValue> const&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::task::XAbortChannel> const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:0
    #42 dp_gui::ExtensionCmdQueue::Thread::_addExtension(rtl::Reference<dp_gui::(anonymous namespace)::ProgressCmdEnv> const&, rtl::OUString const&, rtl::OUString const&, bool) at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx:864
    #43 dp_gui::ExtensionCmdQueue::Thread::execute() at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx:738
    #44 salhelper::Thread::run() at /home/michi/development/git/libreoffice/salhelper/source/thread.cxx:39
    #45 threadFunc at /home/michi/development/git/libreoffice/include/osl/thread.hxx:190
    #46 osl_thread_start_Impl(void*) at /home/michi/development/git/libreoffice/sal/osl/unx/thread.cxx:245
    #47 start_thread at ./nptl/pthread_create.c:447
    #48 clone3 at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:80

Change-Id: Idb5b20bde8c306ed14efd5467887d55fdf470202
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172643
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
tdf-gerrit pushed a commit that referenced this pull request Aug 31, 2024
Besides the obvious cases handled in previous commit

    Change-Id: Ifa84a038fc56f34958cd732caeb9c436b48b3c75
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Fri Aug 30 10:12:21 2024 +0200

        tdf#162696 qt weld: Do GUI things in main thread

, the destruction of `QtInstanceDialog::m_pDialog` (that
previously implicitly happened due to it being a
`std::unique_ptr`) also needs to happen in the main
thread.

Otherwise, it triggers this assert with a debug Qt build
for the tdf#162696 of installing an extension via drag'n'drop
into the start center:

    ASSERT failure in QCoreApplication::sendEvent: "Cannot send events to objects owned by a different thread. Current thread QThread(0x7f4b14003390). Receiver 'QDialog(0x562e6ba77450)' was created in thread QThread(0x562e69709f60, name = "Qt mainThread")", file /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp, line 551
    terminate called after throwing an instance of 'com::sun::star::uno::RuntimeException'

    Fatal exception: Signal 6
    Stack:
    #0 sal::backtrace_get(unsigned int) at /home/michi/development/git/libreoffice/sal/osl/unx/backtraceapi.cxx:42
    #1 (anonymous namespace)::printStack(int) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:289
    #2 (anonymous namespace)::callSystemHandler(int, siginfo_t*, void*) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:330
    #3 (anonymous namespace)::signalHandlerFunction(int, siginfo_t*, void*) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:427
    #4 /lib/x86_64-linux-gnu/libc.so.6(+0x3f590) [0x7f4be7455590]
    #5 __pthread_kill_implementation at ./nptl/pthread_kill.c:44 (discriminator 1)
    #6 raise at ./signal/../sysdeps/posix/raise.c:27
    #7 abort at ./stdlib/abort.c:81
    #8 /lib/x86_64-linux-gnu/libstdc++.so.6(+0xa1a3d) [0x7f4be70a1a3d]
    #9 /lib/x86_64-linux-gnu/libstdc++.so.6(+0xb306a) [0x7f4be70b306a]
    #10 std::unexpected() in /lib/x86_64-linux-gnu/libstdc++.so.6
    #11 /home/michi/development/git/qt5/qtbase/lib/libQt6Core.so.6(+0xed562) [0x7f4bd2eed562]
    #12 QMessageLogger::fatal() const at /home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:901
    #13 qt_assert_x(char const*, char const*, char const*, int) at /home/michi/development/git/qt5/qtbase/src/corelib/global/qassert.cpp:0
    #14 QCoreApplicationPrivate::checkReceiverThread(QObject*) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:0
    #15 QApplication::notify(QObject*, QEvent*) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:2583
    #16 QCoreApplication::notifyInternal2(QObject*, QEvent*) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1170
    #17 QCoreApplication::sendEvent(QObject*, QEvent*) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1614
    #18 QWidgetPrivate::setVisible(bool) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:8415
    #19 QDialogPrivate::setVisible(bool) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qdialog.cpp:832
    #20 QMessageBoxPrivate::setVisible(bool) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qmessagebox.cpp:1676
    #21 QDialog::setVisible(bool) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qdialog.cpp:750
    #22 QWidget::hide() at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:8176
    #23 QDialog::~QDialog() at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qdialog.cpp:390
    #24 QMessageBox::~QMessageBox() at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qmessagebox.cpp:879
    #25 QMessageBox::~QMessageBox() at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qmessagebox.cpp:878
    #26 std::default_delete<QDialog>::operator()(QDialog*) const at /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:94
    #27 std::unique_ptr<QDialog, std::default_delete<QDialog>>::~unique_ptr() at /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:398
    #28 QtInstanceDialog::~QtInstanceDialog() at /home/michi/development/git/libreoffice/vcl/inc/qt6/../qt5/QtInstanceDialog.hxx:14
    #29 QtInstanceMessageDialog::~QtInstanceMessageDialog() at /home/michi/development/git/libreoffice/vcl/inc/qt6/../qt5/QtInstanceMessageDialog.hxx:16
    #30 QtInstanceMessageDialog::~QtInstanceMessageDialog() at /home/michi/development/git/libreoffice/vcl/inc/qt6/../qt5/QtInstanceMessageDialog.hxx:16
    #31 QtInstanceMessageDialog::~QtInstanceMessageDialog() at /home/michi/development/git/libreoffice/vcl/inc/qt6/../qt5/QtInstanceMessageDialog.hxx:16
    #32 std::default_delete<weld::MessageDialog>::operator()(weld::MessageDialog*) const at /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:94
    #33 std::__uniq_ptr_impl<weld::MessageDialog, std::default_delete<weld::MessageDialog>>::reset(weld::MessageDialog*) at /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:206
    #34 std::unique_ptr<weld::MessageDialog, std::default_delete<weld::MessageDialog>>::reset(weld::MessageDialog*) at /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:504
    #35 dp_gui::DialogHelper::installExtensionWarn(std::basic_string_view<char16_t, std::char_traits<char16_t>>) at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_dialog2.cxx:379
    #36 dp_gui::(anonymous namespace)::ProgressCmdEnv::handle(com::sun::star::uno::Reference<com::sun::star::task::XInteractionRequest> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx:477
    #37 dp_misc::interactContinuation(com::sun::star::uno::Any const&, com::sun::star::uno::Type const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&, bool*, bool*) at /home/michi/development/git/libreoffice/desktop/source/deployment/misc/dp_interact.cxx:114
    #38 dp_manager::ExtensionManager::checkInstall(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:1315
    #39 dp_manager::ExtensionManager::doChecksForAddExtension(com::sun::star::uno::Reference<com::sun::star::deployment::XPackageManager> const&, com::sun::star::uno::Sequence<com::sun::star::beans::NamedValue> const&, com::sun::star::uno::Reference<com::sun::star::deployment::XPackage> const&, com::sun::star::uno::Reference<com::sun::star::task::XAbortChannel> const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&, com::sun::star::uno::Reference<com::sun::star::deployment::XPackage>&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:565
    #40 dp_manager::ExtensionManager::addExtension(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::NamedValue> const&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::task::XAbortChannel> const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:655
    #41 non-virtual thunk to dp_manager::ExtensionManager::addExtension(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::NamedValue> const&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::task::XAbortChannel> const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:0
    #42 dp_gui::ExtensionCmdQueue::Thread::_addExtension(rtl::Reference<dp_gui::(anonymous namespace)::ProgressCmdEnv> const&, rtl::OUString const&, rtl::OUString const&, bool) at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx:864
    #43 dp_gui::ExtensionCmdQueue::Thread::execute() at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx:738
    #44 salhelper::Thread::run() at /home/michi/development/git/libreoffice/salhelper/source/thread.cxx:39
    #45 threadFunc at /home/michi/development/git/libreoffice/include/osl/thread.hxx:190
    #46 osl_thread_start_Impl(void*) at /home/michi/development/git/libreoffice/sal/osl/unx/thread.cxx:245
    #47 start_thread at ./nptl/pthread_create.c:447
    #48 clone3 at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:80

Change-Id: Idb5b20bde8c306ed14efd5467887d55fdf470202
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172643
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172653
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
tdf-gerrit pushed a commit that referenced this pull request Aug 31, 2024
This fixes the following assert seen with the qt6 VCL plugin
when run with a current Qt 6 dev debug build for the tdf#162696
scenario when when native Qt widgets (currently only message dialogs
are implmeneted) are explicitly disabled using
`SAL_VCL_QT_NO_WELDED_WIDGETS=1`.

    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 958
    terminate called after throwing an instance of 'com::sun::star::uno::RuntimeException'

    Fatal exception: Signal 6
    Stack:
    #0 sal::backtrace_get(unsigned int) at /home/michi/development/git/libreoffice/sal/osl/unx/backtraceapi.cxx:42
    #1 (anonymous namespace)::printStack(int) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:289
    #2 (anonymous namespace)::callSystemHandler(int, siginfo_t*, void*) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:330
    #3 (anonymous namespace)::signalHandlerFunction(int, siginfo_t*, void*) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:427
    #4 /lib/x86_64-linux-gnu/libc.so.6(+0x3f590) [0x7f73cbe55590]
    #5 __pthread_kill_implementation at ./nptl/pthread_kill.c:44 (discriminator 1)
    #6 raise at ./signal/../sysdeps/posix/raise.c:27
    #7 abort at ./stdlib/abort.c:81
    #8 /lib/x86_64-linux-gnu/libstdc++.so.6(+0xa1a3d) [0x7f73cbaa1a3d]
    #9 /lib/x86_64-linux-gnu/libstdc++.so.6(+0xb306a) [0x7f73cbab306a]
    #10 std::unexpected() in /lib/x86_64-linux-gnu/libstdc++.so.6
    #11 /home/michi/development/git/qt5/qtbase/lib/libQt6Core.so.6(+0xed562) [0x7f73b78ed562]
    #12 QMessageLogger::fatal() const at /home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:901
    #13 qt_assert_x(char const*, char const*, char const*, int) at /home/michi/development/git/qt5/qtbase/src/corelib/global/qassert.cpp:0
    #14 QWidgetPrivate::init(QWidget*, QFlags<Qt::WindowType>) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:959
    #15 QWidget::QWidget(QWidgetPrivate&, QWidget*, QFlags<Qt::WindowType>) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:878
    #16 QMenuBar::QMenuBar(QWidget*) at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qmenubar.cpp:715
    #17 QMainWindow::menuBar() const at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qmainwindow.cpp:468
    #18 QtFrame::menuBarOffset() const at /home/michi/development/git/libreoffice/vcl/qt6/../qt5/QtFrame.cxx:462
    #19 QtFrame::SetDefaultPos() at /home/michi/development/git/libreoffice/vcl/qt6/../qt5/QtFrame.cxx:479
    #20 QtFrame::SetPosSize(long, long, long, long, unsigned short) at /home/michi/development/git/libreoffice/vcl/qt6/../qt5/QtFrame.cxx:565
    #21 vcl::Window::setPosSizePixel(long, long, long, long, PosSizeFlags) at /home/michi/development/git/libreoffice/vcl/source/window/window.cxx:2786
    #22 vcl::Window::SetSizePixel(Size const&) at /home/michi/development/git/libreoffice/vcl/source/window/window2.cxx:1344
    #23 SystemWindow::setOptimalLayoutSize(bool) at /home/michi/development/git/libreoffice/vcl/source/window/syswin.cxx:1085
    #24 SystemWindow::DoInitialLayout() at /home/michi/development/git/libreoffice/vcl/source/window/syswin.cxx:1098
    #25 Dialog::StateChanged(StateChangedType) at /home/michi/development/git/libreoffice/vcl/source/window/dialog.cxx:761
    #26 MessageDialog::StateChanged(StateChangedType) at /home/michi/development/git/libreoffice/vcl/source/window/layout.cxx:2706
    #27 vcl::Window::CompatStateChanged(StateChangedType) at /home/michi/development/git/libreoffice/vcl/source/window/window.cxx:3921
    #28 vcl::Window::ImplCallInitShow() at /home/michi/development/git/libreoffice/vcl/source/window/event.cxx:496
    #29 vcl::Window::Show(bool, ShowFlags) at /home/michi/development/git/libreoffice/vcl/source/window/window.cxx:2312
    #30 Dialog::ImplStartExecute() at /home/michi/development/git/libreoffice/vcl/source/window/dialog.cxx:1021
    #31 Dialog::Execute() at /home/michi/development/git/libreoffice/vcl/source/window/dialog.cxx:1071
    #32 SalInstanceDialog::run() at /home/michi/development/git/libreoffice/vcl/source/app/salvtables.cxx:1898
    #33 dp_gui::(anonymous namespace)::ProgressCmdEnv::handle(com::sun::star::uno::Reference<com::sun::star::task::XInteractionRequest> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx:459
    #34 dp_misc::interactContinuation(com::sun::star::uno::Any const&, com::sun::star::uno::Type const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&, bool*, bool*) at /home/michi/development/git/libreoffice/desktop/source/deployment/misc/dp_interact.cxx:114
    #35 dp_manager::ExtensionManager::checkUpdate(rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::deployment::XPackage> const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:1348
    [...]

Change-Id: I9eb0ac63c50de3c713328d0466cb01ea90251741
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172685
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
tdf-gerrit pushed a commit that referenced this pull request Sep 5, 2024
This fixes the following assert seen with the qt6 VCL plugin
when run with a current Qt 6 dev debug build for the tdf#162696
scenario when when native Qt widgets (currently only message dialogs
are implmeneted) are explicitly disabled using
`SAL_VCL_QT_NO_WELDED_WIDGETS=1`.

    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 958
    terminate called after throwing an instance of 'com::sun::star::uno::RuntimeException'

    Fatal exception: Signal 6
    Stack:
    #0 sal::backtrace_get(unsigned int) at /home/michi/development/git/libreoffice/sal/osl/unx/backtraceapi.cxx:42
    #1 (anonymous namespace)::printStack(int) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:289
    #2 (anonymous namespace)::callSystemHandler(int, siginfo_t*, void*) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:330
    #3 (anonymous namespace)::signalHandlerFunction(int, siginfo_t*, void*) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:427
    #4 /lib/x86_64-linux-gnu/libc.so.6(+0x3f590) [0x7f73cbe55590]
    #5 __pthread_kill_implementation at ./nptl/pthread_kill.c:44 (discriminator 1)
    #6 raise at ./signal/../sysdeps/posix/raise.c:27
    #7 abort at ./stdlib/abort.c:81
    #8 /lib/x86_64-linux-gnu/libstdc++.so.6(+0xa1a3d) [0x7f73cbaa1a3d]
    #9 /lib/x86_64-linux-gnu/libstdc++.so.6(+0xb306a) [0x7f73cbab306a]
    #10 std::unexpected() in /lib/x86_64-linux-gnu/libstdc++.so.6
    #11 /home/michi/development/git/qt5/qtbase/lib/libQt6Core.so.6(+0xed562) [0x7f73b78ed562]
    #12 QMessageLogger::fatal() const at /home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:901
    #13 qt_assert_x(char const*, char const*, char const*, int) at /home/michi/development/git/qt5/qtbase/src/corelib/global/qassert.cpp:0
    #14 QWidgetPrivate::init(QWidget*, QFlags<Qt::WindowType>) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:959
    #15 QWidget::QWidget(QWidgetPrivate&, QWidget*, QFlags<Qt::WindowType>) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:878
    #16 QMenuBar::QMenuBar(QWidget*) at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qmenubar.cpp:715
    #17 QMainWindow::menuBar() const at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qmainwindow.cpp:468
    #18 QtFrame::menuBarOffset() const at /home/michi/development/git/libreoffice/vcl/qt6/../qt5/QtFrame.cxx:462
    #19 QtFrame::SetDefaultPos() at /home/michi/development/git/libreoffice/vcl/qt6/../qt5/QtFrame.cxx:479
    #20 QtFrame::SetPosSize(long, long, long, long, unsigned short) at /home/michi/development/git/libreoffice/vcl/qt6/../qt5/QtFrame.cxx:565
    #21 vcl::Window::setPosSizePixel(long, long, long, long, PosSizeFlags) at /home/michi/development/git/libreoffice/vcl/source/window/window.cxx:2786
    #22 vcl::Window::SetSizePixel(Size const&) at /home/michi/development/git/libreoffice/vcl/source/window/window2.cxx:1344
    #23 SystemWindow::setOptimalLayoutSize(bool) at /home/michi/development/git/libreoffice/vcl/source/window/syswin.cxx:1085
    #24 SystemWindow::DoInitialLayout() at /home/michi/development/git/libreoffice/vcl/source/window/syswin.cxx:1098
    #25 Dialog::StateChanged(StateChangedType) at /home/michi/development/git/libreoffice/vcl/source/window/dialog.cxx:761
    #26 MessageDialog::StateChanged(StateChangedType) at /home/michi/development/git/libreoffice/vcl/source/window/layout.cxx:2706
    #27 vcl::Window::CompatStateChanged(StateChangedType) at /home/michi/development/git/libreoffice/vcl/source/window/window.cxx:3921
    #28 vcl::Window::ImplCallInitShow() at /home/michi/development/git/libreoffice/vcl/source/window/event.cxx:496
    #29 vcl::Window::Show(bool, ShowFlags) at /home/michi/development/git/libreoffice/vcl/source/window/window.cxx:2312
    #30 Dialog::ImplStartExecute() at /home/michi/development/git/libreoffice/vcl/source/window/dialog.cxx:1021
    #31 Dialog::Execute() at /home/michi/development/git/libreoffice/vcl/source/window/dialog.cxx:1071
    #32 SalInstanceDialog::run() at /home/michi/development/git/libreoffice/vcl/source/app/salvtables.cxx:1898
    #33 dp_gui::(anonymous namespace)::ProgressCmdEnv::handle(com::sun::star::uno::Reference<com::sun::star::task::XInteractionRequest> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx:459
    #34 dp_misc::interactContinuation(com::sun::star::uno::Any const&, com::sun::star::uno::Type const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&, bool*, bool*) at /home/michi/development/git/libreoffice/desktop/source/deployment/misc/dp_interact.cxx:114
    #35 dp_manager::ExtensionManager::checkUpdate(rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::deployment::XPackage> const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:1348
    [...]

Change-Id: I9eb0ac63c50de3c713328d0466cb01ea90251741
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172685
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
(cherry picked from commit 5ef991f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172674
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
tdf-gerrit pushed a commit that referenced this pull request Sep 19, 2024
...in code newly introduced in 135ce25
"tdf#146487 Don't show generic diagram title when there is an empty title
given", which caused CppunitTest_chart2_export2 to fail with

> /oox/inc/drawingml/chart/plotareaconverter.hxx:78:62: runtime error: load of value 222, which is not a valid value for type 'bool'
>     #0 0x7f95cd9ed87c in oox::drawingml::chart::PlotAreaConverter::isSingleSeriesTitle() const /oox/inc/drawingml/chart/plotareaconverter.hxx:78:62
>     #1 0x7f95cd9e506f in oox::drawingml::chart::ChartSpaceConverter::convertFromModel(com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&, com::sun::star::awt::Point const&) /oox/source/drawingml/chart/chartspaceconverter.cxx:189:53
>     #2 0x7f95cd9b6c34 in oox::drawingml::chart::ChartConverter::convertFromModel(oox::core::XmlFilterBase&, oox::drawingml::chart::ChartSpaceModel&, com::sun::star::uno::Reference<com::sun::star::chart2::XChartDocument> const&, com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&, com::sun::star::awt::Point const&, com::sun::star::awt::Size const&) /oox/source/drawingml/chart/chartconverter.cxx:93:20
>     #3 0x7f95ce548f59 in oox::drawingml::Shape::finalizeXShape(oox::core::XmlFilterBase&, com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&) /oox/source/drawingml/shape.cxx:2245:50
>     #4 0x7f95438150b2 in oox::xls::Shape::finalizeXShape(oox::core::XmlFilterBase&, com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&) /sc/source/filter/oox/drawingfragment.cxx:113:30
>     #5 0x7f95ce5267bb in oox::drawingml::Shape::createAndInsert(oox::core::XmlFilterBase&, rtl::OUString const&, oox::drawingml::Theme const*, com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&, bool, bool, basegfx::B2DHomMatrix&, oox::drawingml::FillProperties const&, std::shared_ptr<oox::drawingml::Shape>) /oox/source/drawingml/shape.cxx:1964:9
>     #6 0x7f95ce4edb54 in oox::drawingml::Shape::addShape(oox::core::XmlFilterBase&, oox::drawingml::Theme const*, com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&, basegfx::B2DHomMatrix const&, oox::drawingml::FillProperties const&, std::__debug::map<rtl::OUString, std::shared_ptr<oox::drawingml::Shape>, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, std::shared_ptr<oox::drawingml::Shape> > > >*, std::shared_ptr<oox::drawingml::Shape>) /oox/source/drawingml/shape.cxx:366:41
>     #7 0x7f954381ef79 in oox::xls::DrawingFragment::onEndElement() /sc/source/filter/oox/drawingfragment.cxx:335:30
>     #8 0x7f95cdcaee54 in oox::core::ContextHandler2Helper::implEndElement(int) /oox/source/core/contexthandler2.cxx:125:9
>     #9 0x7f95cdd5c116 in oox::core::FragmentHandler2::endFastElement(int) /oox/source/core/fragmenthandler2.cxx:91:5
>     #10 0x7f95caf68fca in (anonymous namespace)::Entity::endElement() /sax/source/fastparser/fastparser.cxx:514:27
>     #11 0x7f95caf68998 in sax_fastparser::FastSaxParserImpl::callbackEndElement() /sax/source/fastparser/fastparser.cxx:1331:17
>     #12 0x7f95caf58444 in (anonymous namespace)::call_callbackEndElement(void*, unsigned char const*, unsigned char const*, unsigned char const*) /sax/source/fastparser/fastparser.cxx:338:18
>     #13 0x7f960adebeda in xmlParseEndTag2 /workdir/UnpackedTarball/libxml2/parser.c:10090:2
>     #14 0x7f960ad929b5 in xmlParseTryOrFinish /workdir/UnpackedTarball/libxml2/parser.c:11868:14
>     #15 0x7f960ad86334 in xmlParseChunk /workdir/UnpackedTarball/libxml2/parser.c:12151:5
>     #16 0x7f95caf53231 in sax_fastparser::FastSaxParserImpl::parse() /sax/source/fastparser/fastparser.cxx:1085:21
>     #17 0x7f95caf4cd18 in sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:890:9
>     #18 0x7f95caf6e950 in sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:1470:13
>     #19 0x7f95cdce50d1 in oox::core::FastParser::parseStream(com::sun::star::xml::sax::InputSource const&, bool) /oox/source/core/fastparser.cxx:121:15
>     #20 0x7f95cdce5868 in oox::core::FastParser::parseStream(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, rtl::OUString const&) /oox/source/core/fastparser.cxx:129:5
>     #21 0x7f95cddbb234 in oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&) /oox/source/core/xmlfilterbase.cxx:414:21
>     #22 0x7f95cddb9b8d in oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&) /oox/source/core/xmlfilterbase.cxx:344:12
>     #23 0x7f95441ceaa8 in oox::xls::WorkbookHelper::importOoxFragment(rtl::Reference<oox::core::FragmentHandler> const&) /sc/source/filter/oox/workbookhelper.cxx:1046:27
>     #24 0x7f95442797f1 in oox::xls::WorksheetGlobals::finalizeDrawings() /sc/source/filter/oox/worksheethelper.cxx:1373:9
>     #25 0x7f95442789e0 in oox::xls::WorksheetGlobals::finalizeDrawingImport() /sc/source/filter/oox/worksheethelper.cxx:996:5
>     #26 0x7f954428744d in oox::xls::WorksheetHelper::finalizeDrawingImport() /sc/source/filter/oox/worksheethelper.cxx:1637:17
>     #27 0x7f95441771de in oox::xls::WorkbookFragment::finalizeImport() /sc/source/filter/oox/workbookfragment.cxx:511:18
>     #28 0x7f95cdd5b3ae in oox::core::FragmentHandler2::endDocument() /oox/source/core/fragmenthandler2.cxx:53:5
>     #29 0x7f95caf4cfc2 in sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:896:36
>     #30 0x7f95caf6e950 in sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:1470:13
>     #31 0x7f95cdce50d1 in oox::core::FastParser::parseStream(com::sun::star::xml::sax::InputSource const&, bool) /oox/source/core/fastparser.cxx:121:15
>     #32 0x7f95cdce5868 in oox::core::FastParser::parseStream(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, rtl::OUString const&) /oox/source/core/fastparser.cxx:129:5
>     #33 0x7f95cddbb234 in oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&) /oox/source/core/xmlfilterbase.cxx:414:21
>     #34 0x7f95cddb9b8d in oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&) /oox/source/core/xmlfilterbase.cxx:344:12
>     #35 0x7f95435c4daa in oox::xls::ExcelFilter::importDocument() /sc/source/filter/oox/excelfilter.cxx:113:25
>     #36 0x7f95cdcf953b in oox::core::FilterBase::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /oox/source/core/filterbase.cxx:488:49
>     #37 0x7f95435c7733 in oox::xls::ExcelFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sc/source/filter/oox/excelfilter.cxx:176:25
>     #38 0x7f95857c5b40 in SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) /sfx2/source/doc/objstor.cxx:2393:34
>     #39 0x7f9585781c6a in SfxObjectShell::DoLoad(SfxMedium*) /sfx2/source/doc/objstor.cxx:761:23
>     #40 0x7f95859a9652 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/sfxbasemodel.cxx:1980:36
>     #41 0x7f95862145e9 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
>     #42 0x7f95536a9900 in framework::LoadEnv::impl_loadContent() /framework/source/loadenv/loadenv.cxx:1176:37
>     #43 0x7f95536a091b in framework::LoadEnv::start() /framework/source/loadenv/loadenv.cxx:412:20
>     #44 0x7f9553698f59 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
>     #45 0x7f95536946e7 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
>     #46 0x7f955376867d 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
>     #47 0x7f95537688a6 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
>     #48 0x7f9569f7cafa 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
>     #49 0x7f9580718c56 in UnoApiTest::loadWithParams(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /test/source/unoapi_test.cxx:126:19
>     #50 0x7f9580717ef8 in UnoApiTest::load(rtl::OUString const&, char const*) /test/source/unoapi_test.cxx:108:5
>     #51 0x7f9580719254 in UnoApiTest::loadFromFile(std::basic_string_view<char16_t, std::char_traits<char16_t> >, char const*) /test/source/unoapi_test.cxx:132:5
>     #52 0x7f95d8bf1018 in testTdf123647::TestBody() /chart2/qa/extras/chart2export2.cxx:1242:5

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

Change-Id: I870d811e78b8c55b84627ae609f98f623465dd9d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162294
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
(cherry picked from commit 3fb9859)
tdf-gerrit pushed a commit that referenced this pull request Oct 3, 2024
...in code newly introduced in 135ce25
"tdf#146487 Don't show generic diagram title when there is an empty title
given", which caused CppunitTest_chart2_export2 to fail with

> /oox/inc/drawingml/chart/plotareaconverter.hxx:78:62: runtime error: load of value 222, which is not a valid value for type 'bool'
>     #0 0x7f95cd9ed87c in oox::drawingml::chart::PlotAreaConverter::isSingleSeriesTitle() const /oox/inc/drawingml/chart/plotareaconverter.hxx:78:62
>     #1 0x7f95cd9e506f in oox::drawingml::chart::ChartSpaceConverter::convertFromModel(com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&, com::sun::star::awt::Point const&) /oox/source/drawingml/chart/chartspaceconverter.cxx:189:53
>     #2 0x7f95cd9b6c34 in oox::drawingml::chart::ChartConverter::convertFromModel(oox::core::XmlFilterBase&, oox::drawingml::chart::ChartSpaceModel&, com::sun::star::uno::Reference<com::sun::star::chart2::XChartDocument> const&, com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&, com::sun::star::awt::Point const&, com::sun::star::awt::Size const&) /oox/source/drawingml/chart/chartconverter.cxx:93:20
>     #3 0x7f95ce548f59 in oox::drawingml::Shape::finalizeXShape(oox::core::XmlFilterBase&, com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&) /oox/source/drawingml/shape.cxx:2245:50
>     #4 0x7f95438150b2 in oox::xls::Shape::finalizeXShape(oox::core::XmlFilterBase&, com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&) /sc/source/filter/oox/drawingfragment.cxx:113:30
>     #5 0x7f95ce5267bb in oox::drawingml::Shape::createAndInsert(oox::core::XmlFilterBase&, rtl::OUString const&, oox::drawingml::Theme const*, com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&, bool, bool, basegfx::B2DHomMatrix&, oox::drawingml::FillProperties const&, std::shared_ptr<oox::drawingml::Shape>) /oox/source/drawingml/shape.cxx:1964:9
>     #6 0x7f95ce4edb54 in oox::drawingml::Shape::addShape(oox::core::XmlFilterBase&, oox::drawingml::Theme const*, com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&, basegfx::B2DHomMatrix const&, oox::drawingml::FillProperties const&, std::__debug::map<rtl::OUString, std::shared_ptr<oox::drawingml::Shape>, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, std::shared_ptr<oox::drawingml::Shape> > > >*, std::shared_ptr<oox::drawingml::Shape>) /oox/source/drawingml/shape.cxx:366:41
>     #7 0x7f954381ef79 in oox::xls::DrawingFragment::onEndElement() /sc/source/filter/oox/drawingfragment.cxx:335:30
>     #8 0x7f95cdcaee54 in oox::core::ContextHandler2Helper::implEndElement(int) /oox/source/core/contexthandler2.cxx:125:9
>     #9 0x7f95cdd5c116 in oox::core::FragmentHandler2::endFastElement(int) /oox/source/core/fragmenthandler2.cxx:91:5
>     #10 0x7f95caf68fca in (anonymous namespace)::Entity::endElement() /sax/source/fastparser/fastparser.cxx:514:27
>     #11 0x7f95caf68998 in sax_fastparser::FastSaxParserImpl::callbackEndElement() /sax/source/fastparser/fastparser.cxx:1331:17
>     #12 0x7f95caf58444 in (anonymous namespace)::call_callbackEndElement(void*, unsigned char const*, unsigned char const*, unsigned char const*) /sax/source/fastparser/fastparser.cxx:338:18
>     #13 0x7f960adebeda in xmlParseEndTag2 /workdir/UnpackedTarball/libxml2/parser.c:10090:2
>     #14 0x7f960ad929b5 in xmlParseTryOrFinish /workdir/UnpackedTarball/libxml2/parser.c:11868:14
>     #15 0x7f960ad86334 in xmlParseChunk /workdir/UnpackedTarball/libxml2/parser.c:12151:5
>     #16 0x7f95caf53231 in sax_fastparser::FastSaxParserImpl::parse() /sax/source/fastparser/fastparser.cxx:1085:21
>     #17 0x7f95caf4cd18 in sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:890:9
>     #18 0x7f95caf6e950 in sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:1470:13
>     #19 0x7f95cdce50d1 in oox::core::FastParser::parseStream(com::sun::star::xml::sax::InputSource const&, bool) /oox/source/core/fastparser.cxx:121:15
>     #20 0x7f95cdce5868 in oox::core::FastParser::parseStream(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, rtl::OUString const&) /oox/source/core/fastparser.cxx:129:5
>     #21 0x7f95cddbb234 in oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&) /oox/source/core/xmlfilterbase.cxx:414:21
>     #22 0x7f95cddb9b8d in oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&) /oox/source/core/xmlfilterbase.cxx:344:12
>     #23 0x7f95441ceaa8 in oox::xls::WorkbookHelper::importOoxFragment(rtl::Reference<oox::core::FragmentHandler> const&) /sc/source/filter/oox/workbookhelper.cxx:1046:27
>     #24 0x7f95442797f1 in oox::xls::WorksheetGlobals::finalizeDrawings() /sc/source/filter/oox/worksheethelper.cxx:1373:9
>     #25 0x7f95442789e0 in oox::xls::WorksheetGlobals::finalizeDrawingImport() /sc/source/filter/oox/worksheethelper.cxx:996:5
>     #26 0x7f954428744d in oox::xls::WorksheetHelper::finalizeDrawingImport() /sc/source/filter/oox/worksheethelper.cxx:1637:17
>     #27 0x7f95441771de in oox::xls::WorkbookFragment::finalizeImport() /sc/source/filter/oox/workbookfragment.cxx:511:18
>     #28 0x7f95cdd5b3ae in oox::core::FragmentHandler2::endDocument() /oox/source/core/fragmenthandler2.cxx:53:5
>     #29 0x7f95caf4cfc2 in sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:896:36
>     #30 0x7f95caf6e950 in sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:1470:13
>     #31 0x7f95cdce50d1 in oox::core::FastParser::parseStream(com::sun::star::xml::sax::InputSource const&, bool) /oox/source/core/fastparser.cxx:121:15
>     #32 0x7f95cdce5868 in oox::core::FastParser::parseStream(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, rtl::OUString const&) /oox/source/core/fastparser.cxx:129:5
>     #33 0x7f95cddbb234 in oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&) /oox/source/core/xmlfilterbase.cxx:414:21
>     #34 0x7f95cddb9b8d in oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&) /oox/source/core/xmlfilterbase.cxx:344:12
>     #35 0x7f95435c4daa in oox::xls::ExcelFilter::importDocument() /sc/source/filter/oox/excelfilter.cxx:113:25
>     #36 0x7f95cdcf953b in oox::core::FilterBase::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /oox/source/core/filterbase.cxx:488:49
>     #37 0x7f95435c7733 in oox::xls::ExcelFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sc/source/filter/oox/excelfilter.cxx:176:25
>     #38 0x7f95857c5b40 in SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) /sfx2/source/doc/objstor.cxx:2393:34
>     #39 0x7f9585781c6a in SfxObjectShell::DoLoad(SfxMedium*) /sfx2/source/doc/objstor.cxx:761:23
>     #40 0x7f95859a9652 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/sfxbasemodel.cxx:1980:36
>     #41 0x7f95862145e9 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
>     #42 0x7f95536a9900 in framework::LoadEnv::impl_loadContent() /framework/source/loadenv/loadenv.cxx:1176:37
>     #43 0x7f95536a091b in framework::LoadEnv::start() /framework/source/loadenv/loadenv.cxx:412:20
>     #44 0x7f9553698f59 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
>     #45 0x7f95536946e7 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
>     #46 0x7f955376867d 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
>     #47 0x7f95537688a6 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
>     #48 0x7f9569f7cafa 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
>     #49 0x7f9580718c56 in UnoApiTest::loadWithParams(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /test/source/unoapi_test.cxx:126:19
>     #50 0x7f9580717ef8 in UnoApiTest::load(rtl::OUString const&, char const*) /test/source/unoapi_test.cxx:108:5
>     #51 0x7f9580719254 in UnoApiTest::loadFromFile(std::basic_string_view<char16_t, std::char_traits<char16_t> >, char const*) /test/source/unoapi_test.cxx:132:5
>     #52 0x7f95d8bf1018 in testTdf123647::TestBody() /chart2/qa/extras/chart2export2.cxx:1242:5

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

Change-Id: I870d811e78b8c55b84627ae609f98f623465dd9d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162294
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
(cherry picked from commit 3fb9859)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174442
Tested-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
tdf-gerrit pushed a commit that referenced this pull request Oct 22, 2024
Instead of using a custom (non-recursive) std::mutex in the
extension manager dialog, hold the (recursive) SolarMutex instead.

As the backtrace in attachment 197155 in tdf#161625 (s.a. below)
shows, a recursive mutex is needed:

dp_gui::ExtMgrDialog::TimeOutHdl (frame 17) locks the mutex, then
dp_gui::ExtMgrDialog::startProgress (frame 6) wants to lock it
again, causing a deadlock.

(Switching ExtMgrDialog::m_aMutex to be a std::recursive_mutex
could be an alternative, but follow the common pattern of holding
the SolarMutex while doing UI stuff instead.)

Somewhat similar commit:

    commit 406a7e9
    Date:   Wed Jul 10 12:46:50 2024 +0200

        fix locking in UpdateRequiredDialog

Backtrace of deadlock:

    #0  0x00007f883f6adc70 in ?? () from /usr/lib/libc.so.6
    #1  0x00007f883f6b4b01 in pthread_mutex_lock () from /usr/lib/libc.so.6
    #2  0x00007f87f3ea068e in __gthread_mutex_lock (__mutex=0x5782aab26e48) at /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.2.1/../../../../include/c++/14.2.1/x86_64-pc-linux-gnu/bits/gthr-default.h:762
    #3  std::mutex::lock (this=0x5782aab26e48) at /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.2.1/../../../../include/c++/14.2.1/bits/std_mutex.h:113
    #4  std::unique_lock<std::mutex>::lock (this=<optimized out>) at /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.2.1/../../../../include/c++/14.2.1/bits/unique_lock.h:147
    #5  std::unique_lock<std::mutex>::unique_lock (__m=..., this=<optimized out>) at /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.2.1/../../../../include/c++/14.2.1/bits/unique_lock.h:73
    #6  dp_gui::ExtMgrDialog::startProgress (this=0x5782aab26de0, _bLockInterface=0x80) at /home/user/libreofficetwo/desktop/source/deployment/gui/dp_gui_dialog2.cxx:779
    #7  0x00007f883b4080a1 in Link<void*, void>::Call (this=0x7f86b0000c08, data=0x80) at include/tools/link.hxx:111
    #8  ImplHandleUserEvent (pSVEvent=pSVEvent@entry=0x7f86b0000c00) at /home/user/libreofficetwo/vcl/source/window/winproc.cxx:2285
    #9  0x00007f883b40616a in ImplWindowFrameProc (_pWindow=0x5782a76df9f0, nEvent=SalEvent::UserEvent, pEvent=0x7f86b0000c00) at /home/user/libreofficetwo/vcl/source/window/winproc.cxx:2849
    #10 0x00007f883b6c711e in SalUserEventList::DispatchUserEvents(bool)::$_0::operator()() const (this=<optimized out>) at /home/user/libreofficetwo/vcl/source/app/salusereventlist.cxx:119
    #11 SalUserEventList::DispatchUserEvents (this=0x5782a62edb08, bHandleAllCurrentEvents=false) at /home/user/libreofficetwo/vcl/source/app/salusereventlist.cxx:120
    #12 0x00007f8833fb7827 in QtInstance::ImplYield (this=this@entry=0x5782a62edad0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:447
    #13 0x00007f8833fb9e11 in QtInstance::DoYield (this=0x5782a62edad0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:469
    #14 0x00007f883b70fc72 in ImplYield (i_bWait=true, i_bAllEvents=false) at /home/user/libreofficetwo/vcl/source/app/svapp.cxx:385
    #15 Application::Yield () at /home/user/libreofficetwo/vcl/source/app/svapp.cxx:473
    #16 0x00007f883b486415 in ProgressBar::SetValue (this=<optimized out>, nNewPercent=<optimized out>) at /home/user/libreofficetwo/vcl/source/control/prgsbar.cxx:199
    #17 0x00007f87f3ea14ca in dp_gui::ExtMgrDialog::TimeOutHdl (this=0x5782aab26de0) at /home/user/libreofficetwo/desktop/source/deployment/gui/dp_gui_dialog2.cxx:976
    #18 0x00007f883b6ff8c7 in Scheduler::CallbackTaskScheduling () at /home/user/libreofficetwo/vcl/source/app/scheduler.cxx:509
    #19 0x00007f8833fd4013 in SalTimer::CallCallback (this=0x5782a77b83d0) at vcl/inc/saltimer.hxx:53
    #20 QtTimer::timeoutActivated (this=0x5782a77b83c0) at vcl/qt6/../qt5/QtTimer.cxx:51
    #21 0x00007f88341a3397 in ?? () from /usr/lib/libQt6Core.so.6
    #22 0x00007f88341ab5e5 in QTimer::timerEvent(QTimerEvent*) () from /usr/lib/libQt6Core.so.6
    #23 0x00007f883418d859 in QObject::event(QEvent*) () from /usr/lib/libQt6Core.so.6
    #24 0x00007f8832efc8cc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt6Widgets.so.6
    #25 0x00007f8834145aa8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt6Core.so.6
    #26 0x00007f88342c7658 in QTimerInfoList::activateTimers() () from /usr/lib/libQt6Core.so.6
    #27 0x00007f88343a9f99 in ?? () from /usr/lib/libQt6Core.so.6
    #28 0x00007f8837877299 in ?? () from /usr/lib/libglib-2.0.so.0
    #29 0x00007f88378d9ec7 in ?? () from /usr/lib/libglib-2.0.so.0
    #30 0x00007f8837876795 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
    #31 0x00007f88343a82bd in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt6Core.so.6
    #32 0x00007f8833fb789d in QtInstance::ImplYield (this=this@entry=0x5782a62edad0, bWait=<optimized out>, bHandleAllCurrentEvents=<optimized out>) at vcl/qt6/../qt5/QtInstance.cxx:458
    #33 0x00007f8833fb9e11 in QtInstance::DoYield (this=0x5782a62edad0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:469
    #34 0x00007f883b70fc72 in ImplYield (i_bWait=true, i_bAllEvents=false) at /home/user/libreofficetwo/vcl/source/app/svapp.cxx:385
    #35 Application::Yield () at /home/user/libreofficetwo/vcl/source/app/svapp.cxx:473
    #36 0x00007f883b70fb90 in Application::Execute () at /home/user/libreofficetwo/vcl/source/app/svapp.cxx:360
    #37 0x00007f883f8e1770 in desktop::Desktop::Main (this=0x7ffc2a5b0d28) at /home/user/libreofficetwo/desktop/source/app/app.cxx:1691
    #38 0x00007f883b717e1e in ImplSVMain () at /home/user/libreofficetwo/vcl/source/app/svmain.cxx:228
    #39 0x00007f883f90ef8a in soffice_main () at /home/user/libreofficetwo/desktop/source/app/sofficemain.cxx:121
    #40 0x000057829d6f683b in sal_main () at /home/user/libreofficetwo/desktop/source/app/main.c:51
    #41 main (argc=<optimized out>, argv=<optimized out>) at /home/user/libreofficetwo/desktop/source/app/main.c:49

Change-Id: I96d746eb1493aaf5b56d50664c9d1817699f21bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175298
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Reviewed-by: Rafael Lima <rafael.palma.lima@gmail.com>
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
tdf-gerrit pushed a commit that referenced this pull request Oct 22, 2024
Instead of using a custom (non-recursive) std::mutex in the
extension manager dialog, hold the (recursive) SolarMutex instead.

As the backtrace in attachment 197155 in tdf#161625 (s.a. below)
shows, a recursive mutex is needed:

dp_gui::ExtMgrDialog::TimeOutHdl (frame 17) locks the mutex, then
dp_gui::ExtMgrDialog::startProgress (frame 6) wants to lock it
again, causing a deadlock.

(Switching ExtMgrDialog::m_aMutex to be a std::recursive_mutex
could be an alternative, but follow the common pattern of holding
the SolarMutex while doing UI stuff instead.)

Somewhat similar commit:

    commit 406a7e9
    Date:   Wed Jul 10 12:46:50 2024 +0200

        fix locking in UpdateRequiredDialog

Backtrace of deadlock:

    #0  0x00007f883f6adc70 in ?? () from /usr/lib/libc.so.6
    #1  0x00007f883f6b4b01 in pthread_mutex_lock () from /usr/lib/libc.so.6
    #2  0x00007f87f3ea068e in __gthread_mutex_lock (__mutex=0x5782aab26e48) at /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.2.1/../../../../include/c++/14.2.1/x86_64-pc-linux-gnu/bits/gthr-default.h:762
    #3  std::mutex::lock (this=0x5782aab26e48) at /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.2.1/../../../../include/c++/14.2.1/bits/std_mutex.h:113
    #4  std::unique_lock<std::mutex>::lock (this=<optimized out>) at /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.2.1/../../../../include/c++/14.2.1/bits/unique_lock.h:147
    #5  std::unique_lock<std::mutex>::unique_lock (__m=..., this=<optimized out>) at /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.2.1/../../../../include/c++/14.2.1/bits/unique_lock.h:73
    #6  dp_gui::ExtMgrDialog::startProgress (this=0x5782aab26de0, _bLockInterface=0x80) at /home/user/libreofficetwo/desktop/source/deployment/gui/dp_gui_dialog2.cxx:779
    #7  0x00007f883b4080a1 in Link<void*, void>::Call (this=0x7f86b0000c08, data=0x80) at include/tools/link.hxx:111
    #8  ImplHandleUserEvent (pSVEvent=pSVEvent@entry=0x7f86b0000c00) at /home/user/libreofficetwo/vcl/source/window/winproc.cxx:2285
    #9  0x00007f883b40616a in ImplWindowFrameProc (_pWindow=0x5782a76df9f0, nEvent=SalEvent::UserEvent, pEvent=0x7f86b0000c00) at /home/user/libreofficetwo/vcl/source/window/winproc.cxx:2849
    #10 0x00007f883b6c711e in SalUserEventList::DispatchUserEvents(bool)::$_0::operator()() const (this=<optimized out>) at /home/user/libreofficetwo/vcl/source/app/salusereventlist.cxx:119
    #11 SalUserEventList::DispatchUserEvents (this=0x5782a62edb08, bHandleAllCurrentEvents=false) at /home/user/libreofficetwo/vcl/source/app/salusereventlist.cxx:120
    #12 0x00007f8833fb7827 in QtInstance::ImplYield (this=this@entry=0x5782a62edad0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:447
    #13 0x00007f8833fb9e11 in QtInstance::DoYield (this=0x5782a62edad0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:469
    #14 0x00007f883b70fc72 in ImplYield (i_bWait=true, i_bAllEvents=false) at /home/user/libreofficetwo/vcl/source/app/svapp.cxx:385
    #15 Application::Yield () at /home/user/libreofficetwo/vcl/source/app/svapp.cxx:473
    #16 0x00007f883b486415 in ProgressBar::SetValue (this=<optimized out>, nNewPercent=<optimized out>) at /home/user/libreofficetwo/vcl/source/control/prgsbar.cxx:199
    #17 0x00007f87f3ea14ca in dp_gui::ExtMgrDialog::TimeOutHdl (this=0x5782aab26de0) at /home/user/libreofficetwo/desktop/source/deployment/gui/dp_gui_dialog2.cxx:976
    #18 0x00007f883b6ff8c7 in Scheduler::CallbackTaskScheduling () at /home/user/libreofficetwo/vcl/source/app/scheduler.cxx:509
    #19 0x00007f8833fd4013 in SalTimer::CallCallback (this=0x5782a77b83d0) at vcl/inc/saltimer.hxx:53
    #20 QtTimer::timeoutActivated (this=0x5782a77b83c0) at vcl/qt6/../qt5/QtTimer.cxx:51
    #21 0x00007f88341a3397 in ?? () from /usr/lib/libQt6Core.so.6
    #22 0x00007f88341ab5e5 in QTimer::timerEvent(QTimerEvent*) () from /usr/lib/libQt6Core.so.6
    #23 0x00007f883418d859 in QObject::event(QEvent*) () from /usr/lib/libQt6Core.so.6
    #24 0x00007f8832efc8cc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt6Widgets.so.6
    #25 0x00007f8834145aa8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt6Core.so.6
    #26 0x00007f88342c7658 in QTimerInfoList::activateTimers() () from /usr/lib/libQt6Core.so.6
    #27 0x00007f88343a9f99 in ?? () from /usr/lib/libQt6Core.so.6
    #28 0x00007f8837877299 in ?? () from /usr/lib/libglib-2.0.so.0
    #29 0x00007f88378d9ec7 in ?? () from /usr/lib/libglib-2.0.so.0
    #30 0x00007f8837876795 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
    #31 0x00007f88343a82bd in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt6Core.so.6
    #32 0x00007f8833fb789d in QtInstance::ImplYield (this=this@entry=0x5782a62edad0, bWait=<optimized out>, bHandleAllCurrentEvents=<optimized out>) at vcl/qt6/../qt5/QtInstance.cxx:458
    #33 0x00007f8833fb9e11 in QtInstance::DoYield (this=0x5782a62edad0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:469
    #34 0x00007f883b70fc72 in ImplYield (i_bWait=true, i_bAllEvents=false) at /home/user/libreofficetwo/vcl/source/app/svapp.cxx:385
    #35 Application::Yield () at /home/user/libreofficetwo/vcl/source/app/svapp.cxx:473
    #36 0x00007f883b70fb90 in Application::Execute () at /home/user/libreofficetwo/vcl/source/app/svapp.cxx:360
    #37 0x00007f883f8e1770 in desktop::Desktop::Main (this=0x7ffc2a5b0d28) at /home/user/libreofficetwo/desktop/source/app/app.cxx:1691
    #38 0x00007f883b717e1e in ImplSVMain () at /home/user/libreofficetwo/vcl/source/app/svmain.cxx:228
    #39 0x00007f883f90ef8a in soffice_main () at /home/user/libreofficetwo/desktop/source/app/sofficemain.cxx:121
    #40 0x000057829d6f683b in sal_main () at /home/user/libreofficetwo/desktop/source/app/main.c:51
    #41 main (argc=<optimized out>, argv=<optimized out>) at /home/user/libreofficetwo/desktop/source/app/main.c:49

Change-Id: I96d746eb1493aaf5b56d50664c9d1817699f21bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175298
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Reviewed-by: Rafael Lima <rafael.palma.lima@gmail.com>
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175402
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant