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

Update firebird254 #3

Closed
wants to merge 7 commits into from
Closed

Update firebird254 #3

wants to merge 7 commits into from

Conversation

mariuz
Copy link
Contributor

@mariuz mariuz commented Jul 2, 2015

No description provided.

@mariuz
Copy link
Contributor Author

mariuz commented Jul 2, 2015

gerrit created
https://gerrit.libreoffice.org/16703

@mariuz mariuz closed this Jul 2, 2015
ghost pushed a commit that referenced this pull request Nov 14, 2015
ghost pushed a commit that referenced this pull request Nov 16, 2015
ghost pushed a commit that referenced this pull request Nov 30, 2015
ghost pushed a commit that referenced this pull request Dec 4, 2015
ghost pushed a commit that referenced this pull request Dec 22, 2015
...as reported by UBSan in CppunitTest_sw_filters_test:

> /sw/inc/format.hxx:110:73: runtime error: downcast of address 0x2af2d8024000 which does not point to an object of type 'const SwFormat'
> 0x2af2d8024000: note: object is of type 'SwModify'
>  f2 2a 00 00  70 33 2f 87 f2 2a 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00
>               ^~~~~~~~~~~~~~~~~~~~~~~
>               vptr for 'SwModify'
>     #0 0x2af27bbe8083 in SwFormat::DerivedFrom() const /sw/inc/format.hxx:110:73
>     #1 0x2af27bbc8401 in SwFormat::Modify(SfxPoolItem const*, SfxPoolItem const*) /sw/source/core/attr/format.cxx:282:21
>     #2 0x2af27e9934a3 in SwFrameFormat::Modify(SfxPoolItem const*, SfxPoolItem const*) /sw/source/core/layout/atrfrm.cxx:2597:5
>     #3 0x2af27f8207d5 in SwTableBoxFormat::Modify(SfxPoolItem const*, SfxPoolItem const*) /sw/source/core/table/swtable.cxx:2353:5
>     #4 0x2af27bb9cd52 in SwClient::SwClientNotify(SwModify const&, SfxHint const&) /sw/source/core/attr/calbck.cxx:68:9
>     #5 0x2af27bba4bee in SwModify::CallSwClientNotify(SfxHint const&) const /sw/inc/calbck.hxx:349:9
>     #6 0x2af27bba290b in SwModify::ModifyBroadcast(SfxPoolItem const*, SfxPoolItem const*) /sw/inc/calbck.hxx:173:11
>     #7 0x2af27bb9fbc0 in SwModify::NotifyClients(SfxPoolItem const*, SfxPoolItem const*) /sw/source/core/attr/calbck.cxx:143:5
>     #8 0x2af27bb9e0e7 in SwModify::~SwModify() /sw/source/core/attr/calbck.cxx:101:5
>     #9 0x2af27bbc6bb4 in SwFormat::~SwFormat() /sw/source/core/attr/format.cxx:251:1
>     #10 0x2af27e98fdf3 in SwFrameFormat::~SwFrameFormat() /sw/source/core/layout/atrfrm.cxx:2534:1
>     #11 0x2af27e9900af in SwFrameFormat::~SwFrameFormat() /sw/source/core/layout/atrfrm.cxx:2525:1
>     #12 0x2af27cb1646e in SwDoc::~SwDoc() /sw/source/core/doc/docnew.cxx:592:5
>     #13 0x2af27cb1993f in SwDoc::~SwDoc() /sw/source/core/doc/docnew.cxx:385:1
>     #14 0x2af282d45bb0 in SwDocShell::RemoveLink() /sw/source/uibase/app/docshini.cxx:472:13
>     #15 0x2af282d43596 in SwDocShell::~SwDocShell() /sw/source/uibase/app/docshini.cxx:394:5
>     #16 0x2af282d45f46 in SwDocShell::~SwDocShell() /sw/source/uibase/app/docshini.cxx:384:1
>     #17 0x2af282d4637f in SwDocShell::~SwDocShell() /sw/source/uibase/app/docshini.cxx:384:1
>     #18 0x2af282d464c6 in virtual thunk to SwDocShell::~SwDocShell() /sw/source/uibase/app/docshini.cxx:383:13
>     #19 0x2af27420aade in SvRefBase::ReleaseRef() /include/tools/ref.hxx:138:29
>     #20 0x2af27420195a in tools::SvRef<SwDocShell>::~SvRef() /include/tools/ref.hxx:49:30
>     #21 0x2af2741f6663 in SwFiltersTest::filter(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) /sw/qa/core/filters-test.cxx:130:1
>     #22 0x2af2741f368e in SwFiltersTest::load(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int) /sw/qa/core/filters-test.cxx:69:12
>     #23 0x2af29a05d1fb in test::FiltersTest::recursiveScan(test::filterStatus, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) /unotest/source/cpp/filters-test.cxx:129:20
>     #24 0x2af29a060741 in test::FiltersTest::testDir(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) /unotest/source/cpp/filters-test.cxx:154:5
>     #25 0x2af2741fa8fa in SwFiltersTest::testCVEs() /sw/qa/core/filters-test.cxx:174:5
>     #26 0x2af27421631d in CppUnit::TestCaller<SwFiltersTest>::runTest() /workdir/UnpackedTarball/cppunit/include/cppunit/TestCaller.h:166:6
>     #27 0x2af23644866d in CppUnit::TestCaseMethodFunctor::operator()() const /workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:32:5
>     #28 0x2af24e66d0d6 in (anonymous namespace)::Protector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) /test/source/vclbootstrapprotector.cxx:57:14
>     #29 0x2af236403bb7 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const /workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:12
>     #30 0x2af2458a1926 in (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) /unotest/source/cpp/unobootstrapprotector/unobootstrapprotector.cxx:88:12
>     #31 0x2af236403bb7 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const /workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:12
>     #32 0x2af241b89d58 in (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) /unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx:63:16
>     #33 0x2af236403bb7 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const /workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:12
>     #34 0x2af23638b90c in CppUnit::DefaultProtector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) /workdir/UnpackedTarball/cppunit/src/cppunit/DefaultProtector.cpp:15:12
>     #35 0x2af236403bb7 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const /workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:12
>     #36 0x2af2363ffb61 in CppUnit::ProtectorChain::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) /workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:77:18
>     #37 0x2af2364c91c5 in CppUnit::TestResult::protect(CppUnit::Functor const&, CppUnit::Test*, std::string const&) /workdir/UnpackedTarball/cppunit/src/cppunit/TestResult.cpp:181:10
>     #38 0x2af2364451c6 in CppUnit::TestCase::run(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:91:5
>     #39 0x2af23644bc03 in CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:64:5
>     #40 0x2af23644ab6d in CppUnit::TestComposite::run(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:23:3
>     #41 0x2af23644bc03 in CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:64:5
>     #42 0x2af23644ab6d in CppUnit::TestComposite::run(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:23:3
>     #43 0x2af2365078c6 in CppUnit::TestRunner::WrappingSuite::run(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestRunner.cpp:47:5
>     #44 0x2af2364c7049 in CppUnit::TestResult::runTest(CppUnit::Test*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestResult.cpp:148:3
>     #45 0x2af236508e86 in CppUnit::TestRunner::run(CppUnit::TestResult&, std::string const&) /workdir/UnpackedTarball/cppunit/src/cppunit/TestRunner.cpp:96:3
>     #46 0x501b3c in (anonymous namespace)::ProtectedFixtureFunctor::run() const /sal/cppunittester/cppunittester.cxx:281:13
>     #47 0x4fc866 in sal_main() /sal/cppunittester/cppunittester.cxx:431:14
>     #48 0x4fa822 in main /sal/cppunittester/cppunittester.cxx:338:1
>     #49 0x2af2380d2af4 in __libc_start_main (/lib64/libc.so.6+0x21af4)
>     #50 0x4323c4 in _start (/workdir/LinkTarget/Executable/cppunittester+0x4323c4)

Change-Id: Ic1ff73d3184ad2cd97555b7a45fb205e9ec84ac6
ghost pushed a commit that referenced this pull request Feb 5, 2016
(5abe0ab).
6884f53 "default B2DRange ctor doesn't do what
I thought it did" had reverted it, but the fix there is apparently not enough
yet, <http://ci.libreoffice.org/job/lo_ubsan/165/console> still fails with

> /vcl/headless/svpgdi.cxx:1274:28: runtime error: value 1.79769e+308 is outside the range of representable values of type 'int'
>  #0 0x2b826285b4d3 in SvpSalGraphics::releaseCairoContext(_cairo*, bool, basegfx::B2DRange const&) const /vcl/headless/svpgdi.cxx:1274:28
>  #1 0x2b8262868c3b in SvpSalGraphics::drawPolyPolygon(basegfx::B2DPolyPolygon const&) /vcl/headless/svpgdi.cxx:899:5
>  #2 0x2b826286c6f6 in SvpSalGraphics::drawPolygon(unsigned int, SalPoint const*) /vcl/headless/svpgdi.cxx:551:5
>  #3 0x2b826179915c in SalGraphics::DrawPolygon(unsigned int, SalPoint const*, OutputDevice const*) /vcl/source/gdi/salgdilayout.cxx:419:9
>  #4 0x2b82604d6f5a in OutputDevice::DrawEllipse(Rectangle const&) /vcl/source/outdev/curvedshapes.cxx:67:13
>  #5 0x2b8261f02c4d in CircType::Draw(OutputDevice&) /vcl/source/filter/sgvmain.cxx:596:13
>  #6 0x2b8261f0ddc6 in DrawObjkList(SvStream&, OutputDevice&) /vcl/source/filter/sgvmain.cxx:698:100
>  #7 0x2b8261f1462a in SgfFilterSDrw(SvStream&, SgfHeader&, SgfEntry&, GDIMetaFile&) /vcl/source/filter/sgvmain.cxx:820:26
>  #8 0x2b8261f16726 in SgfSDrwFilter(SvStream&, GDIMetaFile&, INetURLObject const&) /vcl/source/filter/sgvmain.cxx:858:22
>  #9 0x2b8261e48f33 in GraphicFilter::ImportGraphic(Graphic&, rtl::OUString const&, SvStream&, unsigned short, unsigned short*, GraphicFilterImportFlags, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>*, WMF_EXTERNALHEADER*) /vcl/source/filter/graphicfilter.cxx:1670:30
>  #10 0x2b8261e3c85a in GraphicFilter::ImportGraphic(Graphic&, rtl::OUString const&, SvStream&, unsigned short, unsigned short*, GraphicFilterImportFlags, WMF_EXTERNALHEADER*) /vcl/source/filter/graphicfilter.cxx:1314:12
>  #11 0x2b827bb9fee3 in VclFiltersTest::load(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int) /vcl/qa/cppunit/graphicfilter/filters-test.cxx:60:12
[...]

Change-Id: Icb8f52414f57f08334fc501842b3f75c1d3642eb
ghost pushed a commit that referenced this pull request Apr 4, 2016
Change-Id: I1c105de7e1df251533179fba77e3797ef1c4e2d4
Reviewed-on: https://gerrit.libreoffice.org/23752
Tested-by: Jenkins <[email protected]>
Reviewed-by: Noel Grandin <[email protected]>
ghost pushed a commit that referenced this pull request Apr 5, 2016
Make TitleHelper listen for controller events.
When the controller disposes, it calls the disposing method and releases its
leased number. Direct cast to XEventListener is ambiguous, so upcasting
path has been defined.
This commit depends on the commit f80de31

Change-Id: I79d859edf8e66ae6e777ba8e8d6c9d1dac4048e1
Reviewed-on: https://gerrit.libreoffice.org/23722
Tested-by: Jenkins <[email protected]>
Reviewed-by: Stephan Bergmann <[email protected]>
ghost pushed a commit that referenced this pull request Apr 6, 2016
At least the checkTitleNumbers(complex.XTitle.CheckXTitle) in
JunitTest_framework_complex triggered the UBSan failure

> sw/source/uibase/uiview/pview.cxx:1139:25: runtime error: downcast of address 0x61300047e500 which does not point to an object of type 'SwEditShell'
> 0x61300047e500: note: object is of type 'SwViewShell'
>  d3 03 80 0d  10 f6 8e e0 fa 2a 00 00  80 b2 1b 00 90 61 00 00  80 b2 1b 00 90 61 00 00  00 00 00 00
>               ^~~~~~~~~~~~~~~~~~~~~~~
>               vptr for 'SwViewShell'
>     #0 0x2afadd5b9594 in SwPagePreview::Init() sw/source/uibase/uiview/pview.cxx:1139:25
>     #1 0x2afadd5c0e29 in SwPagePreview::SwPagePreview(SfxViewFrame*, SfxViewShell*) sw/source/uibase/uiview/pview.cxx:1251:5
>     #2 0x2afadd58c7a5 in SwPagePreview::CreateInstance(SfxViewFrame*, SfxViewShell*) sw/source/uibase/uiview/pview.cxx:85:1
>     #3 0x2afa4a476c8c in SfxViewFactory::CreateInstance(SfxViewFrame*, SfxViewShell*) sfx2/source/view/viewfac.cxx:28:12
>     #4 0x2afa49b677a5 in SfxBaseModel::createViewController(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&) sfx2/source/doc/sfxbasemodel.cxx:4255:32
>     #5 0x2afa49b6ac45 in non-virtual thunk to SfxBaseModel::createViewController(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&) sfx2/source/doc/sfxbasemodel.cxx:4217:57
>     #6 0x2afa4a38bd08 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&) sfx2/source/view/frmload.cxx:600:50
>     #7 0x2afa4a37f627 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:728:13
>     #8 0x2afac3723d1a in framework::LoadEnv::impl_loadContent() framework/source/loadenv/loadenv.cxx:1117:24
>     #9 0x2afac3707b02 in framework::LoadEnv::startLoading() framework/source/loadenv/loadenv.cxx:379:20
>     #10 0x2afac37007d5 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:165:9
>     #11 0x2afac396848d in (anonymous namespace)::Frame::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) framework/source/services/frame.cxx:608:12
>     #12 0x2afac39a369a in non-virtual thunk to (anonymous namespace)::Frame::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) framework/source/services/frame.cxx:587:62
>     #13 0x2afa4a4cdd1a in SfxViewFrame::LoadViewIntoFrame_Impl(SfxObjectShell const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, unsigned short, bool) sfx2/source/view/viewfrm.cxx:1897:5
>     #14 0x2afa4a501df3 in SfxViewFrame::SwitchToViewShell_Impl(unsigned short, bool) sfx2/source/view/viewfrm.cxx:2096:32
>     #15 0x2afa4a4a7491 in SfxViewFrame::ExecView_Impl(SfxRequest&) sfx2/source/view/viewfrm.cxx:2181:29
>     #16 0x2afa4a4a5d16 in SfxStubSfxViewFrameExecView_Impl(SfxShell*, SfxRequest&) workdir/SdiTarget/sfx2/sdi/sfxslots.hxx:709:1
>     #17 0x2afa483dfe06 in SfxShell::CallExec(void (*)(SfxShell*, SfxRequest&), SfxRequest&) include/sfx2/shell.hxx:204:35
>     #18 0x2afa48392c56 in SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, SfxRequest&, bool) sfx2/source/control/dispatch.cxx:262:13
>     #19 0x2afa483bf830 in SfxDispatcher::PostMsgHandler(SfxRequest*) sfx2/source/control/dispatch.cxx:1085:17
>     #20 0x2afa48398545 in SfxDispatcher::LinkStubPostMsgHandler(void*, SfxRequest*) sfx2/source/control/dispatch.cxx:1065:1
>     #21 0x2afa49d320a7 in Link<SfxRequest*, void>::Call(SfxRequest*) const include/tools/link.hxx:84:45
>     #22 0x2afa49d31b50 in SfxHintPoster::DoEvent_Impl(void*) sfx2/source/notify/hintpost.cxx:44:5
>     #23 0x2afa49d319e5 in SfxHintPoster::LinkStubDoEvent_Impl(void*, void*) sfx2/source/notify/hintpost.cxx:42:1
>     #24 0x2afa69f03327 in Link<void*, void>::Call(void*) const include/tools/link.hxx:84:45
>     #25 0x2afa69eec39f in ImplHandleUserEvent(ImplSVEvent*) vcl/source/window/winproc.cxx:1959:13
>     #26 0x2afa69ed7183 in ImplWindowFrameProc(vcl::Window*, unsigned short, void const*) vcl/source/window/winproc.cxx:2527:13
>     #27 0x2afa6cf9a0f9 in SalFrame::CallCallback(unsigned short, void const*) const vcl/inc/salframe.hxx:273:33
>     #28 0x2afa6cff0a85 in SvpSalInstance::DoYield(bool, bool, unsigned long) vcl/headless/svpinst.cxx:293:17
>     #29 0x2afa6c484a64 in ImplYield(bool, bool, unsigned long) vcl/source/app/svapp.cxx:509:9
>     #30 0x2afa6c45ed83 in Application::Yield() vcl/source/app/svapp.cxx:553:5
>     #31 0x2afa6c45eb1a in Application::Execute() vcl/source/app/svapp.cxx:473:9
>     #32 0x2afa38280294 in desktop::Desktop::DoExecute() desktop/source/app/app.cxx:1322:5
>     #33 0x2afa3828ada3 in desktop::Desktop::Main() desktop/source/app/app.cxx:1647:17
>     #34 0x2afa6c4de08e in ImplSVMain() vcl/source/app/svmain.cxx:172:19
>     #35 0x2afa6c4eb776 in SVMain() vcl/source/app/svmain.cxx:210:16
>     #36 0x2afa384c5d01 in soffice_main desktop/source/app/sofficemain.cxx:135:12
>     #37 0x4f0f0c in sal_main desktop/source/app/main.c:48:15
>     #38 0x4f0ee6 in main desktop/source/app/main.c:47:1
>     #39 0x2afa39e4c57f in __libc_start_main (/lib64/libc.so.6+0x2057f)
>     #40 0x418f48 in _start (instdir/program/soffice.bin+0x418f48)

Change-Id: I4a32bcf4dea4616d4726c28ba01adba9083ad1c6
ghost pushed a commit that referenced this pull request Apr 6, 2016
At least JunitTest_framework_copmlex triggered the UBSan failure

> vcl/headless/svpgdi.cxx:924:46: runtime error: division by zero
>     #0 0x2b7114500e3b in renderSource(_cairo*, SalTwoRect const&, _cairo_surface*) vcl/headless/svpgdi.cxx:924:46
>     #1 0x2b711450074c in SvpSalGraphics::copySource(SalTwoRect const&, _cairo_surface*) vcl/headless/svpgdi.cxx:937:33
>     #2 0x2b7114501f37 in SvpSalGraphics::copyBits(SalTwoRect const&, SalGraphics*) vcl/headless/svpgdi.cxx:980:5
>     #3 0x2b7113461871 in SalGraphics::CopyBits(SalTwoRect const&, SalGraphics*, OutputDevice const*, OutputDevice const*) vcl/source/gdi/salgdilayout.cxx:529:9
>     #4 0x2b711359a1fc in VirtualDevice::InnerImplSetOutputSizePixel(Size const&, bool, unsigned char*) vcl/source/gdi/virdev.cxx:352:17
>     #5 0x2b711359bef6 in VirtualDevice::ImplSetOutputSizePixel(Size const&, bool, unsigned char*) vcl/source/gdi/virdev.cxx:391:9
>     #6 0x2b711359edc0 in VirtualDevice::SetOutputSizePixel(Size const&, bool) vcl/source/gdi/virdev.cxx:437:12
>     #7 0x2b70fa4b6f3f in sdr::overlay::OverlayManagerBuffered::ImpPrepareBufferDevice() svx/source/sdr/overlay/overlaymanagerbuffered.cxx:45:17
>     #8 0x2b70fa4c0c2c in sdr::overlay::OverlayManagerBuffered::ImpSaveBackground(vcl::Region const&, OutputDevice*) svx/source/sdr/overlay/overlaymanagerbuffered.cxx:159:13
>     #9 0x2b70fa4cecab in sdr::overlay::OverlayManagerBuffered::completeRedraw(vcl::Region const&, OutputDevice*) const svx/source/sdr/overlay/overlaymanagerbuffered.cxx:414:17
>     #10 0x2b70fa787fc4 in SdrPaintWindow::DrawOverlay(vcl::Region const&) svx/source/svdraw/sdrpaintwindow.cxx:334:13
>     #11 0x2b70fb9d388f in SdrPaintView::EndCompleteRedraw(SdrPaintWindow&, bool) svx/source/svdraw/svdpntv.cxx:753:9
>     #12 0x2b70fd77da81 in FmFormView::EndCompleteRedraw(SdrPaintWindow&, bool) svx/source/form/fmview.cxx:474:5
>     #13 0x2b70fb9d64a0 in SdrPaintView::EndDrawLayers(SdrPaintWindow&, bool) svx/source/svdraw/svdpntv.cxx:789:5
>     #14 0x2b7182085fe9 in SwViewShell::DLPostPaint2(bool) sw/source/core/view/viewsh.cxx:240:9
>     #15 0x2b71820d94c5 in SwViewShell::Paint(OutputDevice&, Rectangle const&) sw/source/core/view/viewsh.cxx:1797:21
>     #16 0x2b717c26e635 in SwCursorShell::Paint(OutputDevice&, Rectangle const&) sw/source/core/crsr/crsrsh.cxx:1273:5
>     #17 0x2b71839ae182 in SwEditWin::Paint(OutputDevice&, Rectangle const&) sw/source/uibase/docvw/edtwin2.cxx:475:9
>     #18 0x2b71100ee7e0 in PaintHelper::DoPaint(vcl::Region const*) vcl/source/window/paint.cxx:309:13
>     #19 0x2b71100ff14a in vcl::Window::ImplCallPaint(vcl::Region const*, unsigned short) vcl/source/window/paint.cxx:611:9
>     #20 0x2b71100fb252 in PaintHelper::~PaintHelper() vcl/source/window/paint.cxx:549:17
>     #21 0x2b71100ff463 in vcl::Window::ImplCallPaint(vcl::Region const*, unsigned short) vcl/source/window/paint.cxx:614:1
>     #22 0x2b71100fb252 in PaintHelper::~PaintHelper() vcl/source/window/paint.cxx:549:17
>     #23 0x2b71100ff463 in vcl::Window::ImplCallPaint(vcl::Region const*, unsigned short) vcl/source/window/paint.cxx:614:1
>     #24 0x2b71100fb252 in PaintHelper::~PaintHelper() vcl/source/window/paint.cxx:549:17
>     #25 0x2b71100ff463 in vcl::Window::ImplCallPaint(vcl::Region const*, unsigned short) vcl/source/window/paint.cxx:614:1
>     #26 0x2b71100fb252 in PaintHelper::~PaintHelper() vcl/source/window/paint.cxx:549:17
>     #27 0x2b71100ff463 in vcl::Window::ImplCallPaint(vcl::Region const*, unsigned short) vcl/source/window/paint.cxx:614:1
>     #28 0x2b71100fb252 in PaintHelper::~PaintHelper() vcl/source/window/paint.cxx:549:17
>     #29 0x2b71100ff463 in vcl::Window::ImplCallPaint(vcl::Region const*, unsigned short) vcl/source/window/paint.cxx:614:1
>     #30 0x2b7110100536 in vcl::Window::ImplCallOverlapPaint() vcl/source/window/paint.cxx:635:9
>     #31 0x2b7110102811 in vcl::Window::ImplHandlePaintHdl(Idle*) vcl/source/window/paint.cxx:667:9
>     #32 0x2b7110100ee7 in vcl::Window::LinkStubImplHandlePaintHdl(void*, Idle*) vcl/source/window/paint.cxx:645:1
>     #33 0x2b71101446d7 in Link<Idle*, void>::Call(Idle*) const include/tools/link.hxx:84:45
>     #34 0x2b711380dff9 in Idle::Invoke() vcl/source/app/idle.cxx:25:5
>     #35 0x2b711385011b in ImplSchedulerData::Invoke() vcl/source/app/scheduler.cxx:45:5
>     #36 0x2b71138535e5 in Scheduler::ProcessTaskScheduling(bool) vcl/source/app/scheduler.cxx:177:9
>     #37 0x2b71139a90d4 in ImplYield(bool, bool, unsigned long) vcl/source/app/svapp.cxx:521:5
>     #38 0x2b7113982d83 in Application::Yield() vcl/source/app/svapp.cxx:553:5
>     #39 0x2b7113982b1a in Application::Execute() vcl/source/app/svapp.cxx:473:9
>     #40 0x2b70df7a4294 in desktop::Desktop::DoExecute() desktop/source/app/app.cxx:1322:5
>     #41 0x2b70df7aeda3 in desktop::Desktop::Main() desktop/source/app/app.cxx:1647:17
>     #42 0x2b7113a0208e in ImplSVMain() vcl/source/app/svmain.cxx:172:19
>     #43 0x2b7113a0f776 in SVMain() vcl/source/app/svmain.cxx:210:16
>     #44 0x2b70df9e9d01 in soffice_main desktop/source/app/sofficemain.cxx:135:12
>     #45 0x4f0f0c in sal_main desktop/source/app/main.c:48:15
>     #46 0x4f0ee6 in main desktop/source/app/main.c:47:1
>     #47 0x2b70e137057f in __libc_start_main (/lib64/libc.so.6+0x2057f)
>     #48 0x418f48 in _start (instdir/program/soffice.bin+0x418f48)

Change-Id: I2bc4abe48c129e006582b9870229f44d2d2bb1ed
ghost pushed a commit that referenced this pull request Apr 6, 2016
...as happened at least once in JunitTest_framework_copmlex with

> Thread 27 (Thread 0x2ac7e60d1700 (LWP 30831)):
> #0  0x00002ac7b781c89d in __lll_lock_wait () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
> #1  0x00002ac7b7816a36 in __GI___pthread_mutex_lock (mutex=0x1ce1720) at ../nptl/pthread_mutex_lock.c:116
> #2  0x00002ac7b6e6b257 in osl_acquireMutex(oslMutexImpl*) (pMutex=0x1ce1720) at sal/osl/unx/mutex.cxx:99
> #3  0x00002ac7bf928098 in osl::Mutex::acquire() (this=0x1ce16f8) at include/osl/mutex.hxx:56
> #4  0x00002ac7c022d123 in SalYieldMutex::acquire() (this=0x1ce16f0) at vcl/unx/generic/app/geninst.cxx:54
> #5  0x00002ac7e48442ab in SolarMutexGuard::SolarMutexGuard() (this=0x2ac7e60cedb0) at include/vcl/svapp.hxx:1476
> #6  0x00002ac7e4aa7747 in framework::AddonsToolBarWrapper::dispose() (this=0x2ac7e7fbcd50) at framework/source/uielement/addonstoolbarwrapper.cxx:73
> #7  0x00002ac7e4947503 in framework::ToolbarLayoutManager::destroyToolbars() (this=0x2ac7dbf88018) at framework/source/layoutmanager/toolbarlayoutmanager.cxx:654
> #8  0x00002ac7e494364c in framework::ToolbarLayoutManager::reset() (this=0x2ac7dbf88018) at framework/source/layoutmanager/toolbarlayoutmanager.cxx:363
> #9  0x00002ac7e492a1d6 in framework::LayoutManager::implts_reset(bool) (this=0x2ac7dbfbcc40, bAttached=false) at framework/source/layoutmanager/layoutmanager.cxx:414
> #10 0x00002ac7e493a404 in framework::LayoutManager::frameAction(com::sun::star::frame::FrameActionEvent const&) (this=0x2ac7dbfbcc40, aEvent=...) at framework/source/layoutmanager/layoutmanager.cxx:2807
> #11 0x00002ac7e49e57dc in (anonymous namespace)::Frame::implts_sendFrameActionEvent(com::sun::star::frame::FrameAction const&) (this=0x2ac7e7fb2050, aAction=@0x2ac7e60cf73c: com::sun::star::frame::FrameAction_COMPONENT_DETACHING) at framework/source/services/frame.cxx:2845
> #12 0x00002ac7e49ded07 in (anonymous namespace)::Frame::setComponent(com::sun::star::uno::Reference<com::sun::star::awt::XWindow> const&, com::sun::star::uno::Reference<com::sun::star::frame::XController> const&) (this=0x2ac7e7fb2050, xComponentWindow=empty uno::Reference, xController=empty uno::Reference) at framework/source/services/frame.cxx:1509
> #13 0x00002ac7e49e293b in (anonymous namespace)::Frame::close(unsigned char) (this=0x2ac7e7fb2050, bDeliverOwnership=0 '\000') at framework/source/services/frame.cxx:1770
> #14 0x00002ac7e49ce635 in framework::Desktop::impl_closeFrames(bool) (this=0x2ac7daf2f430, bAllowUI=true) at framework/source/services/desktop.cxx:1674
> #15 0x00002ac7e49cd6ee in framework::Desktop::terminate() (this=0x2ac7daf2f430) at framework/source/services/desktop.cxx:238
> #16 0x00002ac7da45deb4 in gcc3::callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, double*) (pThis=0x2ac7daf2f4a0, nVtableIndex=3, pRegisterReturn=0x2ac7f41b36d0, pReturnTypeRef=0x1ce84c0, bSimpleReturn=true, pStack=0x2ac7e60cfd00, nStack=0, pGPR=0x2ac7e60cffc0, pFPR=0x2ac7e60cff80) at bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:77
> #17 0x00002ac7da45cccf in cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void*, void**, _uno_Any**) (pThis=0x2ac7f40f0ea0, aVtableSlot=..., pReturnTypeRef=0x1ce84c0, nParams=0, pParams=0x0, pUnoReturn=0x2ac7f41b36d0, pUnoArgs=0x0, ppUnoExc=0x2ac7e60d0560) at bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:241
> #18 0x00002ac7da45c459 in bridges::cpp_uno::shared::unoInterfaceProxyDispatch(_uno_Interface*, _typelib_TypeDescription const*, void*, void**, _uno_Any**) (pUnoI=0x2ac7f40f0ea0, pMemberDescr=0x2ac7f00027c0, pReturn=0x2ac7f41b36d0, pArgs=0x0, ppException=0x2ac7e60d0560) at bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:430
> #19 0x00002ac7e40401ea in binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::__debug::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const (this=0x2ac7f0002870, returnValue=0x2ac7e60d09d0, outArguments=0x2ac7e60d0998) at binaryurp/source/incomingrequest.cxx:239
> #20 0x00002ac7e403e88b in binaryurp::IncomingRequest::execute() const (this=0x2ac7f0002870) at binaryurp/source/incomingrequest.cxx:73
> #21 0x00002ac7e406927d in request(void*) (pThreadSpecificData=0x2ac7f0002870) at binaryurp/source/reader.cxx:83
> #22 0x00002ac7b998953b in cppu_threadpool::JobQueue::enter(long, bool) (this=0x2ac7f0002d30, nDisposeId=47038213394384, bReturnWhenNoJob=true) at cppu/source/threadpool/jobqueue.cxx:107
> #23 0x00002ac7b998dc25 in cppu_threadpool::ORequestThread::run() (this=0x2ac7f0000fd0) at cppu/source/threadpool/thread.cxx:165
> #24 0x00002ac7b998fb0e in threadFunc(void*) (param=0x2ac7f0000fe0) at include/osl/thread.hxx:185
> #25 0x00002ac7b6e8190b in osl_thread_start_Impl(void*) (pData=0x2ac7f0001020) at sal/osl/unx/thread.cxx:240
> #26 0x00002ac7b781460a in start_thread (arg=0x2ac7e60d1700) at pthread_create.c:334
> #27 0x00002ac7b754ea4d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

> Thread 1 (Thread 0x2ac7b6cf7340 (LWP 30697)):
> #0  0x00002ac7b7819b10 in pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
> #1  0x00002ac7b6e5b316 in osl_waitCondition(oslCondition, TimeValue const*) (Condition=0x2ac7f41e10b0, pTimeout=0x0) at sal/osl/unx/conditn.cxx:228
> #2  0x00002ac7cca51370 in osl::Condition::wait(TimeValue const*) (this=0x2ac7e7fb20d8, pTimeout=0x0) at include/osl/conditn.hxx:84
> #3  0x00002ac7cca50f90 in framework::Gate::wait() (this=0x2ac7e7fb20d0) at framework/inc/threadhelp/gate.hxx:123
> #4  0x00002ac7cca50708 in framework::TransactionManager::setWorkingMode(framework::EWorkingMode) (this=0x2ac7e7fb20c8, eMode=framework::E_BEFORECLOSE) at framework/source/fwi/threadhelp/transactionmanager.cxx:98
> #5  0x00002ac7e49dfc3c in (anonymous namespace)::Frame::dispose() (this=0x2ac7e7fb2050) at framework/source/services/frame.cxx:2008
> #6  0x00002ac7e49e2cd3 in (anonymous namespace)::Frame::close(unsigned char) (this=0x2ac7e7fb2050, bDeliverOwnership=1 '\001') at framework/source/services/frame.cxx:1801
> #7  0x00002ac7bbbe25fe in SfxViewFrame::Exec_Impl(SfxRequest&) (this=0x2ac7f4691cd0, rReq=...) at sfx2/source/view/viewfrm2.cxx:260
> #8  0x00002ac7bbbcd658 in SfxStubSfxViewFrameExec_Impl(SfxShell*, SfxRequest&) (pShell=0x2ac7f4691cd0, rReq=...) at workdir/SdiTarget/sfx2/sdi/sfxslots.hxx:706
> #9  0x00002ac7bb71f792 in SfxShell::CallExec(void (*)(SfxShell*, SfxRequest&), SfxRequest&) (this=0x2ac7f4691cd0, pFunc=0x2ac7bbbcd630 <SfxStubSfxViewFrameExec_Impl(SfxShell*, SfxRequest&)>, rReq=...) at include/sfx2/shell.hxx:204
> #10 0x00002ac7bb715e41 in SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, SfxRequest&, bool) (this=0x2ac7f40fe8e0, rShell=..., rSlot=..., rReq=..., bRecord=true) at sfx2/source/control/dispatch.cxx:262
> #11 0x00002ac7bb71b6fd in SfxDispatcher::PostMsgHandler(SfxRequest*) (this=0x2ac7f40fe8e0, pReq=0x2ac88c000cf0) at sfx2/source/control/dispatch.cxx:1085
> #12 0x00002ac7bb716698 in SfxDispatcher::LinkStubPostMsgHandler(void*, SfxRequest*) (instance=0x2ac7f40fe8e0, data=0x2ac88c000cf0) at sfx2/source/control/dispatch.cxx:1065
> #13 0x00002ac7bbabb3f8 in Link<SfxRequest*, void>::Call(SfxRequest*) const (this=0x2ac7f48361f0, data=0x2ac88c000cf0) at include/tools/link.hxx:84
> #14 0x00002ac7bbabb37b in SfxHintPoster::DoEvent_Impl(void*) (this=0x2ac7f48361e0, pPostedHint=0x2ac88c000cf0) at sfx2/source/notify/hintpost.cxx:44
> #15 0x00002ac7bbabb348 in SfxHintPoster::LinkStubDoEvent_Impl(void*, void*) (instance=0x2ac7f48361e0, data=0x2ac88c000cf0) at sfx2/source/notify/hintpost.cxx:42
> #16 0x00002ac7bfaba968 in Link<void*, void>::Call(void*) const (this=0x2ac88c00b008, data=0x2ac88c000cf0) at include/tools/link.hxx:84
> #17 0x00002ac7bfab7adc in ImplHandleUserEvent(ImplSVEvent*) (pSVEvent=0x2ac88c00b000) at vcl/source/window/winproc.cxx:1956
> #18 0x00002ac7bfab4db7 in ImplWindowFrameProc(vcl::Window*, unsigned short, void const*) (_pWindow=0x2a43020, nEvent=22, pEvent=0x2ac88c00b000) at vcl/source/window/winproc.cxx:2524
> #19 0x00002ac7c01278c9 in SalFrame::CallCallback(unsigned short, void const*) const (this=0x2a43890, nEvent=22, pEvent=0x2ac88c00b000) at vcl/inc/salframe.hxx:273
> #20 0x00002ac7c0133999 in SvpSalInstance::DoYield(bool, bool, unsigned long) (this=0x1ce1640, bWait=false, bHandleAllCurrentEvents=false, nReleased=0) at vcl/headless/svpinst.cxx:293
> #21 0x00002ac7bffa63b5 in ImplYield(bool, bool, unsigned long) (i_bWait=false, i_bAllEvents=false, nReleased=0) at vcl/source/app/svapp.cxx:509
> #22 0x00002ac7bffa1148 in Application::Yield() () at vcl/source/app/svapp.cxx:553
> #23 0x00002ac7bffa10d3 in Application::Execute() () at vcl/source/app/svapp.cxx:473
> #24 0x00002ac7b70ee229 in desktop::Desktop::DoExecute() () at desktop/source/app/app.cxx:1322
> #25 0x00002ac7b70f0304 in desktop::Desktop::Main() (this=0x7ffefac27e38) at desktop/source/app/app.cxx:1647
> #26 0x00002ac7bffb3639 in ImplSVMain() () at vcl/source/app/svmain.cxx:172
> #27 0x00002ac7bffb4e18 in SVMain() () at vcl/source/app/svmain.cxx:210
> #28 0x00002ac7b714f3b5 in soffice_main() () at desktop/source/app/sofficemain.cxx:135
> #29 0x000000000040097d in sal_main () at desktop/source/app/main.c:48
> #30 0x0000000000400957 in main (argc=8, argv=0x7ffefac27fe8) at desktop/source/app/main.c:47

Change-Id: Id06a8fcfe449f566785c51174b1ad3e81459032f
ghost pushed a commit that referenced this pull request Jul 11, 2016
Change-Id: I465d126652f4dd21c19ee6730466719445d835b3
Reviewed-on: https://gerrit.libreoffice.org/27074
Tested-by: Jenkins <[email protected]>
Reviewed-by: Noel Grandin <[email protected]>
ghost pushed a commit that referenced this pull request Aug 12, 2016
I'm currently unable to invalidate / update the correct cache to
make the changed SwPageDesc visible to SwRootFrm::AssertFlyPages.

Instead this continues to use the SwWrtShell::InsertPageBreak,
which moves the cursor to the new page, which somehow triggers the
SwCrsrShell to update the (probably?) cached layout information.

The working backtrace looks like this. while the "broken" one
stops at #16, because the cursor has a valid paragraph.

 #0  SwFrm::WrongPageDesc(SwPageFrm*)
 #1  SwFrm::GetNextLeaf(MakePageType)
 #2  SwFrm::GetLeaf(MakePageType, bool)
 #3  SwFlowFrm::MoveFwd(bool, bool, bool)
 #4  SwContentFrm::MakeAll(OutputDevice*)
 #5  SwFrm::PrepareMake(OutputDevice*)
 #6  SwFrm::Calc(OutputDevice*) const
 #7  SwTextFrm::CalcFollow(int)
 #8  SwTextFrm::_AdjustFollow(SwTextFormatter&, int, int, unsigned char)
 #9  SwTextFrm::FormatAdjust(SwTextFormatter&, WidowsAndOrphans&, int, bool)
 #10 SwTextFrm::_Format(SwTextFormatter&, SwTextFormatInfo&, bool)
 #11 SwTextFrm::_Format(OutputDevice*, SwParaPortion*)
 #12 SwTextFrm::Format(OutputDevice*, SwBorderAttrs const*)
 #13 SwContentFrm::MakeAll(OutputDevice*)
 #14 SwFrm::PrepareMake(OutputDevice*)
 #15 SwFrm::Calc(OutputDevice*) const
 #16 SwTextFrm::GetFormatted(bool)
 #17 SwTextFrm::GetCharRect(SwRect&, SwPosition const&, SwCrsrMoveState*) const
 #18 SwCrsrShell::UpdateCrsr(unsigned short, bool)
 #19 SwCrsrShell::EndAction(bool, bool)
 #20 SwEditShell::EndAllAction()
 #21 SwDoc::AppendDoc(SwDoc const&, unsigned short, SwPageDesc*, bool, int)
 #22 SwDBManager::MergeMailFiles(SwWrtShell*, SwMergeDescriptor const&, vcl::Window*)
 #23 SwDBManager::MergeNew(SwMergeDescriptor const&, vcl::Window*)

Have a look at the SwPageDesc with by toggling the #if 0 block
with log:

SAL_LOG="-INFO-WARN+INFO.sw.docappend+INFO.sw.createcopy+INFO.sw.pagefrm"

Change-Id: I02f955a6be00a3b57d50d18d4da3651cb9473614
ghost pushed a commit that referenced this pull request Sep 14, 2016
These additional views are only created to follow the updates done in
the editing view, not to contribute additional cursors.

With this, if the first view edits a shape text and the second view is
created, then no unwanted text view cursor is created in the first view
for the shape text from the second view.

Be precise in the unit test and make sure that cursors from all views
are hidden, because even without a fix the cursor of view #2 is hidden,
but not from view #3, so the test wouldn't fail without the fix. (But
hardcoding the 0-1 and 2-3 view IDs exposed by Impress before/after
initializeForRendering() would be ugly.)

Change-Id: Idf64f7bfcc35c98a5eada9a0a523a9b45b65a211
ghost pushed a commit that referenced this pull request Sep 14, 2016
These additional views are only created to follow the updates done in
the editing view, not to contribute additional cursors.

With this, if the first view edits a shape text and the second view is
created, then no unwanted text view cursor is created in the first view
for the shape text from the second view.

Be precise in the unit test and make sure that cursors from all views
are hidden, because even without a fix the cursor of view #2 is hidden,
but not from view #3, so the test wouldn't fail without the fix. (But
hardcoding the 0-1 and 2-3 view IDs exposed by Impress before/after
initializeForRendering() would be ugly.)

Change-Id: Idf64f7bfcc35c98a5eada9a0a523a9b45b65a211
(cherry picked from commit eefccb4)
ghost pushed a commit that referenced this pull request Sep 20, 2016
...after 1658bd2 "loplugin:unusedenumvalues"
broke it again after 992fba9 "ubsan: 9 is not a
valid value for type ´SvxNumType´" had fixed it the last time.

This time, acknowledge that SvxNumType can apparently take on rather arbitrary
sal_Int16 values from the css::style::NumberingTypes constants, and make it an
alias for sal_Int16 (whether or not keeping such a trivial alias is good or bad
overall).

Or is the bug elsewhere, and values of type SvxNumType should really only take
on the restricted set of values originally encoded by the enum?  At least the
below UBSan backtrace (from CppunitTest_sw_rtfexport) suggests otherwise, but
then again there's also an SvxExtNumType enum (include/editeng/svxenum.hxx),
encompassing more parts of css::style::NumberingTypes.  Oh, my.

> svx/source/items/pageitem.cxx:49:25: runtime error: load of value 9, which is not a valid value for type 'SvxNumType'
>  #0 0x2aafdaebe669 in SvxPageItem::SvxPageItem(SvxPageItem const&) svx/source/items/pageitem.cxx:49:25
>  #1 0x2aafdaebf194 in SvxPageItem::Clone(SfxItemPool*) const svx/source/items/pageitem.cxx:59:16
>  #2 0x2aaf7fab9b7c in SfxItemPool::Put(SfxPoolItem const&, unsigned short) svl/source/items/itempool.cxx:632:40
>  #3 0x2aaf7fc4794a in SfxItemSet::Put(SfxPoolItem const&, unsigned short) svl/source/items/itemset.cxx:467:56
>  #4 0x2aaf7fb96635 in SfxItemSet::Put(SfxPoolItem const&) include/svl/itemset.hxx:131:42
>  #5 0x2aaf7fb89539 in SfxItemPropertySet::setPropertyValue(SfxItemPropertySimpleEntry const&, com::sun::star::uno::Any const&, SfxItemSet&) const svl/source/items/itemprop.cxx:256:14
>  #6 0x2aaf9ef1a5d4 in void SwXStyle::SetPropertyValue<(unsigned short)1>(SfxItemPropertySimpleEntry const&, SfxItemPropertySet const&, com::sun::star::uno::Any const&, SwStyleBase_Impl&) sw/source/core/unocore/unostyle.cxx:1596:14
>  #7 0x2aaf9ef3c72f in SwXStyle::SetStyleProperty(SfxItemPropertySimpleEntry const&, SfxItemPropertySet const&, com::sun::star::uno::Any const&, SwStyleBase_Impl&) sw/source/core/unocore/unostyle.cxx:2013:9
>  #8 0x2aaf9ef8103d in SwXPageStyle::SetPropertyValues_Impl(com::sun::star::uno::Sequence<rtl::OUString> const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) sw/source/core/unocore/unostyle.cxx:3025:17
>  #9 0x2aaf9ef821ee in SwXPageStyle::setPropertyValues(com::sun::star::uno::Sequence<rtl::OUString> const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) sw/source/core/unocore/unostyle.cxx:3053:9
>  #10 0x2ab00730d08b in writerfilter::dmapper::SectionPropertyMap::ApplyProperties_(com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> const&) writerfilter/source/dmapper/PropertyMap.cxx:1489:24
>  #11 0x2ab00731cede in writerfilter::dmapper::SectionPropertyMap::CloseSectionGroup(writerfilter::dmapper::DomainMapper_Impl&) writerfilter/source/dmapper/PropertyMap.cxx:1331:13
>  #12 0x2ab006b9ede2 in writerfilter::dmapper::DomainMapper::lcl_endSectionGroup() writerfilter/source/dmapper/DomainMapper.cxx:2823:30
>  #13 0x2ab0071db9f9 in writerfilter::LoggedStream::endSectionGroup() writerfilter/source/dmapper/LoggedResources.cxx:101:5
>  #14 0x2ab006712a3b in writerfilter::rtftok::RTFDocumentImpl::sectBreak(bool) writerfilter/source/rtftok/rtfdocumentimpl.cxx:633:18
>  #15 0x2ab0067a8c13 in writerfilter::rtftok::RTFDocumentImpl::popState() writerfilter/source/rtftok/rtfdocumentimpl.cxx:2789:13
>  #16 0x2ab006a26134 in writerfilter::rtftok::RTFTokenizer::resolveParse() writerfilter/source/rtftok/rtftokenizer.cxx:105:33
>  #17 0x2ab0067194f9 in writerfilter::rtftok::RTFDocumentImpl::resolve(writerfilter::Stream&) writerfilter/source/rtftok/rtfdocumentimpl.cxx:740:27
>  #18 0x2ab0075ebae7 in RtfFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) writerfilter/source/filter/RtfFilter.cxx:147:20
>  #19 0x2aafcf2873a5 in SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) sfx2/source/doc/objstor.cxx:2261:30
>  #20 0x2aafcf22d4d2 in SfxObjectShell::DoLoad(SfxMedium*) sfx2/source/doc/objstor.cxx:764:23
>  #21 0x2aafcf4a4d09 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) sfx2/source/doc/sfxbasemodel.cxx:1841:36
>  #22 0x2aafcfde31b3 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:698:28
>  #23 0x2aaffef07028 in framework::LoadEnv::impl_loadContent() framework/source/loadenv/loadenv.cxx:1110:37
>  #24 0x2aaffeeead5a in framework::LoadEnv::startLoading() framework/source/loadenv/loadenv.cxx:379:20
>  #25 0x2aaffeee3919 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:165:14
>  #26 0x2aafff10ddac 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:596:12
>  #27 0x2aafff10e11a 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:582:64
>  #28 0x2aafab4c3938 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:50:60
>  #29 0x2aaf90aee900 in SwModelTestBase::loadURL(rtl::OUString const&, char const*) sw/qa/extras/inc/swmodeltestbase.hxx:621:23
>  #30 0x2aaf90aed267 in SwModelTestBase::load(char const*, char const*) sw/qa/extras/inc/swmodeltestbase.hxx:610:16
>  #31 0x2aaf90aec404 in SwModelTestBase::executeImportTest(char const*) sw/qa/extras/inc/swmodeltestbase.hxx:222:13
>  #32 0x2aaf90cf4d31 in testTdf65642::Import() sw/qa/extras/rtfexport/rtfexport.cxx:1013:1
>  #33 0x2aaf90cf62af in CppUnit::TestCaller<testTdf65642>::runTest() workdir/UnpackedTarball/cppunit/include/cppunit/TestCaller.h:166:6
>  #34 0x2aaf4ee5d7dd in CppUnit::TestCaseMethodFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:32:5
>  #35 0x2aaf680c4cd6 in (anonymous namespace)::Protector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) test/source/vclbootstrapprotector.cxx:36:14
>  #36 0x2aaf4ee17a87 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25
>  #37 0x2aaf5ea4a8a6 in (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) unotest/source/cpp/unobootstrapprotector/unobootstrapprotector.cxx:89:12
>  #38 0x2aaf4ee17a87 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25
>  #39 0x2aaf5abd5ef4 in (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx:65:16
>  #40 0x2aaf4ee17a87 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25
>  #41 0x2aaf4ed8c2ef in CppUnit::DefaultProtector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) workdir/UnpackedTarball/cppunit/src/cppunit/DefaultProtector.cpp:15:12
>  #42 0x2aaf4ee17a87 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25
>  #43 0x2aaf4ee14101 in CppUnit::ProtectorChain::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:77:18
>  #44 0x2aaf4eede065 in CppUnit::TestResult::protect(CppUnit::Functor const&, CppUnit::Test*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) workdir/UnpackedTarball/cppunit/src/cppunit/TestResult.cpp:181:28
>  #45 0x2aaf4ee5a929 in CppUnit::TestCase::run(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:91:13
>  #46 0x2aaf4ee60ad3 in CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:64:30
>  #47 0x2aaf4ee5fa3d in CppUnit::TestComposite::run(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:23:3
>  #48 0x2aaf4ee60ad3 in CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:64:30
>  #49 0x2aaf4ee5fa3d in CppUnit::TestComposite::run(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:23:3
>  #50 0x2aaf4ef1eeb6 in CppUnit::TestRunner::WrappingSuite::run(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestRunner.cpp:47:27
>  #51 0x2aaf4eedbe79 in CppUnit::TestResult::runTest(CppUnit::Test*) workdir/UnpackedTarball/cppunit/src/cppunit/TestResult.cpp:148:9
>  #52 0x2aaf4ef20440 in CppUnit::TestRunner::run(CppUnit::TestResult&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) workdir/UnpackedTarball/cppunit/src/cppunit/TestRunner.cpp:96:14
>  #53 0x52b642 in (anonymous namespace)::ProtectedFixtureFunctor::run() const sal/cppunittester/cppunittester.cxx:305:20
>  #54 0x52604d in sal_main() sal/cppunittester/cppunittester.cxx:455:20
>  #55 0x524192 in main sal/cppunittester/cppunittester.cxx:362:1
>  #56 0x2aaf50b3c730 in __libc_start_main (/lib64/libc.so.6+0x20730)
>  #57 0x437658 in _start (workdir/LinkTarget/Executable/cppunittester+0x437658)

Change-Id: Id170860cbff9f4cae5c87cb5cfc70ffe3bc8c9c5
ghost pushed a commit that referenced this pull request Oct 14, 2016
...of this-ptr of in-construction FormFieldSignature while still in the base
FormField ctor, as happens (in the xpdfimport process) during
CppunitTest_xmlsecurity_signing:

> Form.cc:448:12: runtime error: downcast of address 0x60f000000040 which does not point to an object of type 'FormFieldSignature'
> 0x60f000000040: note: object is of type 'FormField'
>  03 00 00 6d  50 84 f2 00 00 00 00 00  03 00 00 00 04 00 00 00  00 00 00 00 01 be be be  07 00 00 00
>               ^~~~~~~~~~~~~~~~~~~~~~~
>               vptr for 'FormField'
>     #0 0x73d7f4 in FormWidgetSignature::FormWidgetSignature(PDFDoc*, Object*, unsigned int, Ref, FormField*) workdir/UnpackedTarball/poppler/poppler/Form.cc:448:12
>     #1 0x741713 in FormField::_createWidget(Object*, Ref) workdir/UnpackedTarball/poppler/poppler/Form.cc:677:34
>     #2 0x73e747 in FormField::FormField(PDFDoc*, Object*, Ref const&, FormField*, std::set<int, std::less<int>, std::allocator<int> >*, FormFieldType) workdir/UnpackedTarball/poppler/poppler/Form.cc:547:7
>     #3 0x74ec2b in FormFieldSignature::FormFieldSignature(PDFDoc*, Object*, Ref const&, FormField*, std::set<int, std::less<int>, std::allocator<int> >*) workdir/UnpackedTarball/poppler/poppler/Form.cc:1383:5
>     #4 0x740d7f in Form::createFieldFromDict(Object*, PDFDoc*, Ref const&, FormField*, std::set<int, std::less<int>, std::allocator<int> >*) workdir/UnpackedTarball/poppler/poppler/Form.cc:1700:19
>     #5 0x750727 in Form::Form(PDFDoc*, Object*) workdir/UnpackedTarball/poppler/poppler/Form.cc:1623:33
>     #6 0x71d440 in Catalog::getForm() workdir/UnpackedTarball/poppler/poppler/Catalog.cc:1042:18
>     #7 0x708572 in Annots::createAnnot(Dict*, Object*) workdir/UnpackedTarball/poppler/poppler/Annot.cc:7218:41
>     #8 0x70772b in Annots::Annots(PDFDoc*, int, Object*) workdir/UnpackedTarball/poppler/poppler/Annot.cc:7128:17
>     #9 0x87f3e9 in Page::getAnnots(XRef*) workdir/UnpackedTarball/poppler/poppler/Page.cc:405:18
>     #10 0x8814b0 in Page::displaySlice(OutputDev*, double, double, int, bool, bool, int, int, int, int, bool, bool (*)(void*), void*, bool (*)(Annot*, void*), void*, bool) workdir/UnpackedTarball/poppler/poppler/Page.cc:611:15
>     #11 0x880ff6 in Page::display(OutputDev*, double, double, int, bool, bool, bool, bool (*)(void*), void*, bool (*)(Annot*, void*), void*, bool) workdir/UnpackedTarball/poppler/poppler/Page.cc:521:3
>     #12 0x88d906 in PDFDoc::displayPage(OutputDev*, int, double, double, int, bool, bool, bool, bool (*)(void*), void*, bool (*)(Annot*, void*), void*, bool) workdir/UnpackedTarball/poppler/poppler/PDFDoc.cc:491:20
>     #13 0x5d59fb in main sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx:142:14
>     #14 0x7f11600ea730 in __libc_start_main (/lib64/libc.so.6+0x20730)
>     #15 0x459388 in _start (instdir/program/xpdfimport+0x459388)

Change-Id: Ia808919c8d2363d616feb4664f314a77b40dfbb8
ghost pushed a commit that referenced this pull request Nov 7, 2016
...to avoid use-after-free, as e.g. happens on macOS with -fsanitize=address in
CppunitTest_sw_mailmerge:

> ==29010==ERROR: AddressSanitizer: heap-use-after-free on address 0x60800088faf8 at pc 0x000118ebc153 bp 0x7fff52f81a40 sp 0x7fff52f81a38
> READ of size 8 at 0x60800088faf8 thread T0
> WARNING: failed decoding unknown ioctl 0x20007454
> WARNING: failed decoding unknown ioctl 0x20007452
>     #0 0x118ebc152 in AquaSalMenu::SetSubMenu(SalMenuItem*, SalMenu*, unsigned int) salmenu.cxx:597
>     #1 0x1177bbefc in Menu::SetPopupMenu(unsigned short, PopupMenu*) menu.cxx:803
>     #2 0x138dccb5a in framework::MenuBarManager::RemoveListener() menubarmanager.cxx:552
>     #3 0x138dcb452 in framework::MenuBarManager::Destroy() menubarmanager.cxx:237
>     #4 0x138dcd6d7 in framework::MenuBarManager::dispose() menubarmanager.cxx:267
>     #5 0x138dccfa2 in framework::MenuBarManager::RemoveListener() menubarmanager.cxx:587
>     #6 0x138dcb452 in framework::MenuBarManager::Destroy() menubarmanager.cxx:237
>     #7 0x138dcd6d7 in framework::MenuBarManager::dispose() menubarmanager.cxx:267
>     #8 0x138e06acf in framework::MenuBarWrapper::dispose() menubarwrapper.cxx:103
>     #9 0x1389c0f67 in framework::LayoutManager::impl_clearUpMenuBar() layoutmanager.cxx:226
>     #10 0x1389c497b in framework::LayoutManager::implts_destroyElements() layoutmanager.cxx:447
>     #11 0x1389c3777 in framework::LayoutManager::implts_reset(bool) layoutmanager.cxx:413
>     #12 0x1389edf4b in framework::LayoutManager::frameAction(com::sun::star::frame::FrameActionEvent const&) layoutmanager.cxx:2811
>     #13 0x138b9e1a8 in (anonymous namespace)::Frame::implts_sendFrameActionEvent(com::sun::star::frame::FrameAction const&) frame.cxx:3110
>     #14 0x138b8219b in (anonymous namespace)::Frame::setComponent(com::sun::star::uno::Reference<com::sun::star::awt::XWindow> const&, com::sun::star::uno::Reference<com::sun::star::frame::XController> const&) frame.cxx:1557
>     #15 0x138b88545 in (anonymous namespace)::Frame::close(unsigned char) frame.cxx:1801
>     #16 0x12078429a in SfxFrame::DoClose() frame.cxx:127
>     #17 0x120812990 in SfxViewFrame::Notify(SfxBroadcaster&, SfxHint const&) viewfrm.cxx:1234
>     #18 0x11ab542d5 in SfxBroadcaster::Broadcast(SfxHint const&) SfxBroadcaster.cxx:50
>     #19 0x1203a0682 in SfxModelListener_Impl::notifyClosing(com::sun::star::lang::EventObject const&) objxtor.cxx:171
>     #20 0x1204453d2 in SfxBaseModel::close(unsigned char) sfxbasemodel.cxx:1372
>     #21 0x1245130d5 in SwXTextDocument::close(unsigned char) unotxdoc.cxx:621
>     #22 0x1247af99b in CloseModelAndDocSh(com::sun::star::uno::Reference<com::sun::star::frame::XModel>&, tools::SvRef<SfxObjectShell>&) unomailmerge.cxx:115
>     #23 0x1247af4bf in DeleteTmpFile_Impl(com::sun::star::uno::Reference<com::sun::star::frame::XModel>&, tools::SvRef<SfxObjectShell>&, rtl::OUString const&) unomailmerge.cxx:342
>     #24 0x1247b6ad6 in SwXMailMerge::execute(com::sun::star::uno::Sequence<com::sun::star::beans::NamedValue> const&) unomailmerge.cxx:814
>     #25 0x1247b9c62 in non-virtual thunk to SwXMailMerge::execute(com::sun::star::uno::Sequence<com::sun::star::beans::NamedValue> const&) unomailmerge.cxx:434
>     #26 0x11eeab4fd in MMTest::executeMailMerge() mailmerge.cxx:179
>     #27 0x11eea2470 in testMultiPageAnchoredDraws::verify() mailmerge.cxx:336
>     #28 0x11ef3be50 in MMTest::executeMailMergeTest(char const*, char const*, char const*, bool, int, char const*) mailmerge.cxx:87
>     #29 0x11ef38af3 in testMultiPageAnchoredDraws::MailMerge() mailmerge.cxx:334
>     #30 0x11ef557b9 in CppUnit::TestCaller<testMultiPageAnchoredDraws>::runTest() TestCaller.h:166
>     #31 0x10cfff749 in CppUnit::TestCaseMethodFunctor::operator()() const TestCase.cpp:32
>     #32 0x110736b67 in (anonymous namespace)::Protector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) vclbootstrapprotector.cxx:36
>     #33 0x10cfc9c20 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const ProtectorChain.cpp:20
>     #34 0x110498fa7 in (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) unobootstrapprotector.cxx:89
>     #35 0x10cfc9c20 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const ProtectorChain.cpp:20
>     #36 0x10f776880 in (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) unoexceptionprotector.cxx:65
>     #37 0x10cfc9c20 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const ProtectorChain.cpp:20
>     #38 0x10cf64042 in CppUnit::DefaultProtector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) DefaultProtector.cpp:15
>     #39 0x10cfc9c20 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const ProtectorChain.cpp:20
>     #40 0x10cfc7200 in CppUnit::ProtectorChain::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) ProtectorChain.cpp:77
>     #41 0x10d06f15a in CppUnit::TestResult::protect(CppUnit::Functor const&, CppUnit::Test*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) TestResult.cpp:181
>     #42 0x10cffd8cd in CppUnit::TestCase::run(CppUnit::TestResult*) TestCase.cpp:91
>     #43 0x10d00097a in CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) TestComposite.cpp:64
>     #44 0x10d00045e in CppUnit::TestComposite::run(CppUnit::TestResult*) TestComposite.cpp:23
>     #45 0x10d00097a in CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) TestComposite.cpp:64
>     #46 0x10d00045e in CppUnit::TestComposite::run(CppUnit::TestResult*) TestComposite.cpp:23
>     #47 0x10d0990ac in CppUnit::TestRunner::WrappingSuite::run(CppUnit::TestResult*) TestRunner.cpp:47
>     #48 0x10d06da55 in CppUnit::TestResult::runTest(CppUnit::Test*) TestResult.cpp:148
>     #49 0x10d099ebd in CppUnit::TestRunner::run(CppUnit::TestResult&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) TestRunner.cpp:96
>     #50 0x10cc6f509 in (anonymous namespace)::ProtectedFixtureFunctor::run() const cppunittester.cxx:305
>     #51 0x10cc6a0ac in sal_main() cppunittester.cxx:455
>     #52 0x10cc687a6 in main cppunittester.cxx:362
>     #53 0x7fffc9f36254 in start (libdyld.dylib+0x5254)
>
> 0x60800088faf8 is located 88 bytes inside of 96-byte region [0x60800088faa0,0x60800088fb00)
> freed by thread T0 here:
>     #0 0x10d327b6b in wrap__ZdlPv asan_new_delete.cc:179
>     #1 0x118eb3011 in AquaSalMenu::~AquaSalMenu() salmenu.cxx:279
>     #2 0x118eb10de in AquaSalInstance::DestroyMenu(SalMenu*) salmenu.cxx:238
>     #3 0x1177acd1d in Menu::ImplSetSalMenu(SalMenu*) menu.cxx:2342
>     #4 0x1177ab046 in Menu::dispose() menu.cxx:183
>     #5 0x1177d86f5 in PopupMenu::dispose() menu.cxx:2764
>     #6 0x117f99ee2 in VclReferenceBase::disposeOnce() vclreferencebase.cxx:42
>     #7 0x1177bf7d8 in VclPtr<Menu>::disposeAndClear() vclptr.hxx:208
>     #8 0x1177bbbd5 in Menu::SetPopupMenu(unsigned short, PopupMenu*) menu.cxx:788
>     #9 0x138dccb5a in framework::MenuBarManager::RemoveListener() menubarmanager.cxx:552
>     #10 0x138dcb452 in framework::MenuBarManager::Destroy() menubarmanager.cxx:237
>     #11 0x138dcd6d7 in framework::MenuBarManager::dispose() menubarmanager.cxx:267
>     #12 0x138dccfa2 in framework::MenuBarManager::RemoveListener() menubarmanager.cxx:587
>     #13 0x138dcb452 in framework::MenuBarManager::Destroy() menubarmanager.cxx:237
>     #14 0x138dcd6d7 in framework::MenuBarManager::dispose() menubarmanager.cxx:267
>     #15 0x138e06acf in framework::MenuBarWrapper::dispose() menubarwrapper.cxx:103
>     #16 0x1389c0f67 in framework::LayoutManager::impl_clearUpMenuBar() layoutmanager.cxx:226
>     #17 0x1389c497b in framework::LayoutManager::implts_destroyElements() layoutmanager.cxx:447
>     #18 0x1389c3777 in framework::LayoutManager::implts_reset(bool) layoutmanager.cxx:413
>     #19 0x1389edf4b in framework::LayoutManager::frameAction(com::sun::star::frame::FrameActionEvent const&) layoutmanager.cxx:2811
>     #20 0x138b9e1a8 in (anonymous namespace)::Frame::implts_sendFrameActionEvent(com::sun::star::frame::FrameAction const&) frame.cxx:3110
>     #21 0x138b8219b in (anonymous namespace)::Frame::setComponent(com::sun::star::uno::Reference<com::sun::star::awt::XWindow> const&, com::sun::star::uno::Reference<com::sun::star::frame::XController> const&) frame.cxx:1557
>     #22 0x138b88545 in (anonymous namespace)::Frame::close(unsigned char) frame.cxx:1801
>     #23 0x12078429a in SfxFrame::DoClose() frame.cxx:127
>     #24 0x120812990 in SfxViewFrame::Notify(SfxBroadcaster&, SfxHint const&) viewfrm.cxx:1234
>     #25 0x11ab542d5 in SfxBroadcaster::Broadcast(SfxHint const&) SfxBroadcaster.cxx:50
>     #26 0x1203a0682 in SfxModelListener_Impl::notifyClosing(com::sun::star::lang::EventObject const&) objxtor.cxx:171
>     #27 0x1204453d2 in SfxBaseModel::close(unsigned char) sfxbasemodel.cxx:1372
>     #28 0x1245130d5 in SwXTextDocument::close(unsigned char) unotxdoc.cxx:621
>     #29 0x1247af99b in CloseModelAndDocSh(com::sun::star::uno::Reference<com::sun::star::frame::XModel>&, tools::SvRef<SfxObjectShell>&) unomailmerge.cxx:115
>
> previously allocated by thread T0 here:
>     #0 0x10d32752b in wrap__Znwm asan_new_delete.cc:106
>     #1 0x118eafa18 in AquaSalInstance::CreateMenu(bool, Menu*) salmenu.cxx:230
>     #2 0x1177d75e0 in PopupMenu::PopupMenu() menu.cxx:2711
>     #3 0x1177d7664 in PopupMenu::PopupMenu() menu.cxx:2710
>     #4 0x129136557 in VclPtr<PopupMenu> VclPtr<PopupMenu>::Create<>() vclptr.hxx:131
>     #5 0x1291362de in VCLXMenu::ImplCreateMenu(bool) vclxmenu.cxx:73
>     #6 0x1291463ca in VCLXPopupMenu::VCLXPopupMenu() vclxmenu.cxx:901
>     #7 0x129146414 in VCLXPopupMenu::VCLXPopupMenu() vclxmenu.cxx:900
>     #8 0x138dc5e83 in framework::MenuBarManager::FillMenuManager(Menu*, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> const&, rtl::OUString const&, bool) menubarmanager.cxx:1354
>     #9 0x138dc2316 in framework::MenuBarManager::MenuBarManager(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, com::sun::star::uno::Reference<com::sun::star::util::XURLTransformer> const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> const&, rtl::OUString const&, Menu*, bool, bool) menubarmanager.cxx:140
>     #10 0x138dc72bd in framework::MenuBarManager::MenuBarManager(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, com::sun::star::uno::Reference<com::sun::star::util::XURLTransformer> const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> const&, rtl::OUString const&, Menu*, bool, bool) menubarmanager.cxx:138
>     #11 0x138dc57bc in framework::MenuBarManager::FillMenuManager(Menu*, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> const&, rtl::OUString const&, bool) menubarmanager.cxx:1304
>     #12 0x138dc2316 in framework::MenuBarManager::MenuBarManager(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, com::sun::star::uno::Reference<com::sun::star::util::XURLTransformer> const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> const&, rtl::OUString const&, Menu*, bool, bool) menubarmanager.cxx:140
>     #13 0x138dc72bd in framework::MenuBarManager::MenuBarManager(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, com::sun::star::uno::Reference<com::sun::star::util::XURLTransformer> const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> const&, rtl::OUString const&, Menu*, bool, bool) menubarmanager.cxx:138
>     #14 0x138e07ba5 in framework::MenuBarWrapper::initialize(com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) menubarwrapper.cxx:181
>     #15 0x138f32e6d in framework::MenuBarFactory::CreateUIElement(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, char const*, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::ui::XUIElement> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) menubarfactory.cxx:154
>     #16 0x138f31848 in framework::MenuBarFactory::createUIElement(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) menubarfactory.cxx:63
>     #17 0x138f3313a in non-virtual thunk to framework::MenuBarFactory::createUIElement(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) menubarfactory.cxx:56
>     #18 0x138f56f6e in (anonymous namespace)::UIElementFactoryManager::createUIElement(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) uielementfactorymanager.cxx:450
>     #19 0x138f5a94a in non-virtual thunk to (anonymous namespace)::UIElementFactoryManager::createUIElement(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) uielementfactorymanager.cxx:408
>     #20 0x1389ca5da in framework::LayoutManager::implts_createElement(rtl::OUString const&) layoutmanager.cxx:731
>     #21 0x1389d6fb4 in framework::LayoutManager::createElement(rtl::OUString const&) layoutmanager.cxx:1482
>     #22 0x11fbd36f1 in SfxDispatcher::SetMenu_Impl() dispatch.cxx:1216
>     #23 0x11fbc36dc in SfxDispatcher::Update_Impl(bool) dispatch.cxx:1290
>     #24 0x11fb7556d in SfxBindings::NextJob_Impl(Timer*) bindings.cxx:1459
>     #25 0x11fb8ad4c in SfxBindings::NextJob(Timer*) bindings.cxx:1441
>     #26 0x11fb61177 in SfxBindings::LinkStubNextJob(void*, Timer*) bindings.cxx:1439
>     #27 0x11898aea1 in Link<Timer*, void>::Call(Timer*) const link.hxx:84
>     #28 0x11898add6 in Timer::Invoke() timer.cxx:88
>     #29 0x1188dae6d in ImplSchedulerData::Invoke() scheduler.cxx:47

Change-Id: I16d5b11710ee46dbaa77afd94a09ba5f07a311b0
ghost pushed a commit that referenced this pull request Nov 14, 2016
...when doing "Format - Page..." in Writer:

> cui/source/tabpages/tparea.cxx:268:12: runtime error: load of value 4294967295, which is not a valid value for type 'FillType'
>     #0 0x7f89ff653a41 in SvxAreaTabPage::Reset(SfxItemSet const*) cui/source/tabpages/tparea.cxx:268:12
>     #1 0x7f8d15524560 in SfxTabDialog::ActivatePageHdl(TabControl*) sfx2/source/dialog/tabdlg.cxx:1117:19
>     #2 0x7f8d1551b0e3 in SfxTabDialog::LinkStubActivatePageHdl(void*, TabControl*) sfx2/source/dialog/tabdlg.cxx:1035:1
>     #3 0x7f8cef623f37 in Link<TabControl*, void>::Call(TabControl*) const include/tools/link.hxx:84:45
>     #4 0x7f8cef5dfcaa in TabControl::ActivatePage() vcl/source/control/tabctrl.cxx:1601:19

Change-Id: I19dd3ed9d362132daa3f3be9fb0e9702a62bdeb0
ghost pushed a commit that referenced this pull request Nov 14, 2016
...when doing "Format - Page..." in Writer (and eFillType is TRANSPARENT):

> cui/source/tabpages/tparea.cxx:331:33: runtime error: reference binding to null pointer of type 'SfxTabPage'
>     #0 0x7f9f053e936f in SvxAreaTabPage::SelectFillTypeHdl_Impl(Button*) cui/source/tabpages/tparea.cxx:331:9
>     #1 0x7f9f053e548c in SvxAreaTabPage::ActivatePage(SfxItemSet const&) cui/source/tabpages/tparea.cxx:157:13
>     #2 0x7fa21be01676 in SfxTabDialog::ActivatePageHdl(TabControl*) sfx2/source/dialog/tabdlg.cxx:1126:19
>     #3 0x7fa21bdf70e3 in SfxTabDialog::LinkStubActivatePageHdl(void*, TabControl*) sfx2/source/dialog/tabdlg.cxx:1035:1
>     #4 0x7fa1f5efff37 in Link<TabControl*, void>::Call(TabControl*) const include/tools/link.hxx:84:45
>     #5 0x7fa1f5ebbcaa in TabControl::ActivatePage() vcl/source/control/tabctrl.cxx:1601:19

Change-Id: I279f507038ab4bae1be4f02b6537e6d1aab76348
ghost pushed a commit that referenced this pull request Nov 14, 2016
...when doing "Format - Page..." in Writer:

> vcl/source/control/field.cxx:621:20: runtime error: signed integer overflow: 9223372036854775807 * 100 cannot be represented in type 'long'
>     #0 0x7f57787c4868 in NumericFormatter::Normalize(long) const vcl/source/control/field.cxx:621:20
>     #1 0x7f578a4608dc in SetFieldUnit(MetricField&, FieldUnit, bool) svtools/source/misc/unitconv.cxx:75:32
>     #2 0x7f5488952648 in SvxPageDescPage::SvxPageDescPage(vcl::Window*, SfxItemSet const&) cui/source/tabpages/page.cxx:275:5
>     #3 0x7f54889c3ea4 in VclPtr<SvxPageDescPage> VclPtr<SvxPageDescPage>::Create<vcl::Window*&, SfxItemSet const&>(vcl::Window*&, SfxItemSet const&) include/vcl/vclptr.hxx:138:46
>     #4 0x7f5488925d27 in SvxPageDescPage::Create(vcl::Window*, SfxItemSet const*) cui/source/tabpages/page.cxx:162:12
>     #5 0x7f579ea86df4 in SfxTabDialog::ActivatePageHdl(TabControl*) sfx2/source/dialog/tabdlg.cxx:1085:24
>     #6 0x7f579ea800e3 in SfxTabDialog::LinkStubActivatePageHdl(void*, TabControl*) sfx2/source/dialog/tabdlg.cxx:1035:1
>     #7 0x7f5778b88f37 in Link<TabControl*, void>::Call(TabControl*) const include/tools/link.hxx:84:45
>     #8 0x7f5778b44caa in TabControl::ActivatePage() vcl/source/control/tabctrl.cxx:1601:19

and NumericFormatter::mnMax is still SAL_MAX_INT64 (but will be set to a smaller
value a few lines futher down in the SvxPageDescPage ctor).  So initialize mnMax
to a substantially smaller value (that is still "large", but avoids this kind of
overflow), and hope that no code relies on the exact initial value.

Change-Id: If3b4db1d20bc59418d1769e9690bc7ecdbf29a50
tdf-gerrit pushed a commit that referenced this pull request Dec 4, 2024
possibly after uno.HideSlide

 #0  0x00007e697b8c0b97 in SdPage::GetPageInfo (this=this@entry=0x0, jsonWriter=...)
     at sd/source/core/sdpage.cxx:1751
 #1  0x00007e697bbda0ab in SdXImpressDocument::getPartInfo (this=<optimized out>, nPart=<optimized out>)
     at sd/source/ui/unoidl/unomodel.cxx:3692
 #2  0x00007e698ae7e078 in doc_getPartInfo (pThis=0x121017c0, nPart=9)
     at desktop/source/lib/init.cxx:4176
 #3  0x000000000059bcf4 in LOKitHelper::getPartData (part=9, loKitDocument=0x121017c0) at kit/KitHelper.hpp:47
 #4  LOKitHelper::fetchPartsData (loKitDocument=0x121017c0, resultInfo=std::unordered_map with 6 elements = {...}, partsCount=84, mode=@0x7ffec727bd58: 1)
     at kit/KitHelper.hpp:91
 #5  0x000000000059c6a3 in LOKitHelper::documentStatus (loKitDocument=0x121017c0) at kit/KitHelper.hpp:164
 #6  0x000000000057fb7a in ChildSession::selectClientPart (this=0x556fe60, tokens=...) at kit/ChildSession.cpp:2964
 #7  0x000000000058a88f in ChildSession::_handleInput (this=<optimized out>, buffer=<optimized out>, length=<optimized out>) at kit/ChildSession.cpp:495
 #8  0x000000000061c63f in Session::handleMessage (this=0x556fe60, data=std::vector of length 29, capacity 29 = {...})

Change-Id: Ib4e532b31cdc6a69f9e54317699f426c12de35d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177781
Reviewed-by: Miklos Vajna <[email protected]>
Tested-by: Jenkins CollaboraOffice <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Dec 9, 2024
At least with one ASan/UBSan setup of mine using LODE's Clang 12.0.1,
./autogen.sh would occasionally detect -std=gnu11 as the required CC "option to
enable C11 features" (which would in turn cause building external/firebird to
fail oddly; an issue worth investigations of its own), because Clang would
occasionally crash with a SEGV on the corresponding configure test program's
first invocation (without -std=gnu11) when invoked with -O2 (and happen to
succeed on second invocation with -std=gnu11, so configure thinks that's
needed), see below for a relevant config.log excerpt.

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

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

Change-Id: I9122d0d853d0010155d57cb1d1d56f7c453d5208
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165904
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <[email protected]>
(cherry picked from commit 42f6e89)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173098
Tested-by: allotropia jenkins <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Dec 9, 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 <[email protected]>
(cherry picked from commit 3fb9859)
tdf-gerrit pushed a commit that referenced this pull request Dec 9, 2024
At least with one ASan/UBSan setup of mine using LODE's Clang 12.0.1,
./autogen.sh would occasionally detect -std=gnu11 as the required CC "option to
enable C11 features" (which would in turn cause building external/firebird to
fail oddly; an issue worth investigations of its own), because Clang would
occasionally crash with a SEGV on the corresponding configure test program's
first invocation (without -std=gnu11) when invoked with -O2 (and happen to
succeed on second invocation with -std=gnu11, so configure thinks that's
needed), see below for a relevant config.log excerpt.

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

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

Change-Id: I9122d0d853d0010155d57cb1d1d56f7c453d5208
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165904
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <[email protected]>
(cherry picked from commit 42f6e89)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173098
Tested-by: allotropia jenkins <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Dec 9, 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 <[email protected]>
(cherry picked from commit 3fb9859)
tdf-gerrit pushed a commit that referenced this pull request Dec 10, 2024
 #2  SwView::GetPostItMgr (this=<error reading variable: Cannot access memory at address 0xc8>) at sw/inc/view.hxx:659
 #3  SwXTextDocument::getPostIts(tools::JsonWriter&) () at sw/source/uibase/uno/unotxdoc.cxx:3351
 #4  0x00007f6238ac7cc8 in getPostIts (pThis=0x36aa6cb0) at /opt/rh/devtoolset-12/root/usr/include/c++/12/ext/atomicity.h:111
 #5  doc_getCommandValues () at desktop/source/lib/init.cxx:6739
 #6  0x00000000005863e0 in lok::Document::getCommandValues (pCommand=<optimized out>, this=<optimized out>)
    at /home/collabora/jenkins/workspace/package_cool_24.04_rpm/rpmbuild/BUILD/coolwsd-24.04.9.2snapshot/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx:492
 #7  ChildSession::getCommandValues(StringVector const&) () at kit/ChildSession.cpp:1180

Change-Id: Ib2a3c2e7eb1a108ad969588f6c313cade145e8ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176600
Tested-by: Jenkins CollaboraOffice <[email protected]>
Reviewed-by: Andras Timar <[email protected]>
(cherry picked from commit c0542a4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177517
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <[email protected]>
(cherry picked from commit e854f1d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177526
Reviewed-by: Xisco Fauli <[email protected]>
(cherry picked from commit a237eaf)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177531
Reviewed-by: Christian Lohmaier <[email protected]>
Tested-by: Christian Lohmaier <[email protected]>
Reviewed-by: Michael Stahl <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Dec 11, 2024
until oTextPara has been applied to the field's associated postit
window.

This became a noticeable problem since:

commit 2fba6df
CommitDate: Thu Dec 5 15:31:06 2024 +0100

    LOK: don't recreate the dialogs of an old view when loading new views

In the broken situation the contents of the postit are sent back to kit
as apparently empty, so newly inserted comments appear to be empty.

The broadcast bt of this scenario is:

 #0  sw::annotation::SwAnnotationWin::GetSimpleHtml (this=0x19f38790) at sw/source/uibase/docvw/AnnotationWin.cxx:516
 #1  0x00007f37d246283e in (anonymous namespace)::lcl_CommentNotification (pView=0x267cac40, nType=(anonymous namespace)::CommentNotificationType::Add,
     pItem=0x26baf4e0, nPostItId=0) at sw/source/uibase/docvw/PostItMgr.cxx:176
 #2  0x00007f37d2467fef in SwPostItMgr::LayoutPostIts (this=0x266d7160) at sw/source/uibase/docvw/PostItMgr.cxx:1084
 #3  0x00007f37d209dd1b in SwViewShell::VisPortChgd (this=0x267cce90, rRect=...) at sw/source/core/view/viewsh.cxx:1326
 #4  0x00007f37d119030d in SwCursorShell::VisPortChgd (this=0x267cce90, rRect=...) at sw/source/core/crsr/crsrsh.cxx:1788
 #5  0x00007f37d276478b in SwView::SetVisArea (this=0x267cac40, rRect=..., bUpdateScrollbar=true)
     at sw/source/uibase/uiview/viewport.cxx:249
 #6  0x00007f37d2764cc3 in SwView::SetVisArea (this=0x267cac40, rPt=..., bUpdateScrollbar=true)
     at sw/source/uibase/uiview/viewport.cxx:311
 #7  0x00007f37d2765e2e in SwView::Scroll (this=0x267cac40, rRect=..., nRangeX=65535, nRangeY=65535)
     at sw/source/uibase/uiview/viewport.cxx:495
 #8  0x00007f37d24d7708 in ScrollMDI (pVwSh=0x267cce90, rRect=..., nRangeX=65535, nRangeY=65535)
     at sw/source/uibase/docvw/edtwin3.cxx:41
 #9  0x00007f37d209a896 in SwViewShell::MakeVisible (this=0x267cce90, rRect=...) at sw/source/core/view/viewsh.cxx:665
 #10 0x00007f37d119a238 in SwCursorShell::MakeSelVisible (this=0x267cce90) at sw/source/core/crsr/crsrsh.cxx:3490
 #11 0x00007f37d1837671 in SwFEShell::MakeSelVisible (this=0x267cce90) at sw/source/core/frmedt/feshview.cxx:2677
 #12 0x00007f37d1192fcc in SwCursorShell::UpdateCursor (this=0x267cce90, eFlags=6, bIdleEnd=false)
     at sw/source/core/crsr/crsrsh.cxx:2345
 #13 0x00007f37d11886f9 in SwCursorShell::EndAction (this=0x267cce90, bIdleEnd=false) at sw/source/core/crsr/crsrsh.cxx:280
 #14 0x00007f37d178ed62 in SwEditShell::EndAllAction (this=0x267cce90) at sw/source/core/edit/edws.cxx:102
 #15 0x00007f37d2503daf in SwFieldMgr::InsertField (this=0x7fff88937c00, rData=...) at sw/source/uibase/fldui/fldmgr.cxx:1561
 #16 0x00007f37d292df75 in SwWrtShell::InsertPostIt (this=0x267cce90, rFieldMgr=..., rReq=...)

while in the "working" case IsScrollMDI is false and MakeVisible returns early.

2fba6df causes the profile's desire to restore core's SID_SIDEBAR to be
ignored and so the results of IsScrollMDI differ between the two
scenarios.

Which makes it more likely that IsScrollMDI is true when queried by
SwViewShell::MakeVisible, and so LayoutPostIts triggers before
pPostIt->SetTextObject, so the contents of that TextObject, while
applied to the postit, are not broadcast back via the kit.

put a StartAction/EndAction pairing when oTextPara is present to
suppress the update until oTextPara is applied.

Change-Id: Id42ff1be85fec4b1053e5a7726cf6d2ba8d7de84
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178326
Tested-by: Jenkins CollaboraOffice <[email protected]>
Reviewed-by: Pranam Lashkari <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Dec 12, 2024
although the actual order doesn't change there is a Delete/Insert of
the object in case the order should change.

::Insert will check if sorted and resort if not anyway, so presumably
if we just skip the middle-men and resort here if we need to then that
is equivalent, but without the invalidation for the already sorted case.

 #0  SwSortedObjs::Remove (this=0x510ed40, _rAnchoredObj=...) at core/sw/source/core/layout/sortedobjs.cxx:243
 #1  0x00007fffce0af130 in SwSortedObjs::Update (this=0x510ed40, _rAnchoredObj=...) at core/sw/source/core/layout/sortedobjs.cxx:282
 #2  0x00007fffcdf32c40 in SwAnchoredObject::UpdateObjInSortedList (this=0x51123c0) at core/sw/source/core/layout/anchoredobject.cxx:661
 #3  0x00007fffcdf8fc38 in SwFlyFrame::SwClientNotify (this=0x5112260, rMod=..., rHint=...) at core/sw/source/core/layout/fly.cxx:859
 #4  0x00007fffcdf9d1bf in SwFlyAtContentFrame::SwClientNotify (this=0x5112260, rMod=..., rHint=...) at core/sw/source/core/layout/flycnt.cxx:112
 #5  0x00007fffcd65bca8 in SwModify::CallSwClientNotify (this=0x4e68da0, rHint=...) at core/sw/source/core/attr/calbck.cxx:311
 #6  0x00007fffcd65bd71 in sw::BroadcastingModify::CallSwClientNotify (this=0x4e68da0, rHint=...) at core/sw/source/core/attr/calbck.cxx:316
 #7  0x00007fffcd65b42f in SwModify::SwClientNotify (this=0x4e68da0, rHint=...) at core/sw/source/core/attr/calbck.cxx:302
 #8  0x00007fffcd66771b in SwFormat::SwClientNotify (this=0x4e68da0, rHint=...) at core/sw/source/core/attr/format.cxx:300
 #9  0x00007fffcdf4448a in SwFrameFormat::SwClientNotify (this=0x4e68da0, rMod=..., rHint=...) at core/sw/source/core/layout/atrfrm.cxx:2843
 #10 0x00007fffcd65be1e in sw::ClientNotifyAttrChg (rModify=..., aSet=..., aOld=..., aNew=...) at core/sw/source/core/attr/calbck.cxx:325
 #11 0x00007fffcd66948e in SwFormat::SetFormatAttr (this=0x4e68da0, rSet=SfxItemSet of pool 0x1bcebe0 with parent 0x4e68e68 and Which ranges: [(88, 141), (159, 159), (1014, 1034)] = {...})
     at core/sw/source/core/attr/format.cxx:597
 #12 0x00007fffce649a2c in SwXFrame::setPropertyValue (this=0x5e47b90, rPropertyName="Size", _rValue=uno::Any("com.sun.star.awt.Size": ...))
     at core/sw/source/core/unocore/unoframe.cxx:1867
 #13 0x00007fffcdc4d7ea in SwTextBoxHelper::syncProperty (pShape=0x4dce770, nWID=89, nMemberID=0 '\000', rValue=uno::Any("com.sun.star.awt.Size": ...), pObj=0x0)
     at core/sw/source/core/doc/textboxhelper.cxx:995
 #14 0x00007fffcdf2e2d7 in SwAnchoredDrawObject::GetObjBoundRect (this=0x4e69dd0) at core/sw/source/core/layout/anchoreddrawobject.cxx:757
 #15 0x00007fffcdf320ca in SwAnchoredObject::GetObjRectWithSpaces (this=0x4e69dd0) at core/sw/source/core/layout/anchoredobject.cxx:575
 #16 0x00007fffcdf31eaa in SwAnchoredObject::InvalidateObjPosForConsiderWrapInfluence (this=0x4e69dd0) at core/sw/source/core/layout/anchoredobject.cxx:400
 #17 0x00007fffcdf32be5 in SwAnchoredObject::UpdateObjInSortedList (this=0x510e530) at core/sw/source/core/layout/anchoredobject.cxx:654
 #18 0x00007fffcdf8fc38 in SwFlyFrame::SwClientNotify (this=0x510e3d0, rMod=..., rHint=...) at core/sw/source/core/layout/fly.cxx:859
 #19 0x00007fffcdf9d1bf in SwFlyAtContentFrame::SwClientNotify (this=0x510e3d0, rMod=..., rHint=...) at core/sw/source/core/layout/flycnt.cxx:112
 #20 0x00007fffcd65bca8 in SwModify::CallSwClientNotify (this=0x4e364a0, rHint=...) at core/sw/source/core/attr/calbck.cxx:311
 #21 0x00007fffcd65bd71 in sw::BroadcastingModify::CallSwClientNotify (this=0x4e364a0, rHint=...) at core/sw/source/core/attr/calbck.cxx:316
 #22 0x00007fffcd65b42f in SwModify::SwClientNotify (this=0x4e364a0, rHint=...) at core/sw/source/core/attr/calbck.cxx:302
 #23 0x00007fffcd66771b in SwFormat::SwClientNotify (this=0x4e364a0, rHint=...) at core/sw/source/core/attr/format.cxx:300
 #24 0x00007fffcdf4448a in SwFrameFormat::SwClientNotify (this=0x4e364a0, rMod=..., rHint=...) at core/sw/source/core/layout/atrfrm.cxx:2843
 #25 0x00007fffcd65be1e in sw::ClientNotifyAttrChg (rModify=..., aSet=..., aOld=..., aNew=...) at core/sw/source/core/attr/calbck.cxx:325
 #26 0x00007fffcd66948e in SwFormat::SetFormatAttr (this=0x4e364a0, rSet=SfxItemSet of pool 0x1bcebe0 with parent 0x4e36568 and Which ranges: [(88, 141), (159, 159), (1014, 1034)] = {...})
     at core/sw/source/core/attr/format.cxx:597
 #27 0x00007fffce649a2c in SwXFrame::setPropertyValue (this=0x4a86e10, rPropertyName="Size", _rValue=uno::Any("com.sun.star.awt.Size": ...))
     at core/sw/source/core/unocore/unoframe.cxx:1867
 #28 0x00007fffcdc4d7ea in SwTextBoxHelper::syncProperty (pShape=0x4dc65f0, nWID=89, nMemberID=0 '\000', rValue=uno::Any("com.sun.star.awt.Size": ...), pObj=0x0)
     at core/sw/source/core/doc/textboxhelper.cxx:995
 #29 0x00007fffcdf2e2d7 in SwAnchoredDrawObject::GetObjBoundRect (this=0x4e3a0d0) at core/sw/source/core/layout/anchoreddrawobject.cxx:757
 #30 0x00007fffcdf320ca in SwAnchoredObject::GetObjRectWithSpaces (this=0x4e3a0d0) at core/sw/source/core/layout/anchoredobject.cxx:575
 #31 0x00007fffcdf815b3 in (anonymous namespace)::IsNextContentFullPage (rThis=...) at core/sw/source/core/layout/flowfrm.cxx:217
 #32 0x00007fffcdf81002 in SwFlowFrame::IsKeep (this=0x4e5a630, rKeep=..., rBreak=..., bCheckIfLastRowShouldKeep=false) at core/sw/source/core/layout/flowfrm.cxx:259

Change-Id: If2191e8b99d1b0347bab54a704013ce0a9a19410
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176992
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <[email protected]>
(cherry picked from commit f2cf4d9)
tdf-gerrit pushed a commit that referenced this pull request Dec 12, 2024
although the actual order doesn't change there is a Delete/Insert of
the object in case the order should change.

::Insert will check if sorted and resort if not anyway, so presumably
if we just skip the middle-men and resort here if we need to then that
is equivalent, but without the invalidation for the already sorted case.

 #0  SwSortedObjs::Remove (this=0x510ed40, _rAnchoredObj=...) at core/sw/source/core/layout/sortedobjs.cxx:243
 #1  0x00007fffce0af130 in SwSortedObjs::Update (this=0x510ed40, _rAnchoredObj=...) at core/sw/source/core/layout/sortedobjs.cxx:282
 #2  0x00007fffcdf32c40 in SwAnchoredObject::UpdateObjInSortedList (this=0x51123c0) at core/sw/source/core/layout/anchoredobject.cxx:661
 #3  0x00007fffcdf8fc38 in SwFlyFrame::SwClientNotify (this=0x5112260, rMod=..., rHint=...) at core/sw/source/core/layout/fly.cxx:859
 #4  0x00007fffcdf9d1bf in SwFlyAtContentFrame::SwClientNotify (this=0x5112260, rMod=..., rHint=...) at core/sw/source/core/layout/flycnt.cxx:112
 #5  0x00007fffcd65bca8 in SwModify::CallSwClientNotify (this=0x4e68da0, rHint=...) at core/sw/source/core/attr/calbck.cxx:311
 #6  0x00007fffcd65bd71 in sw::BroadcastingModify::CallSwClientNotify (this=0x4e68da0, rHint=...) at core/sw/source/core/attr/calbck.cxx:316
 #7  0x00007fffcd65b42f in SwModify::SwClientNotify (this=0x4e68da0, rHint=...) at core/sw/source/core/attr/calbck.cxx:302
 #8  0x00007fffcd66771b in SwFormat::SwClientNotify (this=0x4e68da0, rHint=...) at core/sw/source/core/attr/format.cxx:300
 #9  0x00007fffcdf4448a in SwFrameFormat::SwClientNotify (this=0x4e68da0, rMod=..., rHint=...) at core/sw/source/core/layout/atrfrm.cxx:2843
 #10 0x00007fffcd65be1e in sw::ClientNotifyAttrChg (rModify=..., aSet=..., aOld=..., aNew=...) at core/sw/source/core/attr/calbck.cxx:325
 #11 0x00007fffcd66948e in SwFormat::SetFormatAttr (this=0x4e68da0, rSet=SfxItemSet of pool 0x1bcebe0 with parent 0x4e68e68 and Which ranges: [(88, 141), (159, 159), (1014, 1034)] = {...})
     at core/sw/source/core/attr/format.cxx:597
 #12 0x00007fffce649a2c in SwXFrame::setPropertyValue (this=0x5e47b90, rPropertyName="Size", _rValue=uno::Any("com.sun.star.awt.Size": ...))
     at core/sw/source/core/unocore/unoframe.cxx:1867
 #13 0x00007fffcdc4d7ea in SwTextBoxHelper::syncProperty (pShape=0x4dce770, nWID=89, nMemberID=0 '\000', rValue=uno::Any("com.sun.star.awt.Size": ...), pObj=0x0)
     at core/sw/source/core/doc/textboxhelper.cxx:995
 #14 0x00007fffcdf2e2d7 in SwAnchoredDrawObject::GetObjBoundRect (this=0x4e69dd0) at core/sw/source/core/layout/anchoreddrawobject.cxx:757
 #15 0x00007fffcdf320ca in SwAnchoredObject::GetObjRectWithSpaces (this=0x4e69dd0) at core/sw/source/core/layout/anchoredobject.cxx:575
 #16 0x00007fffcdf31eaa in SwAnchoredObject::InvalidateObjPosForConsiderWrapInfluence (this=0x4e69dd0) at core/sw/source/core/layout/anchoredobject.cxx:400
 #17 0x00007fffcdf32be5 in SwAnchoredObject::UpdateObjInSortedList (this=0x510e530) at core/sw/source/core/layout/anchoredobject.cxx:654
 #18 0x00007fffcdf8fc38 in SwFlyFrame::SwClientNotify (this=0x510e3d0, rMod=..., rHint=...) at core/sw/source/core/layout/fly.cxx:859
 #19 0x00007fffcdf9d1bf in SwFlyAtContentFrame::SwClientNotify (this=0x510e3d0, rMod=..., rHint=...) at core/sw/source/core/layout/flycnt.cxx:112
 #20 0x00007fffcd65bca8 in SwModify::CallSwClientNotify (this=0x4e364a0, rHint=...) at core/sw/source/core/attr/calbck.cxx:311
 #21 0x00007fffcd65bd71 in sw::BroadcastingModify::CallSwClientNotify (this=0x4e364a0, rHint=...) at core/sw/source/core/attr/calbck.cxx:316
 #22 0x00007fffcd65b42f in SwModify::SwClientNotify (this=0x4e364a0, rHint=...) at core/sw/source/core/attr/calbck.cxx:302
 #23 0x00007fffcd66771b in SwFormat::SwClientNotify (this=0x4e364a0, rHint=...) at core/sw/source/core/attr/format.cxx:300
 #24 0x00007fffcdf4448a in SwFrameFormat::SwClientNotify (this=0x4e364a0, rMod=..., rHint=...) at core/sw/source/core/layout/atrfrm.cxx:2843
 #25 0x00007fffcd65be1e in sw::ClientNotifyAttrChg (rModify=..., aSet=..., aOld=..., aNew=...) at core/sw/source/core/attr/calbck.cxx:325
 #26 0x00007fffcd66948e in SwFormat::SetFormatAttr (this=0x4e364a0, rSet=SfxItemSet of pool 0x1bcebe0 with parent 0x4e36568 and Which ranges: [(88, 141), (159, 159), (1014, 1034)] = {...})
     at core/sw/source/core/attr/format.cxx:597
 #27 0x00007fffce649a2c in SwXFrame::setPropertyValue (this=0x4a86e10, rPropertyName="Size", _rValue=uno::Any("com.sun.star.awt.Size": ...))
     at core/sw/source/core/unocore/unoframe.cxx:1867
 #28 0x00007fffcdc4d7ea in SwTextBoxHelper::syncProperty (pShape=0x4dc65f0, nWID=89, nMemberID=0 '\000', rValue=uno::Any("com.sun.star.awt.Size": ...), pObj=0x0)
     at core/sw/source/core/doc/textboxhelper.cxx:995
 #29 0x00007fffcdf2e2d7 in SwAnchoredDrawObject::GetObjBoundRect (this=0x4e3a0d0) at core/sw/source/core/layout/anchoreddrawobject.cxx:757
 #30 0x00007fffcdf320ca in SwAnchoredObject::GetObjRectWithSpaces (this=0x4e3a0d0) at core/sw/source/core/layout/anchoredobject.cxx:575
 #31 0x00007fffcdf815b3 in (anonymous namespace)::IsNextContentFullPage (rThis=...) at core/sw/source/core/layout/flowfrm.cxx:217
 #32 0x00007fffcdf81002 in SwFlowFrame::IsKeep (this=0x4e5a630, rKeep=..., rBreak=..., bCheckIfLastRowShouldKeep=false) at core/sw/source/core/layout/flowfrm.cxx:259

Change-Id: If2191e8b99d1b0347bab54a704013ce0a9a19410
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176992
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <[email protected]>
(cherry picked from commit f2cf4d9)
tdf-gerrit pushed a commit that referenced this pull request Dec 13, 2024
until oTextPara has been applied to the field's associated postit
window.

This became a noticeable problem since:

commit 2fba6df
CommitDate: Thu Dec 5 15:31:06 2024 +0100

    LOK: don't recreate the dialogs of an old view when loading new views

In the broken situation the contents of the postit are sent back to kit
as apparently empty, so newly inserted comments appear to be empty.

The broadcast bt of this scenario is:

 #0  sw::annotation::SwAnnotationWin::GetSimpleHtml (this=0x19f38790) at sw/source/uibase/docvw/AnnotationWin.cxx:516
 #1  0x00007f37d246283e in (anonymous namespace)::lcl_CommentNotification (pView=0x267cac40, nType=(anonymous namespace)::CommentNotificationType::Add,
     pItem=0x26baf4e0, nPostItId=0) at sw/source/uibase/docvw/PostItMgr.cxx:176
 #2  0x00007f37d2467fef in SwPostItMgr::LayoutPostIts (this=0x266d7160) at sw/source/uibase/docvw/PostItMgr.cxx:1084
 #3  0x00007f37d209dd1b in SwViewShell::VisPortChgd (this=0x267cce90, rRect=...) at sw/source/core/view/viewsh.cxx:1326
 #4  0x00007f37d119030d in SwCursorShell::VisPortChgd (this=0x267cce90, rRect=...) at sw/source/core/crsr/crsrsh.cxx:1788
 #5  0x00007f37d276478b in SwView::SetVisArea (this=0x267cac40, rRect=..., bUpdateScrollbar=true)
     at sw/source/uibase/uiview/viewport.cxx:249
 #6  0x00007f37d2764cc3 in SwView::SetVisArea (this=0x267cac40, rPt=..., bUpdateScrollbar=true)
     at sw/source/uibase/uiview/viewport.cxx:311
 #7  0x00007f37d2765e2e in SwView::Scroll (this=0x267cac40, rRect=..., nRangeX=65535, nRangeY=65535)
     at sw/source/uibase/uiview/viewport.cxx:495
 #8  0x00007f37d24d7708 in ScrollMDI (pVwSh=0x267cce90, rRect=..., nRangeX=65535, nRangeY=65535)
     at sw/source/uibase/docvw/edtwin3.cxx:41
 #9  0x00007f37d209a896 in SwViewShell::MakeVisible (this=0x267cce90, rRect=...) at sw/source/core/view/viewsh.cxx:665
 #10 0x00007f37d119a238 in SwCursorShell::MakeSelVisible (this=0x267cce90) at sw/source/core/crsr/crsrsh.cxx:3490
 #11 0x00007f37d1837671 in SwFEShell::MakeSelVisible (this=0x267cce90) at sw/source/core/frmedt/feshview.cxx:2677
 #12 0x00007f37d1192fcc in SwCursorShell::UpdateCursor (this=0x267cce90, eFlags=6, bIdleEnd=false)
     at sw/source/core/crsr/crsrsh.cxx:2345
 #13 0x00007f37d11886f9 in SwCursorShell::EndAction (this=0x267cce90, bIdleEnd=false) at sw/source/core/crsr/crsrsh.cxx:280
 #14 0x00007f37d178ed62 in SwEditShell::EndAllAction (this=0x267cce90) at sw/source/core/edit/edws.cxx:102
 #15 0x00007f37d2503daf in SwFieldMgr::InsertField (this=0x7fff88937c00, rData=...) at sw/source/uibase/fldui/fldmgr.cxx:1561
 #16 0x00007f37d292df75 in SwWrtShell::InsertPostIt (this=0x267cce90, rFieldMgr=..., rReq=...)

while in the "working" case IsScrollMDI is false and MakeVisible returns early.

2fba6df causes the profile's desire to restore core's SID_SIDEBAR to be
ignored and so the results of IsScrollMDI differ between the two
scenarios.

Which makes it more likely that IsScrollMDI is true when queried by
SwViewShell::MakeVisible, and so LayoutPostIts triggers before
pPostIt->SetTextObject, so the contents of that TextObject, while
applied to the postit, are not broadcast back via the kit.

put a StartAction/EndAction pairing when oTextPara is present to
suppress the update until oTextPara is applied.

Change-Id: Id42ff1be85fec4b1053e5a7726cf6d2ba8d7de84
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178326
Tested-by: Jenkins CollaboraOffice <[email protected]>
Reviewed-by: Pranam Lashkari <[email protected]>
(cherry picked from commit c29a10b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178390
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Dec 13, 2024
 #0  SdrObjList::RemoveObjectFromContainer (this=0x1d12e30, nObjectPosition=3) at core/svx/source/svdraw/svdpage.cxx:1093
 #1  0x00007ffff15da0bd in SdrObjList::SetObjectOrdNum (this=0x1d12e30, nOldObjNum=3, nNewObjNum=2) at core/svx/source/svdraw/svdpage.cxx:536
 #2  0x00007ffff14c954c in SdrObject::ensureSortedImmediatelyAfter (this=0x4f56d30, rFirst=...) at core/svx/source/svdraw/svdobj.cxx:897
 #3  0x00007fffcdc4978c in SwTextBoxHelper::DoTextBoxZOrderCorrection (pShape=0x4c3a660, pObj=0x4c3d730) at core/sw/source/core/doc/textboxhelper.cxx:1638
 #4  0x00007fffcdc4bcbc in SwTextBoxHelper::changeAnchor (pShape=0x4c3a660, pObj=0x4c3d730) at core/sw/source/core/doc/textboxhelper.cxx:1247
 #5  0x00007fffcdc4e613 in SwTextBoxHelper::synchronizeGroupTextBoxProperty
     (pFunc=0x7fffcdc4bc10 <SwTextBoxHelper::changeAnchor(SwFrameFormat*, SdrObject*)>, pFormat=0x4c3a660, pObj=0x4c3d730)
     at core/sw/source/core/doc/textboxhelper.cxx:1652
 #6  0x00007fffcdd41a89 in SwDrawContact::Changed_ (this=0x4c55400, rObj=..., eType=SdrUserCallType::ChildMoveOnly, pOldBoundRect=0x7fffffff09d8)
     at core/sw/source/core/draw/dcontact.cxx:1250
 #7  0x00007fffcdd410a7 in SwDrawContact::Changed (this=0x4c55400, rObj=..., eType=SdrUserCallType::ChildMoveOnly, rOldBoundRect=...)
     at core/sw/source/core/draw/dcontact.cxx:1005
 #8  0x00007ffff14c7356 in SdrObject::SendUserCall (this=0x4c3d730, eUserCall=SdrUserCallType::MoveOnly, rBoundRect=...) at core/svx/source/svdraw/svdobj.cxx:2827
 #9  0x00007ffff14b11d8 in SdrObjCustomShape::Move (this=0x4c3d730, rSiz=Size = {...}) at core/svx/source/svdraw/svdoashp.cxx:1499
 #10 0x00007ffff152753b in SdrObjGroup::Move (this=0x1be18e0, rSiz=Size = {...}) at core/svx/source/svdraw/svdogrp.cxx:561
 #11 0x00007fffce8c80b8 in SwViewShellImp::NotifySizeChg
     (unique_ptrI7SdrMarkSt14default_deleteIS2_EESaIS5_EE11_M_allocateEm=<error reading variable: Unhandled DWARF expression opcode 0x0>, hrowE=<error reading variable: Unhandled DWARF expression opcode 0x0>) at core/sw/source/core/view/vdraw.cxx:274
 #12 0x00007fffce032bc1 in AdjustSizeChgNotify (pRoot=0x5e1c7f0) at core/sw/source/core/layout/pagechg.cxx:851
 #13 0x00007fffce03243f in SwRootFrame::CheckViewLayout (this=0x5e1c7f0, pViewOpt=0x0, pVisArea=0x0) at core/sw/source/core/layout/pagechg.cxx:2445
 #14 0x00007fffce032eec in SwPageFrame::Cut (this=0x5f19910) at core/sw/source/core/layout/pagechg.cxx:921
 #15 0x00007fffce037d40 in SwRootFrame::RemovePage (this=0x5e1c7f0, pDelRef=0x7fffffff13c0, eResult=SwRemoveResult::Prev)
     at core/sw/source/core/layout/pagechg.cxx:1518
 #16 0x00007fffce03808e in SwRootFrame::RemoveSuperfluous (this=0x5e1c7f0) at core/sw/source/core/layout/pagechg.cxx:1557
 #17 0x00007fffcdfe8d04 in SwLayAction::InternalAction (this=0x7fffffff1a30, pRenderContext=0x5211510) at core/sw/source/core/layout/layact.cxx:694
 #18 0x00007fffcdfe7cc6 in SwLayAction::Action (this=0x7fffffff1a30, pRenderContext=0x5211510) at core/sw/source/core/layout/layact.cxx:396
 #19 0x00007fffce8d5995 in SwViewShell::CalcLayout (this=0x521c540) at core/sw/source/core/view/viewsh.cxx:1197
 #20 0x00007fffcde1233f in SwEditShell::CalcLayout (this=0x521c540) at core/sw/source/core/edit/edws.cxx:111

Change-Id: I66ffbbfc74e52eea2e24e486d52607e84ffb8fcb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178415
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Dec 14, 2024
and

cid#1608607 Check of thread-shared field evades lock acquisition

futile to lock m_nState

 #1  0x00007f3bdc4a9cc1 in pthread_mutex_lock@@GLIBC_2.2.5 () at /lib64/libc.so.6
 #2  0x00007f3bc48b0683 in __gthread_mutex_lock (__mutex=0x29ae4698) at /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/x86_64-redhat-linux/bits/gthr-default.h:762
 #3  0x00007f3bc48b9505 in std::mutex::lock (this=0x29ae4698) at /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/std_mutex.h:113
 #4  0x00007f3bc48b8bec in std::unique_lock<std::mutex>::lock (this=0x7fffa21aa7e8) at /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/unique_lock.h:147
 #5  0x00007f3bc48b0b58 in std::unique_lock<std::mutex>::unique_lock (this=0x7fffa21aa7e8, __m=...) at /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/unique_lock.h:73
 #6  0x00007f3bc48af7cc in fileaccess::BaseContent::cDEL (this=0x29ae4600) at core/ucb/source/ucp/file/bc.cxx:1126
 #7  0x00007f3bc48af9d4 in non-virtual thunk to fileaccess::BaseContent::cDEL() () at core/instdir/program/../program/libucpfile1.so
 #8  0x00007f3bc492d43f in fileaccess::TaskManager::getContentDeletedEventListeners (this=0x29ab47e0, aName="file://core/instdir/program/../share/config/cdefghij.klm")
     at core/ucb/source/ucp/file/filtask.cxx:2581
 #9  0x00007f3bc492caaa in fileaccess::TaskManager::remove
     (this=0x29ab47e0, CommandId=5, aUnqPath="file://core/instdir/program/../share/config/cdefghij.klm", IsWhat=fileaccess::TaskManager::FileUrlType::File, MustExist=true)
     at core/ucb/source/ucp/file/filtask.cxx:1572
 #10 0x00007f3bc48ab8c2 in fileaccess::BaseContent::deleteContent (this=0x29ae4600, nMyCommandIdentifier=5) at core/ucb/source/ucp/file/bc.cxx:934
 #11 0x00007f3bc48a9891 in fileaccess::BaseContent::execute (this=0x29ae4600, aCommand=..., CommandId=5, Environment=empty uno::Reference) at core/ucb/source/ucp/file/bc.cxx:300
 #12 0x00007f3bc48ad00a in non-virtual thunk to fileaccess::BaseContent::execute(com::sun::star::ucb::Command const&, int, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) ()
     at core/instdir/program/../program/libucpfile1.so
 #13 0x00007f3bdc8f5537 in ucbhelper::Content_Impl::executeCommand (this=0x29adfb80, rCommand=...) at core/ucbhelper/source/client/content.cxx:1260
 #14 0x00007f3bdc8f673c in ucbhelper::Content::executeCommand (this=0x7fffa21ab0a0, rCommandName="delete", rCommandArgument=uno::Any("boolean": 1 '\001'))
     at core/ucbhelper/source/client/content.cxx:562
 #15 0x00007f3bdf7fd2c1 in KillFile (rURL=...) at core/svx/source/gallery2/galmisc.cxx:291

Change-Id: Iff9114adb4d5fe2ccf0d5a10fdd91295393a7820
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177519
Reviewed-by: Caolán McNamara <[email protected]>
Tested-by: Jenkins
tdf-gerrit pushed a commit that referenced this pull request Dec 16, 2024
 #0  SdrObjList::RemoveObjectFromContainer (this=0x1d12e30, nObjectPosition=3) at core/svx/source/svdraw/svdpage.cxx:1093
 #1  0x00007ffff15da0bd in SdrObjList::SetObjectOrdNum (this=0x1d12e30, nOldObjNum=3, nNewObjNum=2) at core/svx/source/svdraw/svdpage.cxx:536
 #2  0x00007ffff14c954c in SdrObject::ensureSortedImmediatelyAfter (this=0x4f56d30, rFirst=...) at core/svx/source/svdraw/svdobj.cxx:897
 #3  0x00007fffcdc4978c in SwTextBoxHelper::DoTextBoxZOrderCorrection (pShape=0x4c3a660, pObj=0x4c3d730) at core/sw/source/core/doc/textboxhelper.cxx:1638
 #4  0x00007fffcdc4bcbc in SwTextBoxHelper::changeAnchor (pShape=0x4c3a660, pObj=0x4c3d730) at core/sw/source/core/doc/textboxhelper.cxx:1247
 #5  0x00007fffcdc4e613 in SwTextBoxHelper::synchronizeGroupTextBoxProperty
     (pFunc=0x7fffcdc4bc10 <SwTextBoxHelper::changeAnchor(SwFrameFormat*, SdrObject*)>, pFormat=0x4c3a660, pObj=0x4c3d730)
     at core/sw/source/core/doc/textboxhelper.cxx:1652
 #6  0x00007fffcdd41a89 in SwDrawContact::Changed_ (this=0x4c55400, rObj=..., eType=SdrUserCallType::ChildMoveOnly, pOldBoundRect=0x7fffffff09d8)
     at core/sw/source/core/draw/dcontact.cxx:1250
 #7  0x00007fffcdd410a7 in SwDrawContact::Changed (this=0x4c55400, rObj=..., eType=SdrUserCallType::ChildMoveOnly, rOldBoundRect=...)
     at core/sw/source/core/draw/dcontact.cxx:1005
 #8  0x00007ffff14c7356 in SdrObject::SendUserCall (this=0x4c3d730, eUserCall=SdrUserCallType::MoveOnly, rBoundRect=...) at core/svx/source/svdraw/svdobj.cxx:2827
 #9  0x00007ffff14b11d8 in SdrObjCustomShape::Move (this=0x4c3d730, rSiz=Size = {...}) at core/svx/source/svdraw/svdoashp.cxx:1499
 #10 0x00007ffff152753b in SdrObjGroup::Move (this=0x1be18e0, rSiz=Size = {...}) at core/svx/source/svdraw/svdogrp.cxx:561
 #11 0x00007fffce8c80b8 in SwViewShellImp::NotifySizeChg
     (unique_ptrI7SdrMarkSt14default_deleteIS2_EESaIS5_EE11_M_allocateEm=<error reading variable: Unhandled DWARF expression opcode 0x0>, hrowE=<error reading variable: Unhandled DWARF expression opcode 0x0>) at core/sw/source/core/view/vdraw.cxx:274
 #12 0x00007fffce032bc1 in AdjustSizeChgNotify (pRoot=0x5e1c7f0) at core/sw/source/core/layout/pagechg.cxx:851
 #13 0x00007fffce03243f in SwRootFrame::CheckViewLayout (this=0x5e1c7f0, pViewOpt=0x0, pVisArea=0x0) at core/sw/source/core/layout/pagechg.cxx:2445
 #14 0x00007fffce032eec in SwPageFrame::Cut (this=0x5f19910) at core/sw/source/core/layout/pagechg.cxx:921
 #15 0x00007fffce037d40 in SwRootFrame::RemovePage (this=0x5e1c7f0, pDelRef=0x7fffffff13c0, eResult=SwRemoveResult::Prev)
     at core/sw/source/core/layout/pagechg.cxx:1518
 #16 0x00007fffce03808e in SwRootFrame::RemoveSuperfluous (this=0x5e1c7f0) at core/sw/source/core/layout/pagechg.cxx:1557
 #17 0x00007fffcdfe8d04 in SwLayAction::InternalAction (this=0x7fffffff1a30, pRenderContext=0x5211510) at core/sw/source/core/layout/layact.cxx:694
 #18 0x00007fffcdfe7cc6 in SwLayAction::Action (this=0x7fffffff1a30, pRenderContext=0x5211510) at core/sw/source/core/layout/layact.cxx:396
 #19 0x00007fffce8d5995 in SwViewShell::CalcLayout (this=0x521c540) at core/sw/source/core/view/viewsh.cxx:1197
 #20 0x00007fffcde1233f in SwEditShell::CalcLayout (this=0x521c540) at core/sw/source/core/edit/edws.cxx:111

Change-Id: I66ffbbfc74e52eea2e24e486d52607e84ffb8fcb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178415
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <[email protected]>
(cherry picked from commit 71a9de6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178544
Tested-by: Jenkins CollaboraOffice <[email protected]>
Reviewed-by: Miklos Vajna <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Dec 16, 2024
 #0  SdrObjList::RemoveObjectFromContainer (this=0x1d12e30, nObjectPosition=3) at core/svx/source/svdraw/svdpage.cxx:1093
 #1  0x00007ffff15da0bd in SdrObjList::SetObjectOrdNum (this=0x1d12e30, nOldObjNum=3, nNewObjNum=2) at core/svx/source/svdraw/svdpage.cxx:536
 #2  0x00007ffff14c954c in SdrObject::ensureSortedImmediatelyAfter (this=0x4f56d30, rFirst=...) at core/svx/source/svdraw/svdobj.cxx:897
 #3  0x00007fffcdc4978c in SwTextBoxHelper::DoTextBoxZOrderCorrection (pShape=0x4c3a660, pObj=0x4c3d730) at core/sw/source/core/doc/textboxhelper.cxx:1638
 #4  0x00007fffcdc4bcbc in SwTextBoxHelper::changeAnchor (pShape=0x4c3a660, pObj=0x4c3d730) at core/sw/source/core/doc/textboxhelper.cxx:1247
 #5  0x00007fffcdc4e613 in SwTextBoxHelper::synchronizeGroupTextBoxProperty
     (pFunc=0x7fffcdc4bc10 <SwTextBoxHelper::changeAnchor(SwFrameFormat*, SdrObject*)>, pFormat=0x4c3a660, pObj=0x4c3d730)
     at core/sw/source/core/doc/textboxhelper.cxx:1652
 #6  0x00007fffcdd41a89 in SwDrawContact::Changed_ (this=0x4c55400, rObj=..., eType=SdrUserCallType::ChildMoveOnly, pOldBoundRect=0x7fffffff09d8)
     at core/sw/source/core/draw/dcontact.cxx:1250
 #7  0x00007fffcdd410a7 in SwDrawContact::Changed (this=0x4c55400, rObj=..., eType=SdrUserCallType::ChildMoveOnly, rOldBoundRect=...)
     at core/sw/source/core/draw/dcontact.cxx:1005
 #8  0x00007ffff14c7356 in SdrObject::SendUserCall (this=0x4c3d730, eUserCall=SdrUserCallType::MoveOnly, rBoundRect=...) at core/svx/source/svdraw/svdobj.cxx:2827
 #9  0x00007ffff14b11d8 in SdrObjCustomShape::Move (this=0x4c3d730, rSiz=Size = {...}) at core/svx/source/svdraw/svdoashp.cxx:1499
 #10 0x00007ffff152753b in SdrObjGroup::Move (this=0x1be18e0, rSiz=Size = {...}) at core/svx/source/svdraw/svdogrp.cxx:561
 #11 0x00007fffce8c80b8 in SwViewShellImp::NotifySizeChg
     (unique_ptrI7SdrMarkSt14default_deleteIS2_EESaIS5_EE11_M_allocateEm=<error reading variable: Unhandled DWARF expression opcode 0x0>, hrowE=<error reading variable: Unhandled DWARF expression opcode 0x0>) at core/sw/source/core/view/vdraw.cxx:274
 #12 0x00007fffce032bc1 in AdjustSizeChgNotify (pRoot=0x5e1c7f0) at core/sw/source/core/layout/pagechg.cxx:851
 #13 0x00007fffce03243f in SwRootFrame::CheckViewLayout (this=0x5e1c7f0, pViewOpt=0x0, pVisArea=0x0) at core/sw/source/core/layout/pagechg.cxx:2445
 #14 0x00007fffce032eec in SwPageFrame::Cut (this=0x5f19910) at core/sw/source/core/layout/pagechg.cxx:921
 #15 0x00007fffce037d40 in SwRootFrame::RemovePage (this=0x5e1c7f0, pDelRef=0x7fffffff13c0, eResult=SwRemoveResult::Prev)
     at core/sw/source/core/layout/pagechg.cxx:1518
 #16 0x00007fffce03808e in SwRootFrame::RemoveSuperfluous (this=0x5e1c7f0) at core/sw/source/core/layout/pagechg.cxx:1557
 #17 0x00007fffcdfe8d04 in SwLayAction::InternalAction (this=0x7fffffff1a30, pRenderContext=0x5211510) at core/sw/source/core/layout/layact.cxx:694
 #18 0x00007fffcdfe7cc6 in SwLayAction::Action (this=0x7fffffff1a30, pRenderContext=0x5211510) at core/sw/source/core/layout/layact.cxx:396
 #19 0x00007fffce8d5995 in SwViewShell::CalcLayout (this=0x521c540) at core/sw/source/core/view/viewsh.cxx:1197
 #20 0x00007fffcde1233f in SwEditShell::CalcLayout (this=0x521c540) at core/sw/source/core/edit/edws.cxx:111

Change-Id: I66ffbbfc74e52eea2e24e486d52607e84ffb8fcb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178415
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <[email protected]>
(cherry picked from commit 71a9de6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178543
Reviewed-by: Xisco Fauli <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Dec 17, 2024
on loading tdf97831-15.xlsx

 #0  0x00007fffebea8664 in __pthread_kill_implementation () at /lib64/libc.so.6
 #1  0x00007fffebe4fc4e in raise () at /lib64/libc.so.6
 #2  0x00007fffebe37902 in abort () at /lib64/libc.so.6
 #3  0x00007fffebaa84e9 in __gnu_debug::_Error_formatter::_M_error() const [clone .cold] () at /lib64/libstdc++.so.6
 #4  0x00007fffa8d75183 in __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<unsigned int const*, std::__cxx1998::vector<unsigned int, std::allocator<unsigned int> > >, std::__debug::vector<unsigned int, std::allocator<unsigned int> >, std::forward_iterator_tag>::operator++ (this=0x7fffffff9360) at /usr/include/c++/14/debug/safe_iterator.h:392
 #5  0x00007fffa8d73da2 in __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<unsigned int const*, std::__cxx1998::vector<unsigned int, std::allocator<unsigned int> > >, std::__debug::vector<unsigned int, std::allocator<unsigned int> >, std::bidirectional_iterator_tag>::operator++ (this=0x7fffffff9360) at /usr/include/c++/14/debug/safe_iterator.h:679
 #6  0x00007fffa8d71fd2 in __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<unsigned int const*, std::__cxx1998::vector<unsigned int, std::allocator<unsigned int> > >, std::__debug::vector<unsigned int, std::allocator<unsigned int> >, std::random_access_iterator_tag>::operator++ (this=0x7fffffff9360) at /usr/include/c++/14/debug/safe_iterator.h:849
 #7  0x00007fffa90d204e in ScDocument::GetCondResult (this=0x18fbcb0, rCell=..., rPos=..., rList=..., rIndex=...) at co-24.04/sc/source/core/data/documen4.cxx:816
 #8  0x00007fffa90d1ea1 in ScDocument::GetCondResult (this=0x18fbcb0, nCol=7, nRow=1, nTab=0, pCell=0x7fffffff9420) at co-24.04/sc/source/core/data/documen4.cxx:809
 #9  0x00007fffa8f2740d in ScColumn::GetNeededSize
     (this=0x7fffd000b4d0, nRow=1, pDev=0x1fa6690, nPPTX=0.064757526036325508, nPPTY=0.067000000000000004, rZoomX=..., rZoomY=..., bWidth=false, rOptions=..., ppPatternChange=0x7fffffff9ba8, bInPrintTwips=false) at co-24.04/sc/source/core/data/column2.cxx:139
 #10 0x00007fffa8f2b887 in ScColumn::GetOptimalHeight (this=0x7fffd000b4d0, rCxt=..., nStartRow=0, nEndRow=24, nMinHeight=256, nMinStart=0)
     at co-24.04/sc/source/core/data/column2.cxx:1084
 #11 0x00007fffa94a28b7 in (anonymous namespace)::GetOptimalHeightsInColumn (rCxt=..., rCol=..., nStartRow=0, nEndRow=24, pProgress=0x0, nProgressStart=0)
     at co-24.04/sc/source/core/data/table1.cxx:120
 #12 0x00007fffa94a47f2 in ScTable::SetOptimalHeight (this=0x1f584a0, rCxt=..., nSt

where things go wrong earlier with:

 #2  0x00007fffacd716c3 in std::__new_allocator<unsigned int>::deallocate (this=0x7fff9c1d2030, __p=0x7fff9c37acf0, __n=1) at /usr/include/c++/14/bits/new_allocator.h:172
 #3  0x00007fffacd65215 in std::allocator<unsigned int>::deallocate (this=0x7fff9c1d2030, __p=0x7fff9c37acf0, __n=1) at /usr/include/c++/14/bits/allocator.h:208
 #4  std::allocator_traits<std::allocator<unsigned int> >::deallocate (__a=..., __p=0x7fff9c37acf0, __n=1) at /usr/include/c++/14/bits/alloc_traits.h:513
 #5  std::__cxx1998::_Vector_base<unsigned int, std::allocator<unsigned int> >::_M_deallocate (this=0x7fff9c1d2030, __p=0x7fff9c37acf0, __n=1) at /usr/include/c++/14/bits/stl_vector.h:389
 #6  0x00007fffacd60b88 in std::__cxx1998::_Vector_base<unsigned int, std::allocator<unsigned int> >::~_Vector_base (this=0x7fff9c1d2030, __in_chrg=<optimized out>)
     at /usr/include/c++/14/bits/stl_vector.h:368
 #7  0x00007fffacd60bef in std::__cxx1998::vector<unsigned int, std::allocator<unsigned int> >::~vector (this=0x7fff9c1d2030, __in_chrg=<optimized out>)
     at /usr/include/c++/14/bits/stl_vector.h:738
 #8  0x00007fffacd5ecd6 in std::__debug::vector<unsigned int, std::allocator<unsigned int> >::~vector (this=0x7fff9c1d2018, __in_chrg=<optimized out>) at /usr/include/c++/14/debug/vector:245
 #9  0x00007fffacd5feb6 in o3tl::sorted_vector<unsigned int, std::less<unsigned int>, o3tl::find_unique, true>::~sorted_vector (this=0x7fff9c1d2018, __in_chrg=<optimized out>)
     at co-24.04/include/o3tl/sorted_vector.hxx:39
 #10 0x00007fffacd7a71c in ScCondFormatItem::~ScCondFormatItem (this=0x7fff9c1d2000, __in_chrg=<optimized out>) at co-24.04/sc/source/core/data/attrib.cxx:722
 #11 0x00007fffacd7a748 in ScCondFormatItem::~ScCondFormatItem (this=0x7fff9c1d2000, __in_chrg=<optimized out>) at co-24.04/sc/source/core/data/attrib.cxx:722
 #12 0x00007fffef638513 in implCleanupItemEntry (rPool=..., pSource=0x7fff9c1d2000) at co-24.04/svl/source/items/itemset.cxx:473
 #13 0x00007fffef638e00 in SfxItemSet::ClearAllItemsImpl (this=0x7fffffff8d38) at co-24.04/svl/source/items/itemset.cxx:643
 #14 0x00007fffef638a02 in SfxItemSet::~SfxItemSet (this=0x7fffffff8d38, __in_chrg=<optimized out>) at co-24.04/svl/source/items/itemset.cxx:562
 #15 0x00007fffacd5f7d0 in SfxSetItem::~SfxSetItem (this=0x7fffffff8d20, __in_chrg=<optimized out>) at co-24.04/include/svl/setitem.hxx:27
 #16 0x00007fffacd5f88e in ScPatternAttr::~ScPatternAttr (this=0x7fffffff8d20, __in_chrg=<optimized out>) at co-24.04/sc/inc/patattr.hxx:54
 #17 0x00007fffaceab497 in ScColumn::ApplyAttr (this=0x7fff9c027960, nRow=1, rAttr=...) at co-24.04/sc/source/core/data/column.cxx:573
 #18 0x00007fffacf38508 in ScColumn::SetNumberFormat (this=0x7fff9c027960, nRow=1, nNumberFormat=99) at co-24.04/sc/source/core/data/column2.cxx:3302
 #19 0x00007fffad4c3b55 in ScTable::SetNumberFormat (this=0x1d93840, nCol=7, nRow=1, nNumberFormat=99) at co-24.04/sc/source/core/data/table2.cxx:2315
 #20 0x00007fffad114bfa in ScDocument::SetNumberFormat (this=0x1c74100, rPos=..., nNumberFormat=99) at co-24.04/sc/source/core/data/document.cxx:3727
 #21 0x00007fffad356c65 in ScFormulaCell::InterpretTail (this=0x1cf9800, rContext=..., eTailParam=ScFormulaCell::SCITP_NORMAL)
     at co-24.04/sc/source/core/data/formulacell.cxx:2157
 #22 0x00007fffad354e67 in ScFormulaCell::Interpret (this=0x1cf9800, nStartOffset=-1, nEndOffset=-1) at co-24.04/sc/source/core/data/formulacell.cxx:1619
 #23 0x00007fffacf8e59f in ScFormulaCell::MaybeInterpret (this=0x1cf9800) at co-24.04/sc/inc/formulacell.hxx:470
 #24 0x00007fffad358dd4 in ScFormulaCell::IsValue (this=0x1cf9800) at co-24.04/sc/source/core/data/formulacell.cxx:2762
 #25 0x00007fffad025e1b in lcl_GetCellContent (rCell=..., bIsStr1=false, rArg=@0x7fffffff9208: 0, rArgStr="", pDoc=0x1c74100)
     at co-24.04/sc/source/core/data/conditio.cxx:764
 #26 0x00007fffad0286c5 in ScConditionEntry::IsCellValid (this=0x7fff9c1c73f0, rCell=..., rPos=...) at co-24.04/sc/source/core/data/conditio.cxx:1263
 #27 0x00007fffad02b18c in ScConditionalFormat::GetCellStyle (this=0x7fff9c02c1d0, rCell=..., rPos=...) at co-24.04/sc/source/core/data/conditio.cxx:1863
 #28 0x00007fffad0d20f8 in ScDocument::GetCondResult (this=0x1c74100, rCell=..., rPos=..., rList=..., rIndex=...) at co-24.04/sc/source/core/data/documen4.cxx:827
 #29 0x00007fffad0d1f91 in ScDocument::GetCondResult (this=0x1c74100, nCol=7, nRow=1, nTab=0, pCell=0x7fffffff9420) at co-24.04/sc/source/core/data/documen4.cxx:809

very probably this is a problem since ItemSet rework of:

commit 2b4cb63
CommitDate: Tue Nov 21 16:08:57 2023 +0100

    Cleanup some ScPatternAttr specific stuff

or similar of that sequence, and likely fixed in upstream later by:

Author:     Armin Le Grand (allotropia) <[email protected]>
CommitDate: Thu Dec 28 19:38:15 2023 +0100

    Decouple ScPatternAttr from SfxItemPool

but that's a very sizable rework, so here apply a conservative simpler
workaround to avoid the crash.

Change-Id: I309953015d39bce4796a2cf99666603b00c34d24
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178579
Reviewed-by: Andras Timar <[email protected]>
Tested-by: Jenkins CollaboraOffice <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Dec 18, 2024
possibly after uno.HideSlide

 #0  0x00007e697b8c0b97 in SdPage::GetPageInfo (this=this@entry=0x0, jsonWriter=...)
     at sd/source/core/sdpage.cxx:1751
 #1  0x00007e697bbda0ab in SdXImpressDocument::getPartInfo (this=<optimized out>, nPart=<optimized out>)
     at sd/source/ui/unoidl/unomodel.cxx:3692
 #2  0x00007e698ae7e078 in doc_getPartInfo (pThis=0x121017c0, nPart=9)
     at desktop/source/lib/init.cxx:4176
 #3  0x000000000059bcf4 in LOKitHelper::getPartData (part=9, loKitDocument=0x121017c0) at kit/KitHelper.hpp:47
 #4  LOKitHelper::fetchPartsData (loKitDocument=0x121017c0, resultInfo=std::unordered_map with 6 elements = {...}, partsCount=84, mode=@0x7ffec727bd58: 1)
     at kit/KitHelper.hpp:91
 #5  0x000000000059c6a3 in LOKitHelper::documentStatus (loKitDocument=0x121017c0) at kit/KitHelper.hpp:164
 #6  0x000000000057fb7a in ChildSession::selectClientPart (this=0x556fe60, tokens=...) at kit/ChildSession.cpp:2964
 #7  0x000000000058a88f in ChildSession::_handleInput (this=<optimized out>, buffer=<optimized out>, length=<optimized out>) at kit/ChildSession.cpp:495
 #8  0x000000000061c63f in Session::handleMessage (this=0x556fe60, data=std::vector of length 29, capacity 29 = {...})

Change-Id: Ib4e532b31cdc6a69f9e54317699f426c12de35d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177781
Reviewed-by: Miklos Vajna <[email protected]>
Tested-by: Jenkins CollaboraOffice <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Dec 18, 2024
 #0  SdrObjList::RemoveObjectFromContainer (this=0x1d12e30, nObjectPosition=3) at core/svx/source/svdraw/svdpage.cxx:1093
 #1  0x00007ffff15da0bd in SdrObjList::SetObjectOrdNum (this=0x1d12e30, nOldObjNum=3, nNewObjNum=2) at core/svx/source/svdraw/svdpage.cxx:536
 #2  0x00007ffff14c954c in SdrObject::ensureSortedImmediatelyAfter (this=0x4f56d30, rFirst=...) at core/svx/source/svdraw/svdobj.cxx:897
 #3  0x00007fffcdc4978c in SwTextBoxHelper::DoTextBoxZOrderCorrection (pShape=0x4c3a660, pObj=0x4c3d730) at core/sw/source/core/doc/textboxhelper.cxx:1638
 #4  0x00007fffcdc4bcbc in SwTextBoxHelper::changeAnchor (pShape=0x4c3a660, pObj=0x4c3d730) at core/sw/source/core/doc/textboxhelper.cxx:1247
 #5  0x00007fffcdc4e613 in SwTextBoxHelper::synchronizeGroupTextBoxProperty
     (pFunc=0x7fffcdc4bc10 <SwTextBoxHelper::changeAnchor(SwFrameFormat*, SdrObject*)>, pFormat=0x4c3a660, pObj=0x4c3d730)
     at core/sw/source/core/doc/textboxhelper.cxx:1652
 #6  0x00007fffcdd41a89 in SwDrawContact::Changed_ (this=0x4c55400, rObj=..., eType=SdrUserCallType::ChildMoveOnly, pOldBoundRect=0x7fffffff09d8)
     at core/sw/source/core/draw/dcontact.cxx:1250
 #7  0x00007fffcdd410a7 in SwDrawContact::Changed (this=0x4c55400, rObj=..., eType=SdrUserCallType::ChildMoveOnly, rOldBoundRect=...)
     at core/sw/source/core/draw/dcontact.cxx:1005
 #8  0x00007ffff14c7356 in SdrObject::SendUserCall (this=0x4c3d730, eUserCall=SdrUserCallType::MoveOnly, rBoundRect=...) at core/svx/source/svdraw/svdobj.cxx:2827
 #9  0x00007ffff14b11d8 in SdrObjCustomShape::Move (this=0x4c3d730, rSiz=Size = {...}) at core/svx/source/svdraw/svdoashp.cxx:1499
 #10 0x00007ffff152753b in SdrObjGroup::Move (this=0x1be18e0, rSiz=Size = {...}) at core/svx/source/svdraw/svdogrp.cxx:561
 #11 0x00007fffce8c80b8 in SwViewShellImp::NotifySizeChg
     (unique_ptrI7SdrMarkSt14default_deleteIS2_EESaIS5_EE11_M_allocateEm=<error reading variable: Unhandled DWARF expression opcode 0x0>, hrowE=<error reading variable: Unhandled DWARF expression opcode 0x0>) at core/sw/source/core/view/vdraw.cxx:274
 #12 0x00007fffce032bc1 in AdjustSizeChgNotify (pRoot=0x5e1c7f0) at core/sw/source/core/layout/pagechg.cxx:851
 #13 0x00007fffce03243f in SwRootFrame::CheckViewLayout (this=0x5e1c7f0, pViewOpt=0x0, pVisArea=0x0) at core/sw/source/core/layout/pagechg.cxx:2445
 #14 0x00007fffce032eec in SwPageFrame::Cut (this=0x5f19910) at core/sw/source/core/layout/pagechg.cxx:921
 #15 0x00007fffce037d40 in SwRootFrame::RemovePage (this=0x5e1c7f0, pDelRef=0x7fffffff13c0, eResult=SwRemoveResult::Prev)
     at core/sw/source/core/layout/pagechg.cxx:1518
 #16 0x00007fffce03808e in SwRootFrame::RemoveSuperfluous (this=0x5e1c7f0) at core/sw/source/core/layout/pagechg.cxx:1557
 #17 0x00007fffcdfe8d04 in SwLayAction::InternalAction (this=0x7fffffff1a30, pRenderContext=0x5211510) at core/sw/source/core/layout/layact.cxx:694
 #18 0x00007fffcdfe7cc6 in SwLayAction::Action (this=0x7fffffff1a30, pRenderContext=0x5211510) at core/sw/source/core/layout/layact.cxx:396
 #19 0x00007fffce8d5995 in SwViewShell::CalcLayout (this=0x521c540) at core/sw/source/core/view/viewsh.cxx:1197
 #20 0x00007fffcde1233f in SwEditShell::CalcLayout (this=0x521c540) at core/sw/source/core/edit/edws.cxx:111

Change-Id: I66ffbbfc74e52eea2e24e486d52607e84ffb8fcb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178415
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <[email protected]>
(cherry picked from commit 71a9de6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178544
Tested-by: Jenkins CollaboraOffice <[email protected]>
Reviewed-by: Miklos Vajna <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Dec 18, 2024
on loading tdf97831-15.xlsx

 #0  0x00007fffebea8664 in __pthread_kill_implementation () at /lib64/libc.so.6
 #1  0x00007fffebe4fc4e in raise () at /lib64/libc.so.6
 #2  0x00007fffebe37902 in abort () at /lib64/libc.so.6
 #3  0x00007fffebaa84e9 in __gnu_debug::_Error_formatter::_M_error() const [clone .cold] () at /lib64/libstdc++.so.6
 #4  0x00007fffa8d75183 in __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<unsigned int const*, std::__cxx1998::vector<unsigned int, std::allocator<unsigned int> > >, std::__debug::vector<unsigned int, std::allocator<unsigned int> >, std::forward_iterator_tag>::operator++ (this=0x7fffffff9360) at /usr/include/c++/14/debug/safe_iterator.h:392
 #5  0x00007fffa8d73da2 in __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<unsigned int const*, std::__cxx1998::vector<unsigned int, std::allocator<unsigned int> > >, std::__debug::vector<unsigned int, std::allocator<unsigned int> >, std::bidirectional_iterator_tag>::operator++ (this=0x7fffffff9360) at /usr/include/c++/14/debug/safe_iterator.h:679
 #6  0x00007fffa8d71fd2 in __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<unsigned int const*, std::__cxx1998::vector<unsigned int, std::allocator<unsigned int> > >, std::__debug::vector<unsigned int, std::allocator<unsigned int> >, std::random_access_iterator_tag>::operator++ (this=0x7fffffff9360) at /usr/include/c++/14/debug/safe_iterator.h:849
 #7  0x00007fffa90d204e in ScDocument::GetCondResult (this=0x18fbcb0, rCell=..., rPos=..., rList=..., rIndex=...) at co-24.04/sc/source/core/data/documen4.cxx:816
 #8  0x00007fffa90d1ea1 in ScDocument::GetCondResult (this=0x18fbcb0, nCol=7, nRow=1, nTab=0, pCell=0x7fffffff9420) at co-24.04/sc/source/core/data/documen4.cxx:809
 #9  0x00007fffa8f2740d in ScColumn::GetNeededSize
     (this=0x7fffd000b4d0, nRow=1, pDev=0x1fa6690, nPPTX=0.064757526036325508, nPPTY=0.067000000000000004, rZoomX=..., rZoomY=..., bWidth=false, rOptions=..., ppPatternChange=0x7fffffff9ba8, bInPrintTwips=false) at co-24.04/sc/source/core/data/column2.cxx:139
 #10 0x00007fffa8f2b887 in ScColumn::GetOptimalHeight (this=0x7fffd000b4d0, rCxt=..., nStartRow=0, nEndRow=24, nMinHeight=256, nMinStart=0)
     at co-24.04/sc/source/core/data/column2.cxx:1084
 #11 0x00007fffa94a28b7 in (anonymous namespace)::GetOptimalHeightsInColumn (rCxt=..., rCol=..., nStartRow=0, nEndRow=24, pProgress=0x0, nProgressStart=0)
     at co-24.04/sc/source/core/data/table1.cxx:120
 #12 0x00007fffa94a47f2 in ScTable::SetOptimalHeight (this=0x1f584a0, rCxt=..., nSt

where things go wrong earlier with:

 #2  0x00007fffacd716c3 in std::__new_allocator<unsigned int>::deallocate (this=0x7fff9c1d2030, __p=0x7fff9c37acf0, __n=1) at /usr/include/c++/14/bits/new_allocator.h:172
 #3  0x00007fffacd65215 in std::allocator<unsigned int>::deallocate (this=0x7fff9c1d2030, __p=0x7fff9c37acf0, __n=1) at /usr/include/c++/14/bits/allocator.h:208
 #4  std::allocator_traits<std::allocator<unsigned int> >::deallocate (__a=..., __p=0x7fff9c37acf0, __n=1) at /usr/include/c++/14/bits/alloc_traits.h:513
 #5  std::__cxx1998::_Vector_base<unsigned int, std::allocator<unsigned int> >::_M_deallocate (this=0x7fff9c1d2030, __p=0x7fff9c37acf0, __n=1) at /usr/include/c++/14/bits/stl_vector.h:389
 #6  0x00007fffacd60b88 in std::__cxx1998::_Vector_base<unsigned int, std::allocator<unsigned int> >::~_Vector_base (this=0x7fff9c1d2030, __in_chrg=<optimized out>)
     at /usr/include/c++/14/bits/stl_vector.h:368
 #7  0x00007fffacd60bef in std::__cxx1998::vector<unsigned int, std::allocator<unsigned int> >::~vector (this=0x7fff9c1d2030, __in_chrg=<optimized out>)
     at /usr/include/c++/14/bits/stl_vector.h:738
 #8  0x00007fffacd5ecd6 in std::__debug::vector<unsigned int, std::allocator<unsigned int> >::~vector (this=0x7fff9c1d2018, __in_chrg=<optimized out>) at /usr/include/c++/14/debug/vector:245
 #9  0x00007fffacd5feb6 in o3tl::sorted_vector<unsigned int, std::less<unsigned int>, o3tl::find_unique, true>::~sorted_vector (this=0x7fff9c1d2018, __in_chrg=<optimized out>)
     at co-24.04/include/o3tl/sorted_vector.hxx:39
 #10 0x00007fffacd7a71c in ScCondFormatItem::~ScCondFormatItem (this=0x7fff9c1d2000, __in_chrg=<optimized out>) at co-24.04/sc/source/core/data/attrib.cxx:722
 #11 0x00007fffacd7a748 in ScCondFormatItem::~ScCondFormatItem (this=0x7fff9c1d2000, __in_chrg=<optimized out>) at co-24.04/sc/source/core/data/attrib.cxx:722
 #12 0x00007fffef638513 in implCleanupItemEntry (rPool=..., pSource=0x7fff9c1d2000) at co-24.04/svl/source/items/itemset.cxx:473
 #13 0x00007fffef638e00 in SfxItemSet::ClearAllItemsImpl (this=0x7fffffff8d38) at co-24.04/svl/source/items/itemset.cxx:643
 #14 0x00007fffef638a02 in SfxItemSet::~SfxItemSet (this=0x7fffffff8d38, __in_chrg=<optimized out>) at co-24.04/svl/source/items/itemset.cxx:562
 #15 0x00007fffacd5f7d0 in SfxSetItem::~SfxSetItem (this=0x7fffffff8d20, __in_chrg=<optimized out>) at co-24.04/include/svl/setitem.hxx:27
 #16 0x00007fffacd5f88e in ScPatternAttr::~ScPatternAttr (this=0x7fffffff8d20, __in_chrg=<optimized out>) at co-24.04/sc/inc/patattr.hxx:54
 #17 0x00007fffaceab497 in ScColumn::ApplyAttr (this=0x7fff9c027960, nRow=1, rAttr=...) at co-24.04/sc/source/core/data/column.cxx:573
 #18 0x00007fffacf38508 in ScColumn::SetNumberFormat (this=0x7fff9c027960, nRow=1, nNumberFormat=99) at co-24.04/sc/source/core/data/column2.cxx:3302
 #19 0x00007fffad4c3b55 in ScTable::SetNumberFormat (this=0x1d93840, nCol=7, nRow=1, nNumberFormat=99) at co-24.04/sc/source/core/data/table2.cxx:2315
 #20 0x00007fffad114bfa in ScDocument::SetNumberFormat (this=0x1c74100, rPos=..., nNumberFormat=99) at co-24.04/sc/source/core/data/document.cxx:3727
 #21 0x00007fffad356c65 in ScFormulaCell::InterpretTail (this=0x1cf9800, rContext=..., eTailParam=ScFormulaCell::SCITP_NORMAL)
     at co-24.04/sc/source/core/data/formulacell.cxx:2157
 #22 0x00007fffad354e67 in ScFormulaCell::Interpret (this=0x1cf9800, nStartOffset=-1, nEndOffset=-1) at co-24.04/sc/source/core/data/formulacell.cxx:1619
 #23 0x00007fffacf8e59f in ScFormulaCell::MaybeInterpret (this=0x1cf9800) at co-24.04/sc/inc/formulacell.hxx:470
 #24 0x00007fffad358dd4 in ScFormulaCell::IsValue (this=0x1cf9800) at co-24.04/sc/source/core/data/formulacell.cxx:2762
 #25 0x00007fffad025e1b in lcl_GetCellContent (rCell=..., bIsStr1=false, rArg=@0x7fffffff9208: 0, rArgStr="", pDoc=0x1c74100)
     at co-24.04/sc/source/core/data/conditio.cxx:764
 #26 0x00007fffad0286c5 in ScConditionEntry::IsCellValid (this=0x7fff9c1c73f0, rCell=..., rPos=...) at co-24.04/sc/source/core/data/conditio.cxx:1263
 #27 0x00007fffad02b18c in ScConditionalFormat::GetCellStyle (this=0x7fff9c02c1d0, rCell=..., rPos=...) at co-24.04/sc/source/core/data/conditio.cxx:1863
 #28 0x00007fffad0d20f8 in ScDocument::GetCondResult (this=0x1c74100, rCell=..., rPos=..., rList=..., rIndex=...) at co-24.04/sc/source/core/data/documen4.cxx:827
 #29 0x00007fffad0d1f91 in ScDocument::GetCondResult (this=0x1c74100, nCol=7, nRow=1, nTab=0, pCell=0x7fffffff9420) at co-24.04/sc/source/core/data/documen4.cxx:809

very probably this is a problem since ItemSet rework of:

commit 2b4cb63
CommitDate: Tue Nov 21 16:08:57 2023 +0100

    Cleanup some ScPatternAttr specific stuff

or similar of that sequence, and likely fixed in upstream later by:

Author:     Armin Le Grand (allotropia) <[email protected]>
CommitDate: Thu Dec 28 19:38:15 2023 +0100

    Decouple ScPatternAttr from SfxItemPool

but that's a very sizable rework, so here apply a conservative simpler
workaround to avoid the crash.

Change-Id: I309953015d39bce4796a2cf99666603b00c34d24
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178579
Reviewed-by: Andras Timar <[email protected]>
Tested-by: Jenkins CollaboraOffice <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Dec 19, 2024
possibly after uno.HideSlide

 #0  0x00007e697b8c0b97 in SdPage::GetPageInfo (this=this@entry=0x0, jsonWriter=...)
     at sd/source/core/sdpage.cxx:1751
 #1  0x00007e697bbda0ab in SdXImpressDocument::getPartInfo (this=<optimized out>, nPart=<optimized out>)
     at sd/source/ui/unoidl/unomodel.cxx:3692
 #2  0x00007e698ae7e078 in doc_getPartInfo (pThis=0x121017c0, nPart=9)
     at desktop/source/lib/init.cxx:4176
 #3  0x000000000059bcf4 in LOKitHelper::getPartData (part=9, loKitDocument=0x121017c0) at kit/KitHelper.hpp:47
 #4  LOKitHelper::fetchPartsData (loKitDocument=0x121017c0, resultInfo=std::unordered_map with 6 elements = {...}, partsCount=84, mode=@0x7ffec727bd58: 1)
     at kit/KitHelper.hpp:91
 #5  0x000000000059c6a3 in LOKitHelper::documentStatus (loKitDocument=0x121017c0) at kit/KitHelper.hpp:164
 #6  0x000000000057fb7a in ChildSession::selectClientPart (this=0x556fe60, tokens=...) at kit/ChildSession.cpp:2964
 #7  0x000000000058a88f in ChildSession::_handleInput (this=<optimized out>, buffer=<optimized out>, length=<optimized out>) at kit/ChildSession.cpp:495
 #8  0x000000000061c63f in Session::handleMessage (this=0x556fe60, data=std::vector of length 29, capacity 29 = {...})

Change-Id: Ib4e532b31cdc6a69f9e54317699f426c12de35d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177781
Reviewed-by: Miklos Vajna <[email protected]>
Tested-by: Jenkins CollaboraOffice <[email protected]>
(cherry picked from commit 03156b7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178788
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Dec 25, 2024
Instead of deleting the QDialog owned by the
QtInstanceDialog in the QtInstanceDialog dtor
right away by calling std::unique_ptr<QDialog>::reset,
instead mark the object for deletion by calling
QObject::deleteLater [1] on the dialog object, which schedules
the object for deletion when control returns to the event
loop.

Also switch QtInstanceDialog::m_pDialog from a unique_ptr
to a plain QDialog*.

This fixes crashes seen with the current qtbase git dev branch
after qtbase commit

    commit 84a5f50c7766c99f62b22bb4388137e0aa8dd13d
    Author: Shawn Rutledge <[email protected]>
    Date:   Tue Nov 12 10:04:31 2024 +0100

        Move QContextMenuEvent synthesis from QWidgetWindow to QWindow

The crash was quite reproducible for me by running LO with the qt6 VCL
plugin and SAL_VCL_QT_USE_WELDED_WIDGETS=1 (to enable use of
native Qt widgets), opening the "Help" -> "About LibreOfficeDev"
dialog and closing it by clicking the "Close" button with the
left mouse button.

Backtrace of the crash:

    (rr) bt
    #0  0x0000000000000000 in ??? ()
    #1  0x000019667a96b92f in QWidgetWindow::handleMouseEvent (this=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:675
    #2  0x000019667a96a145 in QWidgetWindow::event (this=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:292
    #3  0x000019667a86fe10 in QApplicationPrivate::notify_helper (this=0x56488e07aae0, receiver=0x5648961bd080, e=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3304
    #4  0x000019667a873d2d in QApplication::notify (this=0x56488e067420, receiver=0x5648961bd080, e=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3254
    #5  0x00006f736e25acc9 in QCoreApplication::notifyInternal2 (receiver=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1122
    #6  0x00006f736e25bb39 in QCoreApplication::sendSpontaneousEvent (receiver=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1578
    #7  0x0000555757871f72 in QGuiApplicationPrivate::processMouseEvent (e=0x5f6d64003360) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qguiapplication.cpp:2485
    #8  0x0000555757871136 in QGuiApplicationPrivate::processWindowSystemEvent (e=0x5f6d64003360) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qguiapplication.cpp:2212
    #9  0x0000555757958a4d in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:1113
    #10 0x00005557579588fe in QWindowSystemInterface::flushWindowSystemEvents (flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:1082
    #11 0x0000393946e55875 in QtWaylandClient::QWaylandDisplay::flushRequests (this=0x56488e0ca590) at /home/michi/development/git/qt5/qtwayland/src/client/qwaylanddisplay.cpp:524
    #12 0x0000393946e5a946 in QtWaylandClient::QWaylandDisplay::qt_static_metacall (_o=0x56488e0ca590, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0x7ffe9cb172a0)
        at qtwayland/src/client/WaylandClient_autogen/include/moc_qwaylanddisplay_p.cpp:95
    #13 0x00006f736e331954 in doActivate<false> (sender=0x56488e06c0e0, signal_index=4, argv=0x7ffe9cb172a0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4151
    #14 0x00006f736e3273e3 in QMetaObject::activate (sender=0x56488e06c0e0, m=0x6f736ec1ec68 <QAbstractEventDispatcher::staticMetaObject>, local_signal_index=1, argv=0x0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4199
    #15 0x00006f736e243c79 in QAbstractEventDispatcher::awake (this=0x56488e06c0e0) at qtbase/src/corelib/Core_autogen/include/moc_qabstracteventdispatcher.cpp:129
    #16 0x00006f736e84d1e8 in QEventDispatcherGlib::processEvents (this=0x56488e06c0e0, flags=...) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:406
    #17 0x0000555758154088 in QPAEventDispatcherGlib::processEvents (this=0x56488e06c0e0, flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/platform/unix/qeventdispatcher_glib.cpp:89
    #18 0x00006a0d3b6d9b82 in QtInstance::ImplYield (this=0x56488e111bf0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:464
    #19 0x00006a0d3b6dcc01 in QtInstance::DoYield (this=0x56488e111bf0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:475
    #20 0x00005abe4e4b26e6 in ImplYield (i_bWait=true, i_bAllEvents=false) at vcl/source/app/svapp.cxx:385
    #21 0x00005abe4e4b207f in Application::Yield () at vcl/source/app/svapp.cxx:473
    #22 0x00005abe4e4b1e60 in Application::Execute () at vcl/source/app/svapp.cxx:360
    #23 0x00004759668eccab in desktop::Desktop::Main (this=0x7ffe9cb18ec8) at desktop/source/app/app.cxx:1679
    #24 0x00005abe4e4d3bc6 in ImplSVMain () at vcl/source/app/svmain.cxx:230
    #25 0x00005abe4e4d57b9 in SVMain () at vcl/source/app/svmain.cxx:248
    #26 0x00004759669665da in soffice_main () at desktop/source/app/sofficemain.cxx:121
    #27 0x000056486abf0a6d in sal_main () at /home/michi/development/git/libreoffice/desktop/source/app/main.c:51
    #28 0x000056486abf0a47 in main (argc=1, argv=0x7ffe9cb190d8) at /home/michi/development/git/libreoffice/desktop/source/app/main.c:49

The segfault happens when calling

    d->maybeSynthesizeContextMenuEvent(event);

, i.e the virtual QWindowPrivate::maybeSynthesizeContextMenuEvent.
This is because the QWidgetWindow object and its QWidgetPrivate
have already been deleted when processing an earlier event
triggered by the mouse click, see backtrace below.

Not deleting the object right away but marking it for deletion later
makes sure the object is still valid when the event gets processed,
and then deleted afterwards.

Backtrace of how the QWindowPrivate object got deleted earlier
(reverse-debugged with rr) - see frame 17 for the dtor (i.e. the
code that was adjusted in this commit now to fix the problem):

    Thread 1 hit Breakpoint 1.1, QWindowPrivate::~QWindowPrivate (this=0x564896397450) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindow.cpp:211
    211     QWindowPrivate::~QWindowPrivate()
    (rr) p this
    $6 = (QWindowPrivate *) 0x564896397450
    (rr) bt
    #0  QWindowPrivate::~QWindowPrivate (this=0x564896397450) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindow.cpp:211
    #1  0x000019667a96f039 in QWidgetWindowPrivate::~QWidgetWindowPrivate (this=0x564896397450) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:34
    #2  0x000019667a96f05d in QWidgetWindowPrivate::~QWidgetWindowPrivate (this=0x564896397450) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:34
    #3  0x00006f736e33a7e8 in QScopedPointerDeleter<QObjectData>::cleanup (pointer=0x564896397450) at qtbase/src/corelib/tools/qscopedpointer.h:24
    #4  0x00006f736e32e134 in QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> >::~QScopedPointer (this=0x5648961bd088) at qtbase/src/corelib/tools/qscopedpointer.h:81
    #5  0x00006f736e31cdb2 in QObject::~QObject (this=0x5648961bd080) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:1149
    #6  0x00005557579435ec in QWindow::~QWindow (this=0x5648961bd080) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindow.cpp:206
    #7  0x000019667a969be6 in QWidgetWindow::~QWidgetWindow (this=0x5648961bd080) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:179
    #8  0x000019667a969c2d in QWidgetWindow::~QWidgetWindow (this=0x5648961bd080) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:160
    #9  0x000019667a915351 in QWidgetPrivate::deleteTLSysExtra (this=0x564894d40bf0) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:1711
    #10 0x000019667a914f86 in QWidget::destroy (this=0x56488f3e8100, destroyWindow=true, destroySubWindows=true) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:12612
    #11 0x000019667a914504 in QWidget::~QWidget (this=0x56488f3e8100) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:1565
    #12 0x000019667ad11705 in QDialog::~QDialog (this=0x56488f3e8100) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qdialog.cpp:394
    #13 0x000019667ad1174d in QDialog::~QDialog (this=0x56488f3e8100) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qdialog.cpp:386
    #14 0x00006a0d3b71e358 in std::default_delete<QDialog>::operator() (this=0x5648963f9fb0, __ptr=0x56488f3e8100) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:93
    #15 0x00006a0d3b71e478 in std::__uniq_ptr_impl<QDialog, std::default_delete<QDialog> >::reset (this=0x5648963f9fb0, __p=0x0) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:205
    #16 0x00006a0d3b71e40d in std::unique_ptr<QDialog, std::default_delete<QDialog> >::reset (this=0x5648963f9fb0, __p=0x0) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:504
    #17 0x00006a0d3b71b550 in QtInstanceDialog::~QtInstanceDialog()::$_0::operator()() const (this=0x7ffe9cb13630) at vcl/qt6/../qt5/QtInstanceDialog.cxx:30
    #18 0x00006a0d3b71b525 in std::__invoke_impl<void, QtInstanceDialog::~QtInstanceDialog()::$_0&>(std::__invoke_other, QtInstanceDialog::~QtInstanceDialog()::$_0&) (__f=...)
        at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/invoke.h:61
    #19 0x00006a0d3b71b4d5 in std::__invoke_r<void, QtInstanceDialog::~QtInstanceDialog()::$_0&>(QtInstanceDialog::~QtInstanceDialog()::$_0&) (__fn=...) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/invoke.h:111
    #20 0x00006a0d3b71b3fd in std::_Function_handler<void(), QtInstanceDialog::~QtInstanceDialog()::$_0>::_M_invoke (__functor=...) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/std_function.h:290
    #21 0x00006a0d3b6e278e in std::function<void()>::operator() (this=0x7ffe9cb13630) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/std_function.h:591
    #22 0x00006a0d3b6da31a in QtInstance::RunInMainThread (this=0x56488e111bf0, func=...) at vcl/qt6/../qt5/QtInstance.cxx:226
    #23 0x00006a0d3b71947b in QtInstanceDialog::~QtInstanceDialog (this=0x5648963f9f90, vtt=0x6a0d3b98fec8 <VTT for QtInstanceDialog>) at vcl/qt6/../qt5/QtInstanceDialog.cxx:30
    #24 0x00006a0d3b7195a0 in QtInstanceDialog::~QtInstanceDialog (this=0x5648963f9f90) at vcl/qt6/../qt5/QtInstanceDialog.cxx:28
    #25 0x00006a0d3b7196a9 in QtInstanceDialog::~QtInstanceDialog (this=0x5648963f9f90) at vcl/qt6/../qt5/QtInstanceDialog.cxx:28
    #26 0x00005abe4e4746f8 in std::default_delete<weld::Dialog>::operator() (this=0x564896171890, __ptr=0x5648963fa1f8) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:93
    #27 0x00005abe4e4faefd in std::_Sp_counted_deleter<weld::Dialog*, std::default_delete<weld::Dialog>, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0x564896171880)
        at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:527
    #28 0x00005abe4da1978a in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x564896171880) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:346
    #29 0x00005abe4da19706 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x5648961a7cb8) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:1069
    #30 0x00005abe4db3d6e9 in std::__shared_ptr<weld::Dialog, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x5648961a7cb0) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:1525
    #31 0x00005abe4db2e905 in std::shared_ptr<weld::Dialog>::~shared_ptr (this=0x5648961a7cb0) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr.h:175
    #32 0x00005abe4e4f6a7b in weld::GenericDialogController::~GenericDialogController (this=0x5648961a7c90) at vcl/source/app/weldutils.cxx:58
    #33 0x000000444e3b8ce9 in AboutDialog::~AboutDialog (this=0x5648961a7c90) at cui/source/dialogs/about.cxx:142
    #34 0x000000444e5787b6 in std::destroy_at<AboutDialog> (__location=0x5648961a7c90) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/stl_construct.h:88
    #35 0x000000444e578795 in std::_Destroy<AboutDialog> (__pointer=0x5648961a7c90) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/stl_construct.h:149
    #36 0x000000444e57862f in std::allocator_traits<std::allocator<void> >::destroy<AboutDialog> (__p=0x5648961a7c90) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/alloc_traits.h:708
    #37 std::_Sp_counted_ptr_inplace<AboutDialog, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0x5648961a7c80) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:616
    #38 0x00006a0d3b661e5a in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use (this=0x5648961a7c80) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:175
    #39 0x00006a0d3b661e35 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use_cold (this=0x5648961a7c80) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:199
    #40 0x00006a0d3b661e11 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x5648961a7c80) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:353
    #41 0x00006a0d3b661cf6 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x7ffe9cb13a30) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:1069
    #42 0x00006a0d3b71ea39 in std::__shared_ptr<weld::DialogController, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x7ffe9cb13a28) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:1525
    #43 0x00006a0d3b71da14 in std::__shared_ptr<weld::DialogController, (__gnu_cxx::_Lock_policy)2>::reset (this=0x7ffe9cb13ae8) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:1643
    #44 0x00006a0d3b71ae1c in QtInstanceDialog::dialogFinished (this=0x5648963f9f90, nResult=7) at vcl/qt6/../qt5/QtInstanceDialog.cxx:198
    #45 0x00006a0d3b71e9a6 in QtPrivate::FunctorCall<std::integer_sequence<unsigned long, 0ul>, QtPrivate::List<int>, void, void (QtInstanceDialog::*)(int)>::call(void (QtInstanceDialog::*)(int), QtInstanceDialog*, void**)::{lambda()#1}::operator()() const (this=0x7ffe9cb13bd0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:127
    #46 0x00006a0d3b71e8c9 in QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<std::integer_sequence<unsigned long, 0ul>, QtPrivate::List<int>, void, void (QtInstanceDialog::*)(int)>::call(void (QtInstanceDialog::*)(int), QtInstanceDialog*, void**)::{lambda()#1}>(void**, QtPrivate::FunctorCall<std::integer_sequence<unsigned long, 0ul>, QtPrivate::List<int>, void, void (QtInstanceDialog::*)(int)>::call(void (QtInstanceDialog::*)(int), QtInstanceDialog*, void**)::{lambda()#1}&&) (args=0x7ffe9cb13fa0, fn=...) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:65
    #47 0x00006a0d3b71e803 in QtPrivate::FunctorCall<std::integer_sequence<unsigned long, 0ul>, QtPrivate::List<int>, void, void (QtInstanceDialog::*)(int)>::call
        (f=&virtual QtInstanceDialog::dialogFinished(int), o=0x5648963f9f90, arg=0x7ffe9cb13fa0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:126
    #48 0x00006a0d3b71e77d in QtPrivate::FunctionPointer<void (QtInstanceDialog::*)(int)>::call<QtPrivate::List<int>, void> (f=&virtual QtInstanceDialog::dialogFinished(int), o=0x5648963f9f90, arg=0x7ffe9cb13fa0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:174
    #49 0x00006a0d3b71e6a6 in QtPrivate::QCallableObject<void (QtInstanceDialog::*)(int), QtPrivate::List<int>, void>::impl (which=1, this_=0x5648961544d0, r=0x5648963f9f90, a=0x7ffe9cb13fa0, ret=0x0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:545
    #50 0x00006f736e271f82 in QtPrivate::QSlotObjectBase::call (this=0x5648961544d0, r=0x5648963f9f90, a=0x7ffe9cb13fa0) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:461
    #51 0x00006f736e331854 in doActivate<false> (sender=0x56488f3e8100, signal_index=7, argv=0x7ffe9cb13fa0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4139
    #52 0x00006f736e3273e3 in QMetaObject::activate (sender=0x56488f3e8100, m=0x19667b4289a8 <QDialog::staticMetaObject>, local_signal_index=0, argv=0x7ffe9cb13fa0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4199
    #53 0x000019667a86520b in QMetaObject::activate<void, int> (sender=0x56488f3e8100, mo=0x19667b4289a8 <QDialog::staticMetaObject>, local_signal_index=0, ret=0x0, args=@0x7ffe9cb13fe4: 7) at qtbase/src/corelib/kernel/qobjectdefs.h:306
    #54 0x000019667ad11f28 in QDialog::finished (this=0x56488f3e8100, _t1=7) at qtbase/src/widgets/Widgets_autogen/include/moc_qdialog.cpp:191
    #55 0x000019667ad11e55 in QDialog::done (this=0x56488f3e8100, r=7) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qdialog.cpp:617
    #56 0x00006a0d3b71b173 in QtInstanceDialog::handleButtonClick (rDialog=..., rButton=...) at vcl/qt6/../qt5/QtInstanceDialog.cxx:226
    #57 0x00006a0d3b658b0c in QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0::operator()() const (this=0x5648961351a0)
        at vcl/qt6/../qt5/QtBuilder.cxx:528
    #58 0x00006a0d3b658ae8 in QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_v--Type <RET> for more, q to quit, c to continue without paging--
    iew<char, std::char_traits<char> >)::$_0>::call(QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0&, void**)::{lambda()#1}::operator()() const (this=0x7ffe9cb14370) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:116
    #59 0x00006a0d3b658ac9 in QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0>::call(QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0&, void**)::{lambda()#1}>(void**, QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0>::call(QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0&, void**)::{lambda()#1}&&) (args=0x7ffe9cb146d0, fn=...) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:65
    #60 0x00006a0d3b658a92 in QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0>::call(QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0&, void**)
        (f=..., arg=0x7ffe9cb146d0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:115
    #61 0x00006a0d3b658a41 in QtPrivate::FunctorCallable<QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0>::call<QtPrivate::List<>, void>(QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0&, void*, void**) (f=..., arg=0x7ffe9cb146d0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:337
    #62 0x00006a0d3b6589e8 in QtPrivate::QCallableObject<QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x564896135190, r=0x56488f3e8100, a=0x7ffe9cb146d0, ret=0x0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:547
    #63 0x00006f736e271f82 in QtPrivate::QSlotObjectBase::call (this=0x564896135190, r=0x56488f3e8100, a=0x7ffe9cb146d0) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:461
    #64 0x00006f736e331854 in doActivate<false> (sender=0x56489581c360, signal_index=9, argv=0x7ffe9cb146d0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4139
    #65 0x00006f736e3273e3 in QMetaObject::activate (sender=0x56489581c360, m=0x19667b414930 <QAbstractButton::staticMetaObject>, local_signal_index=2, argv=0x7ffe9cb146d0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4199
    #66 0x000019667a86538b in QMetaObject::activate<void, bool> (sender=0x56489581c360, mo=0x19667b414930 <QAbstractButton::staticMetaObject>, local_signal_index=2, ret=0x0, args=@0x7ffe9cb14717: false)
        at qtbase/src/corelib/kernel/qobjectdefs.h:306
    #67 0x000019667aab4f52 in QAbstractButton::clicked (this=0x56489581c360, _t1=false) at qtbase/src/widgets/Widgets_autogen/include/moc_qabstractbutton.cpp:253
    #68 0x000019667aab4e67 in QAbstractButtonPrivate::emitClicked (this=0x564893f024d0) at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qabstractbutton.cpp:381
    #69 0x000019667aab4cc1 in QAbstractButtonPrivate::click (this=0x564893f024d0) at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qabstractbutton.cpp:374
    #70 0x000019667aab616f in QAbstractButton::mouseReleaseEvent (this=0x56489581c360, e=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qabstractbutton.cpp:976
    #71 0x000019667a92c6fd in QWidget::event (this=0x56489581c360, event=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:8971
    #72 0x000019667aab5f8c in QAbstractButton::event (this=0x56489581c360, e=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qabstractbutton.cpp:933
    #73 0x000019667ac2dfb1 in QPushButton::event (this=0x56489581c360, e=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qpushbutton.cpp:684
    #74 0x000019667a86fe10 in QApplicationPrivate::notify_helper (this=0x56488e07aae0, receiver=0x56489581c360, e=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3304
    #75 0x000019667a871ae2 in QApplication::notify (this=0x56488e067420, receiver=0x56489581c360, e=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:2781
    #76 0x00006f736e25acc9 in QCoreApplication::notifyInternal2 (receiver=0x56489581c360, event=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1122
    #77 0x00006f736e25bb39 in QCoreApplication::sendSpontaneousEvent (receiver=0x56489581c360, event=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1578
    #78 0x000019667a870737 in QApplicationPrivate::sendMouseEvent
        (receiver=0x56489581c360, event=0x7ffe9cb15ad0, alienWidget=0x56489581c360, nativeWidget=0x56488f3e8100, buttonDown=0x19667b45b488 <qt_button_down>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false)
        at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:2362
    #79 0x000019667a96b8bb in QWidgetWindow::handleMouseEvent (this=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:664
    #80 0x000019667a96a145 in QWidgetWindow::event (this=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:292
    #81 0x000019667a86fe10 in QApplicationPrivate::notify_helper (this=0x56488e07aae0, receiver=0x5648961bd080, e=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3304
    #82 0x000019667a873d2d in QApplication::notify (this=0x56488e067420, receiver=0x5648961bd080, e=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3254
    #83 0x00006f736e25acc9 in QCoreApplication::notifyInternal2 (receiver=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1122
    #84 0x00006f736e25bb39 in QCoreApplication::sendSpontaneousEvent (receiver=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1578
    #85 0x0000555757871f72 in QGuiApplicationPrivate::processMouseEvent (e=0x5f6d64003360) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qguiapplication.cpp:2485
    #86 0x0000555757871136 in QGuiApplicationPrivate::processWindowSystemEvent (e=0x5f6d64003360) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qguiapplication.cpp:2212
    #87 0x0000555757958a4d in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:1113
    #88 0x00005557579588fe in QWindowSystemInterface::flushWindowSystemEvents (flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:1082
    #89 0x0000393946e55875 in QtWaylandClient::QWaylandDisplay::flushRequests (this=0x56488e0ca590) at /home/michi/development/git/qt5/qtwayland/src/client/qwaylanddisplay.cpp:524
    #90 0x0000393946e5a946 in QtWaylandClient::QWaylandDisplay::qt_static_metacall (_o=0x56488e0ca590, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0x7ffe9cb172a0)
        at qtwayland/src/client/WaylandClient_autogen/include/moc_qwaylanddisplay_p.cpp:95
    #91 0x00006f736e331954 in doActivate<false> (sender=0x56488e06c0e0, signal_index=4, argv=0x7ffe9cb172a0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4151
    #92 0x00006f736e3273e3 in QMetaObject::activate (sender=0x56488e06c0e0, m=0x6f736ec1ec68 <QAbstractEventDispatcher::staticMetaObject>, local_signal_index=1, argv=0x0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4199
    #93 0x00006f736e243c79 in QAbstractEventDispatcher::awake (this=0x56488e06c0e0) at qtbase/src/corelib/Core_autogen/include/moc_qabstracteventdispatcher.cpp:129
    #94 0x00006f736e84d1e8 in QEventDispatcherGlib::processEvents (this=0x56488e06c0e0, flags=...) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:406
    #95 0x0000555758154088 in QPAEventDispatcherGlib::processEvents (this=0x56488e06c0e0, flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/platform/unix/qeventdispatcher_glib.cpp:89
    #96 0x00006a0d3b6d9b82 in QtInstance::ImplYield (this=0x56488e111bf0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:464
    #97 0x00006a0d3b6dcc01 in QtInstance::DoYield (this=0x56488e111bf0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:475
    #98 0x00005abe4e4b26e6 in ImplYield (i_bWait=true, i_bAllEvents=false) at vcl/source/app/svapp.cxx:385
    #99 0x00005abe4e4b207f in Application::Yield () at vcl/source/app/svapp.cxx:473
    #100 0x00005abe4e4b1e60 in Application::Execute () at vcl/source/app/svapp.cxx:360
    #101 0x00004759668eccab in desktop::Desktop::Main (this=0x7ffe9cb18ec8) at desktop/source/app/app.cxx:1679
    #102 0x00005abe4e4d3bc6 in ImplSVMain () at vcl/source/app/svmain.cxx:230
    #103 0x00005abe4e4d57b9 in SVMain () at vcl/source/app/svmain.cxx:248
    #104 0x00004759669665da in soffice_main () at desktop/source/app/sofficemain.cxx:121
    #105 0x000056486abf0a6d in sal_main () at /home/michi/development/git/libreoffice/desktop/source/app/main.c:51
    #106 0x000056486abf0a47 in main (argc=1, argv=0x7ffe9cb190d8) at /home/michi/development/git/libreoffice/desktop/source/app/main.c:49

[1] https://code.qt.io/cgit/qt/qtbase.git/commit/?id=84a5f50c7766c99f62b22bb4388137e0aa8dd13d

Change-Id: I3f547c1b1c1581d2f3ae092f2034d930640b0f48
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179312
Reviewed-by: Michael Weghorn <[email protected]>
Tested-by: Jenkins
tdf-gerrit pushed a commit that referenced this pull request Dec 26, 2024
Instead of deleting the QDialog owned by the
QtInstanceDialog in the QtInstanceDialog dtor
right away by calling std::unique_ptr<QDialog>::reset,
instead mark the object for deletion by calling
QObject::deleteLater [1] on the dialog object, which schedules
the object for deletion when control returns to the event
loop.

Also switch QtInstanceDialog::m_pDialog from a unique_ptr
to a plain QDialog*.

This fixes crashes seen with the current qtbase git dev branch
after qtbase commit

    commit 84a5f50c7766c99f62b22bb4388137e0aa8dd13d
    Author: Shawn Rutledge <[email protected]>
    Date:   Tue Nov 12 10:04:31 2024 +0100

        Move QContextMenuEvent synthesis from QWidgetWindow to QWindow

The crash was quite reproducible for me by running LO with the qt6 VCL
plugin and SAL_VCL_QT_USE_WELDED_WIDGETS=1 (to enable use of
native Qt widgets), opening the "Help" -> "About LibreOfficeDev"
dialog and closing it by clicking the "Close" button with the
left mouse button.

Backtrace of the crash:

    (rr) bt
    #0  0x0000000000000000 in ??? ()
    #1  0x000019667a96b92f in QWidgetWindow::handleMouseEvent (this=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:675
    #2  0x000019667a96a145 in QWidgetWindow::event (this=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:292
    #3  0x000019667a86fe10 in QApplicationPrivate::notify_helper (this=0x56488e07aae0, receiver=0x5648961bd080, e=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3304
    #4  0x000019667a873d2d in QApplication::notify (this=0x56488e067420, receiver=0x5648961bd080, e=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3254
    #5  0x00006f736e25acc9 in QCoreApplication::notifyInternal2 (receiver=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1122
    #6  0x00006f736e25bb39 in QCoreApplication::sendSpontaneousEvent (receiver=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1578
    #7  0x0000555757871f72 in QGuiApplicationPrivate::processMouseEvent (e=0x5f6d64003360) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qguiapplication.cpp:2485
    #8  0x0000555757871136 in QGuiApplicationPrivate::processWindowSystemEvent (e=0x5f6d64003360) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qguiapplication.cpp:2212
    #9  0x0000555757958a4d in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:1113
    #10 0x00005557579588fe in QWindowSystemInterface::flushWindowSystemEvents (flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:1082
    #11 0x0000393946e55875 in QtWaylandClient::QWaylandDisplay::flushRequests (this=0x56488e0ca590) at /home/michi/development/git/qt5/qtwayland/src/client/qwaylanddisplay.cpp:524
    #12 0x0000393946e5a946 in QtWaylandClient::QWaylandDisplay::qt_static_metacall (_o=0x56488e0ca590, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0x7ffe9cb172a0)
        at qtwayland/src/client/WaylandClient_autogen/include/moc_qwaylanddisplay_p.cpp:95
    #13 0x00006f736e331954 in doActivate<false> (sender=0x56488e06c0e0, signal_index=4, argv=0x7ffe9cb172a0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4151
    #14 0x00006f736e3273e3 in QMetaObject::activate (sender=0x56488e06c0e0, m=0x6f736ec1ec68 <QAbstractEventDispatcher::staticMetaObject>, local_signal_index=1, argv=0x0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4199
    #15 0x00006f736e243c79 in QAbstractEventDispatcher::awake (this=0x56488e06c0e0) at qtbase/src/corelib/Core_autogen/include/moc_qabstracteventdispatcher.cpp:129
    #16 0x00006f736e84d1e8 in QEventDispatcherGlib::processEvents (this=0x56488e06c0e0, flags=...) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:406
    #17 0x0000555758154088 in QPAEventDispatcherGlib::processEvents (this=0x56488e06c0e0, flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/platform/unix/qeventdispatcher_glib.cpp:89
    #18 0x00006a0d3b6d9b82 in QtInstance::ImplYield (this=0x56488e111bf0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:464
    #19 0x00006a0d3b6dcc01 in QtInstance::DoYield (this=0x56488e111bf0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:475
    #20 0x00005abe4e4b26e6 in ImplYield (i_bWait=true, i_bAllEvents=false) at vcl/source/app/svapp.cxx:385
    #21 0x00005abe4e4b207f in Application::Yield () at vcl/source/app/svapp.cxx:473
    #22 0x00005abe4e4b1e60 in Application::Execute () at vcl/source/app/svapp.cxx:360
    #23 0x00004759668eccab in desktop::Desktop::Main (this=0x7ffe9cb18ec8) at desktop/source/app/app.cxx:1679
    #24 0x00005abe4e4d3bc6 in ImplSVMain () at vcl/source/app/svmain.cxx:230
    #25 0x00005abe4e4d57b9 in SVMain () at vcl/source/app/svmain.cxx:248
    #26 0x00004759669665da in soffice_main () at desktop/source/app/sofficemain.cxx:121
    #27 0x000056486abf0a6d in sal_main () at /home/michi/development/git/libreoffice/desktop/source/app/main.c:51
    #28 0x000056486abf0a47 in main (argc=1, argv=0x7ffe9cb190d8) at /home/michi/development/git/libreoffice/desktop/source/app/main.c:49

The segfault happens when calling

    d->maybeSynthesizeContextMenuEvent(event);

, i.e the virtual QWindowPrivate::maybeSynthesizeContextMenuEvent.
This is because the QWidgetWindow object and its QWidgetPrivate
have already been deleted when processing an earlier event
triggered by the mouse click, see backtrace below.

Not deleting the object right away but marking it for deletion later
makes sure the object is still valid when the event gets processed,
and then deleted afterwards.

Backtrace of how the QWindowPrivate object got deleted earlier
(reverse-debugged with rr) - see frame 17 for the dtor (i.e. the
code that was adjusted in this commit now to fix the problem):

    Thread 1 hit Breakpoint 1.1, QWindowPrivate::~QWindowPrivate (this=0x564896397450) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindow.cpp:211
    211     QWindowPrivate::~QWindowPrivate()
    (rr) p this
    $6 = (QWindowPrivate *) 0x564896397450
    (rr) bt
    #0  QWindowPrivate::~QWindowPrivate (this=0x564896397450) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindow.cpp:211
    #1  0x000019667a96f039 in QWidgetWindowPrivate::~QWidgetWindowPrivate (this=0x564896397450) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:34
    #2  0x000019667a96f05d in QWidgetWindowPrivate::~QWidgetWindowPrivate (this=0x564896397450) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:34
    #3  0x00006f736e33a7e8 in QScopedPointerDeleter<QObjectData>::cleanup (pointer=0x564896397450) at qtbase/src/corelib/tools/qscopedpointer.h:24
    #4  0x00006f736e32e134 in QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> >::~QScopedPointer (this=0x5648961bd088) at qtbase/src/corelib/tools/qscopedpointer.h:81
    #5  0x00006f736e31cdb2 in QObject::~QObject (this=0x5648961bd080) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:1149
    #6  0x00005557579435ec in QWindow::~QWindow (this=0x5648961bd080) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindow.cpp:206
    #7  0x000019667a969be6 in QWidgetWindow::~QWidgetWindow (this=0x5648961bd080) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:179
    #8  0x000019667a969c2d in QWidgetWindow::~QWidgetWindow (this=0x5648961bd080) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:160
    #9  0x000019667a915351 in QWidgetPrivate::deleteTLSysExtra (this=0x564894d40bf0) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:1711
    #10 0x000019667a914f86 in QWidget::destroy (this=0x56488f3e8100, destroyWindow=true, destroySubWindows=true) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:12612
    #11 0x000019667a914504 in QWidget::~QWidget (this=0x56488f3e8100) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:1565
    #12 0x000019667ad11705 in QDialog::~QDialog (this=0x56488f3e8100) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qdialog.cpp:394
    #13 0x000019667ad1174d in QDialog::~QDialog (this=0x56488f3e8100) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qdialog.cpp:386
    #14 0x00006a0d3b71e358 in std::default_delete<QDialog>::operator() (this=0x5648963f9fb0, __ptr=0x56488f3e8100) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:93
    #15 0x00006a0d3b71e478 in std::__uniq_ptr_impl<QDialog, std::default_delete<QDialog> >::reset (this=0x5648963f9fb0, __p=0x0) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:205
    #16 0x00006a0d3b71e40d in std::unique_ptr<QDialog, std::default_delete<QDialog> >::reset (this=0x5648963f9fb0, __p=0x0) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:504
    #17 0x00006a0d3b71b550 in QtInstanceDialog::~QtInstanceDialog()::$_0::operator()() const (this=0x7ffe9cb13630) at vcl/qt6/../qt5/QtInstanceDialog.cxx:30
    #18 0x00006a0d3b71b525 in std::__invoke_impl<void, QtInstanceDialog::~QtInstanceDialog()::$_0&>(std::__invoke_other, QtInstanceDialog::~QtInstanceDialog()::$_0&) (__f=...)
        at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/invoke.h:61
    #19 0x00006a0d3b71b4d5 in std::__invoke_r<void, QtInstanceDialog::~QtInstanceDialog()::$_0&>(QtInstanceDialog::~QtInstanceDialog()::$_0&) (__fn=...) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/invoke.h:111
    #20 0x00006a0d3b71b3fd in std::_Function_handler<void(), QtInstanceDialog::~QtInstanceDialog()::$_0>::_M_invoke (__functor=...) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/std_function.h:290
    #21 0x00006a0d3b6e278e in std::function<void()>::operator() (this=0x7ffe9cb13630) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/std_function.h:591
    #22 0x00006a0d3b6da31a in QtInstance::RunInMainThread (this=0x56488e111bf0, func=...) at vcl/qt6/../qt5/QtInstance.cxx:226
    #23 0x00006a0d3b71947b in QtInstanceDialog::~QtInstanceDialog (this=0x5648963f9f90, vtt=0x6a0d3b98fec8 <VTT for QtInstanceDialog>) at vcl/qt6/../qt5/QtInstanceDialog.cxx:30
    #24 0x00006a0d3b7195a0 in QtInstanceDialog::~QtInstanceDialog (this=0x5648963f9f90) at vcl/qt6/../qt5/QtInstanceDialog.cxx:28
    #25 0x00006a0d3b7196a9 in QtInstanceDialog::~QtInstanceDialog (this=0x5648963f9f90) at vcl/qt6/../qt5/QtInstanceDialog.cxx:28
    #26 0x00005abe4e4746f8 in std::default_delete<weld::Dialog>::operator() (this=0x564896171890, __ptr=0x5648963fa1f8) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:93
    #27 0x00005abe4e4faefd in std::_Sp_counted_deleter<weld::Dialog*, std::default_delete<weld::Dialog>, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0x564896171880)
        at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:527
    #28 0x00005abe4da1978a in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x564896171880) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:346
    #29 0x00005abe4da19706 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x5648961a7cb8) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:1069
    #30 0x00005abe4db3d6e9 in std::__shared_ptr<weld::Dialog, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x5648961a7cb0) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:1525
    #31 0x00005abe4db2e905 in std::shared_ptr<weld::Dialog>::~shared_ptr (this=0x5648961a7cb0) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr.h:175
    #32 0x00005abe4e4f6a7b in weld::GenericDialogController::~GenericDialogController (this=0x5648961a7c90) at vcl/source/app/weldutils.cxx:58
    #33 0x000000444e3b8ce9 in AboutDialog::~AboutDialog (this=0x5648961a7c90) at cui/source/dialogs/about.cxx:142
    #34 0x000000444e5787b6 in std::destroy_at<AboutDialog> (__location=0x5648961a7c90) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/stl_construct.h:88
    #35 0x000000444e578795 in std::_Destroy<AboutDialog> (__pointer=0x5648961a7c90) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/stl_construct.h:149
    #36 0x000000444e57862f in std::allocator_traits<std::allocator<void> >::destroy<AboutDialog> (__p=0x5648961a7c90) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/alloc_traits.h:708
    #37 std::_Sp_counted_ptr_inplace<AboutDialog, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0x5648961a7c80) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:616
    #38 0x00006a0d3b661e5a in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use (this=0x5648961a7c80) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:175
    #39 0x00006a0d3b661e35 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use_cold (this=0x5648961a7c80) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:199
    #40 0x00006a0d3b661e11 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x5648961a7c80) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:353
    #41 0x00006a0d3b661cf6 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x7ffe9cb13a30) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:1069
    #42 0x00006a0d3b71ea39 in std::__shared_ptr<weld::DialogController, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x7ffe9cb13a28) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:1525
    #43 0x00006a0d3b71da14 in std::__shared_ptr<weld::DialogController, (__gnu_cxx::_Lock_policy)2>::reset (this=0x7ffe9cb13ae8) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:1643
    #44 0x00006a0d3b71ae1c in QtInstanceDialog::dialogFinished (this=0x5648963f9f90, nResult=7) at vcl/qt6/../qt5/QtInstanceDialog.cxx:198
    #45 0x00006a0d3b71e9a6 in QtPrivate::FunctorCall<std::integer_sequence<unsigned long, 0ul>, QtPrivate::List<int>, void, void (QtInstanceDialog::*)(int)>::call(void (QtInstanceDialog::*)(int), QtInstanceDialog*, void**)::{lambda()#1}::operator()() const (this=0x7ffe9cb13bd0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:127
    #46 0x00006a0d3b71e8c9 in QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<std::integer_sequence<unsigned long, 0ul>, QtPrivate::List<int>, void, void (QtInstanceDialog::*)(int)>::call(void (QtInstanceDialog::*)(int), QtInstanceDialog*, void**)::{lambda()#1}>(void**, QtPrivate::FunctorCall<std::integer_sequence<unsigned long, 0ul>, QtPrivate::List<int>, void, void (QtInstanceDialog::*)(int)>::call(void (QtInstanceDialog::*)(int), QtInstanceDialog*, void**)::{lambda()#1}&&) (args=0x7ffe9cb13fa0, fn=...) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:65
    #47 0x00006a0d3b71e803 in QtPrivate::FunctorCall<std::integer_sequence<unsigned long, 0ul>, QtPrivate::List<int>, void, void (QtInstanceDialog::*)(int)>::call
        (f=&virtual QtInstanceDialog::dialogFinished(int), o=0x5648963f9f90, arg=0x7ffe9cb13fa0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:126
    #48 0x00006a0d3b71e77d in QtPrivate::FunctionPointer<void (QtInstanceDialog::*)(int)>::call<QtPrivate::List<int>, void> (f=&virtual QtInstanceDialog::dialogFinished(int), o=0x5648963f9f90, arg=0x7ffe9cb13fa0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:174
    #49 0x00006a0d3b71e6a6 in QtPrivate::QCallableObject<void (QtInstanceDialog::*)(int), QtPrivate::List<int>, void>::impl (which=1, this_=0x5648961544d0, r=0x5648963f9f90, a=0x7ffe9cb13fa0, ret=0x0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:545
    #50 0x00006f736e271f82 in QtPrivate::QSlotObjectBase::call (this=0x5648961544d0, r=0x5648963f9f90, a=0x7ffe9cb13fa0) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:461
    #51 0x00006f736e331854 in doActivate<false> (sender=0x56488f3e8100, signal_index=7, argv=0x7ffe9cb13fa0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4139
    #52 0x00006f736e3273e3 in QMetaObject::activate (sender=0x56488f3e8100, m=0x19667b4289a8 <QDialog::staticMetaObject>, local_signal_index=0, argv=0x7ffe9cb13fa0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4199
    #53 0x000019667a86520b in QMetaObject::activate<void, int> (sender=0x56488f3e8100, mo=0x19667b4289a8 <QDialog::staticMetaObject>, local_signal_index=0, ret=0x0, args=@0x7ffe9cb13fe4: 7) at qtbase/src/corelib/kernel/qobjectdefs.h:306
    #54 0x000019667ad11f28 in QDialog::finished (this=0x56488f3e8100, _t1=7) at qtbase/src/widgets/Widgets_autogen/include/moc_qdialog.cpp:191
    #55 0x000019667ad11e55 in QDialog::done (this=0x56488f3e8100, r=7) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qdialog.cpp:617
    #56 0x00006a0d3b71b173 in QtInstanceDialog::handleButtonClick (rDialog=..., rButton=...) at vcl/qt6/../qt5/QtInstanceDialog.cxx:226
    #57 0x00006a0d3b658b0c in QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0::operator()() const (this=0x5648961351a0)
        at vcl/qt6/../qt5/QtBuilder.cxx:528
    #58 0x00006a0d3b658ae8 in QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_v--Type <RET> for more, q to quit, c to continue without paging--
    iew<char, std::char_traits<char> >)::$_0>::call(QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0&, void**)::{lambda()#1}::operator()() const (this=0x7ffe9cb14370) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:116
    #59 0x00006a0d3b658ac9 in QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0>::call(QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0&, void**)::{lambda()#1}>(void**, QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0>::call(QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0&, void**)::{lambda()#1}&&) (args=0x7ffe9cb146d0, fn=...) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:65
    #60 0x00006a0d3b658a92 in QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0>::call(QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0&, void**)
        (f=..., arg=0x7ffe9cb146d0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:115
    #61 0x00006a0d3b658a41 in QtPrivate::FunctorCallable<QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0>::call<QtPrivate::List<>, void>(QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0&, void*, void**) (f=..., arg=0x7ffe9cb146d0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:337
    #62 0x00006a0d3b6589e8 in QtPrivate::QCallableObject<QtBuilder::tweakInsertedChild(QObject*, QObject*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)::$_0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x564896135190, r=0x56488f3e8100, a=0x7ffe9cb146d0, ret=0x0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:547
    #63 0x00006f736e271f82 in QtPrivate::QSlotObjectBase::call (this=0x564896135190, r=0x56488f3e8100, a=0x7ffe9cb146d0) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:461
    #64 0x00006f736e331854 in doActivate<false> (sender=0x56489581c360, signal_index=9, argv=0x7ffe9cb146d0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4139
    #65 0x00006f736e3273e3 in QMetaObject::activate (sender=0x56489581c360, m=0x19667b414930 <QAbstractButton::staticMetaObject>, local_signal_index=2, argv=0x7ffe9cb146d0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4199
    #66 0x000019667a86538b in QMetaObject::activate<void, bool> (sender=0x56489581c360, mo=0x19667b414930 <QAbstractButton::staticMetaObject>, local_signal_index=2, ret=0x0, args=@0x7ffe9cb14717: false)
        at qtbase/src/corelib/kernel/qobjectdefs.h:306
    #67 0x000019667aab4f52 in QAbstractButton::clicked (this=0x56489581c360, _t1=false) at qtbase/src/widgets/Widgets_autogen/include/moc_qabstractbutton.cpp:253
    #68 0x000019667aab4e67 in QAbstractButtonPrivate::emitClicked (this=0x564893f024d0) at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qabstractbutton.cpp:381
    #69 0x000019667aab4cc1 in QAbstractButtonPrivate::click (this=0x564893f024d0) at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qabstractbutton.cpp:374
    #70 0x000019667aab616f in QAbstractButton::mouseReleaseEvent (this=0x56489581c360, e=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qabstractbutton.cpp:976
    #71 0x000019667a92c6fd in QWidget::event (this=0x56489581c360, event=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:8971
    #72 0x000019667aab5f8c in QAbstractButton::event (this=0x56489581c360, e=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qabstractbutton.cpp:933
    #73 0x000019667ac2dfb1 in QPushButton::event (this=0x56489581c360, e=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/widgets/widgets/qpushbutton.cpp:684
    #74 0x000019667a86fe10 in QApplicationPrivate::notify_helper (this=0x56488e07aae0, receiver=0x56489581c360, e=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3304
    #75 0x000019667a871ae2 in QApplication::notify (this=0x56488e067420, receiver=0x56489581c360, e=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:2781
    #76 0x00006f736e25acc9 in QCoreApplication::notifyInternal2 (receiver=0x56489581c360, event=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1122
    #77 0x00006f736e25bb39 in QCoreApplication::sendSpontaneousEvent (receiver=0x56489581c360, event=0x7ffe9cb15ad0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1578
    #78 0x000019667a870737 in QApplicationPrivate::sendMouseEvent
        (receiver=0x56489581c360, event=0x7ffe9cb15ad0, alienWidget=0x56489581c360, nativeWidget=0x56488f3e8100, buttonDown=0x19667b45b488 <qt_button_down>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false)
        at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:2362
    #79 0x000019667a96b8bb in QWidgetWindow::handleMouseEvent (this=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:664
    #80 0x000019667a96a145 in QWidgetWindow::event (this=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:292
    #81 0x000019667a86fe10 in QApplicationPrivate::notify_helper (this=0x56488e07aae0, receiver=0x5648961bd080, e=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3304
    #82 0x000019667a873d2d in QApplication::notify (this=0x56488e067420, receiver=0x5648961bd080, e=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3254
    #83 0x00006f736e25acc9 in QCoreApplication::notifyInternal2 (receiver=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1122
    #84 0x00006f736e25bb39 in QCoreApplication::sendSpontaneousEvent (receiver=0x5648961bd080, event=0x7ffe9cb16b98) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1578
    #85 0x0000555757871f72 in QGuiApplicationPrivate::processMouseEvent (e=0x5f6d64003360) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qguiapplication.cpp:2485
    #86 0x0000555757871136 in QGuiApplicationPrivate::processWindowSystemEvent (e=0x5f6d64003360) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qguiapplication.cpp:2212
    #87 0x0000555757958a4d in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:1113
    #88 0x00005557579588fe in QWindowSystemInterface::flushWindowSystemEvents (flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:1082
    #89 0x0000393946e55875 in QtWaylandClient::QWaylandDisplay::flushRequests (this=0x56488e0ca590) at /home/michi/development/git/qt5/qtwayland/src/client/qwaylanddisplay.cpp:524
    #90 0x0000393946e5a946 in QtWaylandClient::QWaylandDisplay::qt_static_metacall (_o=0x56488e0ca590, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0x7ffe9cb172a0)
        at qtwayland/src/client/WaylandClient_autogen/include/moc_qwaylanddisplay_p.cpp:95
    #91 0x00006f736e331954 in doActivate<false> (sender=0x56488e06c0e0, signal_index=4, argv=0x7ffe9cb172a0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4151
    #92 0x00006f736e3273e3 in QMetaObject::activate (sender=0x56488e06c0e0, m=0x6f736ec1ec68 <QAbstractEventDispatcher::staticMetaObject>, local_signal_index=1, argv=0x0)
        at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4199
    #93 0x00006f736e243c79 in QAbstractEventDispatcher::awake (this=0x56488e06c0e0) at qtbase/src/corelib/Core_autogen/include/moc_qabstracteventdispatcher.cpp:129
    #94 0x00006f736e84d1e8 in QEventDispatcherGlib::processEvents (this=0x56488e06c0e0, flags=...) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:406
    #95 0x0000555758154088 in QPAEventDispatcherGlib::processEvents (this=0x56488e06c0e0, flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/platform/unix/qeventdispatcher_glib.cpp:89
    #96 0x00006a0d3b6d9b82 in QtInstance::ImplYield (this=0x56488e111bf0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:464
    #97 0x00006a0d3b6dcc01 in QtInstance::DoYield (this=0x56488e111bf0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:475
    #98 0x00005abe4e4b26e6 in ImplYield (i_bWait=true, i_bAllEvents=false) at vcl/source/app/svapp.cxx:385
    #99 0x00005abe4e4b207f in Application::Yield () at vcl/source/app/svapp.cxx:473
    #100 0x00005abe4e4b1e60 in Application::Execute () at vcl/source/app/svapp.cxx:360
    #101 0x00004759668eccab in desktop::Desktop::Main (this=0x7ffe9cb18ec8) at desktop/source/app/app.cxx:1679
    #102 0x00005abe4e4d3bc6 in ImplSVMain () at vcl/source/app/svmain.cxx:230
    #103 0x00005abe4e4d57b9 in SVMain () at vcl/source/app/svmain.cxx:248
    #104 0x00004759669665da in soffice_main () at desktop/source/app/sofficemain.cxx:121
    #105 0x000056486abf0a6d in sal_main () at /home/michi/development/git/libreoffice/desktop/source/app/main.c:51
    #106 0x000056486abf0a47 in main (argc=1, argv=0x7ffe9cb190d8) at /home/michi/development/git/libreoffice/desktop/source/app/main.c:49

[1] https://code.qt.io/cgit/qt/qtbase.git/commit/?id=84a5f50c7766c99f62b22bb4388137e0aa8dd13d

Change-Id: I3f547c1b1c1581d2f3ae092f2034d930640b0f48
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179312
Reviewed-by: Michael Weghorn <[email protected]>
Tested-by: Jenkins
(cherry picked from commit 4b547f1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179325
Reviewed-by: Adolfo Jayme Barrientos <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Dec 29, 2024
This reverts commit 687080c, as it caused e.g.
CppunitTest_sw_docbookexport to fail with

> sw/inc/calbck.hxx:428:18: runtime error: downcast of address 0x7ba8053a9db8 which does not point to an object of type 'SwClient' (aka 'ClientBase<SwModify>')
> 0x7ba8053a9da0: note: object is base class subobject at offset 24 within object of type 'SwFormatHeader'
>  00 00 00 00  d0 8b c9 ae 47 7b 00 00  01 00 00 00 66 00 48 01  40 6c 00 00 88 be be be  50 8c c9 ae
>               ^                                                                          ~~~~~~~~~~~
>                                                                                          vptr for 'sw::ClientBase<SwFrameFormat>' base class of 'SwFormatHeader'
>  #0 in SwIterator<sw::ClientBase<SwModify>, SwModify, (sw::IteratorMode)0>::First() at sw/inc/calbck.hxx:428:18
>  #1 in SwModify::CallSwClientNotify(SfxHint const&) const at sw/source/core/attr/calbck.cxx:237:35
>  #2 in sw::BroadcastingModify::CallSwClientNotify(SfxHint const&) const at sw/source/core/attr/calbck.cxx:259:15
>  #3 in SwModify::SwClientNotify(SwModify const&, SfxHint const&) at sw/source/core/attr/calbck.cxx:229:5
>  #4 in SwFormat::SwClientNotify(SwModify const&, SfxHint const&) at sw/source/core/attr/format.cxx:309:19
>  #5 in SwFrameFormat::SwClientNotify(SwModify const&, SfxHint const&) at sw/source/core/layout/atrfrm.cxx:2849:15
>  #6 in sw::ClientNotifyAttrChg(SwModify&, SwAttrSet const&, SwAttrSet&, SwAttrSet&) at sw/source/core/attr/calbck.cxx:268:13
>  #7 in SwFormat::SetFormatAttr(SfxItemSet const&) at sw/source/core/attr/format.cxx:604:13
>  #8 in FillHdFt(SwFrameFormat*, SfxItemSet const&) at sw/source/uibase/utlui/uitool.cxx:239:14
>  #9 in ItemSetToPageDesc(SfxItemSet const&, SwPageDesc&) at sw/source/uibase/utlui/uitool.cxx:340:13
>  #10 in SwDocStyleSheet::SetItemSet(SfxItemSet const&, bool, bool) at sw/source/uibase/app/docstyle.cxx:1894:13
>  #11 in SwXPageStyle::SetPropertyValues_Impl(com::sun::star::uno::Sequence<rtl::OUString> const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) at sw/source/core/unocore/unostyle.cxx:3157:33
>  #12 in SwXPageStyle::setPropertyValue(rtl::OUString const&, com::sun::star::uno::Any const&) at sw/source/core/unocore/unostyle.cxx:3453:5
>  #13 in writerfilter::dmapper::DomainMapper_Impl::PushPageHeaderFooter(writerfilter::dmapper::PagePartType, writerfilter::dmapper::PageType) at sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx:3910:25
>  #14 in writerfilter::dmapper::DomainMapper_Impl::substream(unsigned int, tools::SvRef<writerfilter::Reference<writerfilter::Stream>> const&) at sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx:10049:13
>  #15 in writerfilter::dmapper::DomainMapper::lcl_substream(unsigned int, tools::SvRef<writerfilter::Reference<writerfilter::Stream>> const&) at sw/source/writerfilter/dmapper/DomainMapper.cxx:4746:14
>  #16 in writerfilter::LoggedStream::substream(unsigned int, tools::SvRef<writerfilter::Reference<writerfilter::Stream>> const&) at sw/source/writerfilter/dmapper/LoggedResources.cxx:272:5
>  #17 in writerfilter::ooxml::OOXMLDocumentImpl::resolveFastSubStreamWithId(writerfilter::Stream&, tools::SvRef<writerfilter::Reference<writerfilter::Stream>> const&, unsigned int) at sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx:127:13
>  #18 in writerfilter::ooxml::OOXMLDocumentImpl::resolveHeader(writerfilter::Stream&, int, rtl::OUString const&) at sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx:384:10
>  #19 in writerfilter::ooxml::OOXMLFastContextHandler::resolveHeader(int, rtl::OUString const&) at sw/source/writerfilter/ooxml/OOXMLFastContextHandler.cxx:895:35
>  #20 in writerfilter::ooxml::OOXMLHeaderHandler::finalize() at sw/source/writerfilter/ooxml/Handler.cxx:214:20
>  #21 in writerfilter::ooxml::OOXMLFastContextHandlerProperties::handleHdrFtr() at sw/source/writerfilter/ooxml/OOXMLFastContextHandler.cxx:1117:28
>  #22 in writerfilter::ooxml::OOXMLFactory_wml::endAction(writerfilter::ooxml::OOXMLFastContextHandler*) at workdir/CustomTarget/sw/source/writerfilter/ooxml/OOXMLFactory_wml.cxx:7530:26
>  #23 in writerfilter::ooxml::OOXMLFactory::endAction(writerfilter::ooxml::OOXMLFastContextHandler*) at sw/source/writerfilter/ooxml/OOXMLFactory.cxx:157:19
>  #24 in writerfilter::ooxml::OOXMLFastContextHandler::endAction() at sw/source/writerfilter/ooxml/OOXMLFastContextHandler.cxx:320:5
>  #25 in writerfilter::ooxml::OOXMLFastContextHandlerProperties::lcl_endFastElement(int) at sw/source/writerfilter/ooxml/OOXMLFastContextHandler.cxx:1038:9
>  #26 in writerfilter::ooxml::OOXMLFastContextHandler::endFastElement(int) at sw/source/writerfilter/ooxml/OOXMLFastContextHandler.cxx:227:9
>  #27 in (anonymous namespace)::Entity::endElement() at sax/source/fastparser/fastparser.cxx:515:27
>  #28 in sax_fastparser::FastSaxParserImpl::callbackEndElement() at sax/source/fastparser/fastparser.cxx:1338:17
>  #29 in (anonymous namespace)::call_callbackEndElement(void*, unsigned char const*, unsigned char const*, unsigned char const*) at sax/source/fastparser/fastparser.cxx:339:18
>  #30 in xmlParseTryOrFinish at workdir/UnpackedTarball/libxml2/parser.c:11254:8
>  #31 in xmlParseChunk at workdir/UnpackedTarball/libxml2/parser.c:11636:5
>  #32 in sax_fastparser::FastSaxParserImpl::parse() at sax/source/fastparser/fastparser.cxx:1117:25
>  #33 in sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) at sax/source/fastparser/fastparser.cxx:896:9
>  #34 in sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) at sax/source/fastparser/fastparser.cxx:1477:13
>  #35 in writerfilter::ooxml::OOXMLDocumentImpl::resolve(writerfilter::Stream&) at sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx:514:18
>  #36 in (anonymous namespace)::WriterFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sw/source/writerfilter/filter/WriterFilter.cxx:210:24
>  #37 in SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) at sfx2/source/doc/objstor.cxx:2719:34
>  #38 in SfxObjectShell::DoLoad(SfxMedium*) at sfx2/source/doc/objstor.cxx:767:23
>  #39 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sfx2/source/doc/sfxbasemodel.cxx:1991:36
>  #40 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:725:28
>  #41 in framework::LoadEnv::impl_loadContent() at framework/source/loadenv/loadenv.cxx:1180:37
>  #42 in framework::LoadEnv::start() at framework/source/loadenv/loadenv.cxx:415:20
>  #43 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:311:5
>  #44 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:167:14
>  #45 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:592:16
>  #46 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
>  #47 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:72:62
>  #48 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
>  #49 in UnoApiTest::loadFromURL(rtl::OUString const&, char const*) at test/source/unoapi_test.cxx:108:5
>  #50 in SwModelTestBase::loadURL(rtl::OUString const&, char const*) at sw/qa/unit/swmodeltestbase.cxx:384:5
>  #51 in SwModelTestBase::createSwDoc(char const*, char const*) at sw/qa/unit/swmodeltestbase.cxx:433:9
>  #52 in (anonymous namespace)::testtdf91095::TestBody() at sw/qa/extras/docbookexport/docbookexport.cxx:35:5

Change-Id: I1e6d6888c8b311988e627845107148c7970fbaab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179502
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Jan 8, 2025
This reverts commit cc56bf5.

Reason for revert: It causes CppunitTest_sw_uwriter
CPPUNIT_TEST_NAME=SwDocTest::test64kPageDescs to fail with

> /sw/source/core/attr/format.cxx:273:29: runtime error: downcast of address 0x6140000e1840 which does not point to an object of type 'SwFormat'
> 0x6140000e1840: note: object is of type 'SwModify'
>  00 00 00 00  b0 e1 74 97 df 7f 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00
>               ^~~~~~~~~~~~~~~~~~~~~~~
>               vptr for 'SwModify'
>     #0 0x7fdf8a31ca65 in SwFormat::SwClientNotify(SwModify const&, SfxHint const&) /sw/source/core/attr/format.cxx:273:29
>     #1 0x7fdf8d066efe in SwFrameFormat::SwClientNotify(SwModify const&, SfxHint const&) /sw/source/core/layout/atrfrm.cxx:2766:19
>     #2 0x7fdf8a2d51f2 in SwModify::CallSwClientNotify(SfxHint const&) const /sw/source/core/attr/calbck.cxx:231:18
>     #3 0x7fdf8a2d2c5a in SwModify::SwClientNotify(SwModify const&, SfxHint const&) /sw/source/core/attr/calbck.cxx:222:5
>     #4 0x7fdf8a2d07bd in SwModify::~SwModify() /sw/source/core/attr/calbck.cxx:145:15
>     #5 0x7fdf89b267c5 in sw::BroadcastingModify::~BroadcastingModify() /sw/inc/calbck.hxx:242:59
>     #6 0x7fdf8a319f52 in SwFormat::~SwFormat() /sw/source/core/attr/format.cxx:208:1
>     #7 0x7fdf8d064426 in SwFrameFormat::~SwFrameFormat() /sw/source/core/layout/atrfrm.cxx:2705:1
>     #8 0x7fdf8d0644d8 in SwFrameFormat::~SwFrameFormat() /sw/source/core/layout/atrfrm.cxx:2677:1
>     #9 0x7fdf8b42be68 in std::default_delete<SwFrameFormat>::operator()(SwFrameFormat*) const /opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/unique_ptr.h:95:2
>     #10 0x7fdf8b454cc4 in std::__uniq_ptr_impl<SwFrameFormat, std::default_delete<SwFrameFormat> >::reset(SwFrameFormat*) /opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/unique_ptr.h:203:4
>     #11 0x7fdf8b38aa7e in std::unique_ptr<SwFrameFormat, std::default_delete<SwFrameFormat> >::reset(SwFrameFormat*) /opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/unique_ptr.h:501:7
>     #12 0x7fdf8b3434a6 in SwDoc::~SwDoc() /sw/source/core/doc/docnew.cxx:625:23
>     #13 0x7fdf8abc1dd5 in SwDoc::release() /sw/source/core/doc/doc.cxx:136:9
>     #14 0x7fdf8c2cbc16 in rtl::Reference<SwDoc>::clear() /include/rtl/ref.hxx:193:19
>     #15 0x7fdf9102a534 in SwDocShell::RemoveLink() /sw/source/uibase/app/docshini.cxx:445:16
>     #16 0x7fdf910295bd in SwDocShell::~SwDocShell() /sw/source/uibase/app/docshini.cxx:373:5
>     #17 0x7fdf9102a728 in SwDocShell::~SwDocShell() /sw/source/uibase/app/docshini.cxx:363:1
>     #18 0x7fdfda648fca in cppu::OWeakObject::release() /cppuhelper/source/weak.cxx:230:9
>     #19 0x7fdf89b2801f in rtl::Reference<SwDocShell>::clear() /include/rtl/ref.hxx:193:19
>     #20 0x7fdf89ac3f0c in SwDocTest::tearDown() /sw/qa/core/uwriter.cxx:1977:17

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

Change-Id: Ib4866bcfc71e2e3358a8f860cc19efa3f6349885
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179925
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Jan 8, 2025
…"" and fix SwIterator cast"

This reverts commit d8e29e2.

Reason for revert: It causes CppunitTest_sw_rtfexport2 to fail with

> /sw/inc/calbck.hxx:428:18: runtime error: downcast of address 0x6060004d0fd8 which does not point to an object of type 'sw::ClientBase<SwModify>'
> 0x6060004d0fc0: note: object is base class subobject at offset 24 within object of type 'SwFormatHeader'
>  00 00 00 00  90 c6 d3 ea 6e 7f 00 00  01 00 00 00 66 00 48 01  a0 11 00 00 88 be be be  10 c7 d3 ea
>               ^                                                                          ~~~~~~~~~~~
>                                                                                          vptr for 'sw::ClientBase<SwFrameFormat>' base class of 'SwFormatHeader'
>     #0 0x7f6edd5beb5e in SwIterator<sw::ClientBase<SwModify>, SwModify, (sw::IteratorMode)0>::First() /sw/inc/calbck.hxx:428:18
>     #1 0x7f6edd5b6d69 in SwModify::CallSwClientNotify(SfxHint const&) const /sw/source/core/attr/calbck.cxx:237:35
>     #2 0x7f6edd5b7c45 in sw::BroadcastingModify::CallSwClientNotify(SfxHint const&) const /sw/source/core/attr/calbck.cxx:259:15
>     #3 0x7f6edd5b49c6 in SwModify::SwClientNotify(SwModify const&, SfxHint const&) /sw/source/core/attr/calbck.cxx:229:5
>     #4 0x7f6edd605e7b in SwFormat::SwClientNotify(SwModify const&, SfxHint const&) /sw/source/core/attr/format.cxx:309:19
>     #5 0x7f6ee039738b in SwFrameFormat::SwClientNotify(SwModify const&, SfxHint const&) /sw/source/core/layout/atrfrm.cxx:2849:15
>     #6 0x7f6edd5b8189 in sw::ClientNotifyAttrChg(SwModify&, SwAttrSet const&, SwAttrSet&, SwAttrSet&) /sw/source/core/attr/calbck.cxx:268:13
>     #7 0x7f6edd610879 in SwFormat::SetFormatAttr(SfxItemSet const&) /sw/source/core/attr/format.cxx:604:13
>     #8 0x7f6ee6495964 in FillHdFt(SwFrameFormat*, SfxItemSet const&) /sw/source/uibase/utlui/uitool.cxx:239:14
>     #9 0x7f6ee64914e7 in ItemSetToPageDesc(SfxItemSet const&, SwPageDesc&) /sw/source/uibase/utlui/uitool.cxx:340:13
>     #10 0x7f6ee43fe5b4 in SwDocStyleSheet::SetItemSet(SfxItemSet const&, bool, bool) /sw/source/uibase/app/docstyle.cxx:1894:13
>     #11 0x7f6ee304306c in SwXPageStyle::SetPropertyValues_Impl(com::sun::star::uno::Sequence<rtl::OUString> const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) /sw/source/core/unocore/unostyle.cxx:3157:33
>     #12 0x7f6ee304d9b9 in SwXPageStyle::setPropertyValue(rtl::OUString const&, com::sun::star::uno::Any const&) /sw/source/core/unocore/unostyle.cxx:3453:5
>     #13 0x7f6e9b369897 in writerfilter::dmapper::DomainMapper_Impl::PushPageHeaderFooter(writerfilter::dmapper::PagePartType, writerfilter::dmapper::PageType) /sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx:3910:25
>     #14 0x7f6e9b445050 in writerfilter::dmapper::DomainMapper_Impl::substream(unsigned int, tools::SvRef<writerfilter::Reference<writerfilter::Stream> > const&) /sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx:10046:13
>     #15 0x7f6e9b101b9d in writerfilter::dmapper::DomainMapper::lcl_substream(unsigned int, tools::SvRef<writerfilter::Reference<writerfilter::Stream> > const&) /sw/source/writerfilter/dmapper/DomainMapper.cxx:4746:14
>     #16 0x7f6e9b877f73 in writerfilter::LoggedStream::substream(unsigned int, tools::SvRef<writerfilter::Reference<writerfilter::Stream> > const&) /sw/source/writerfilter/dmapper/LoggedResources.cxx:272:5
>     #17 0x7f6e9ad35daf in writerfilter::rtftok::RTFDocumentImpl::resolveSubstream(unsigned long, unsigned int, rtl::OUString const&) /sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx:381:14
>     #18 0x7f6e9ad33bc1 in writerfilter::rtftok::RTFDocumentImpl::resolveSubstream(unsigned long, unsigned int) /sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx:356:5
>     #19 0x7f6e9ad48f49 in writerfilter::rtftok::RTFDocumentImpl::sectBreak(bool) /sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx:705:9
>     #20 0x7f6e9adcd3b7 in writerfilter::rtftok::RTFDocumentImpl::popState() /sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx:3695:13
>     #21 0x7f6e9afd2595 in writerfilter::rtftok::RTFTokenizer::resolveParse() /sw/source/writerfilter/rtftok/rtftokenizer.cxx:2011:37
>     #22 0x7f6e9ad4ef4f in writerfilter::rtftok::RTFDocumentImpl::resolve(writerfilter::Stream&) /sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx:844:27
>     #23 0x7f6e9bd39f91 in (anonymous namespace)::RtfFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sw/source/writerfilter/filter/RtfFilter.cxx:164:20
>     #24 0x7f6ef659a6a4 in SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) /sfx2/source/doc/objstor.cxx:2719:34
>     #25 0x7f6ef654cf40 in SfxObjectShell::DoLoad(SfxMedium*) /sfx2/source/doc/objstor.cxx:767:23
>     #26 0x7f6ef67df024 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/sfxbasemodel.cxx:1991:36
>     #27 0x7f6ef703d0f0 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:725:28
>     #28 0x7f6ec073ee16 in framework::LoadEnv::impl_loadContent() /framework/source/loadenv/loadenv.cxx:1180:37
>     #29 0x7f6ec0735cb2 in framework::LoadEnv::start() /framework/source/loadenv/loadenv.cxx:415:20
>     #30 0x7f6ec072e172 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:311:5
>     #31 0x7f6ec0729554 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:167:14
>     #32 0x7f6ec07fe176 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:592:16
>     #33 0x7f6ec07fe396 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
>     #34 0x7f6ed3d9c8c9 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:72:62
>     #35 0x7f6ef13e8d62 in UnoApiTest::loadWithParams(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /test/source/unoapi_test.cxx:126:19
>     #36 0x7f6ef13e7e98 in UnoApiTest::loadFromURL(rtl::OUString const&, char const*) /test/source/unoapi_test.cxx:108:5
>     #37 0x7f6efe61e0c7 in SwModelTestBase::loadURL(rtl::OUString const&, char const*) /sw/qa/unit/swmodeltestbase.cxx:384:5
>     #38 0x7f6efe632c07 in SwModelTestBase::createSwDoc(char const*, char const*) /sw/qa/unit/swmodeltestbase.cxx:433:9
>     #39 0x7f6efe0c635f in (anonymous namespace)::testAllGapsWord::TestBody() /sw/qa/extras/rtfexport/rtfexport2.cxx:771:5

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

Change-Id: I70bd88050887c8b6c747707f2ea3b89802c7b468
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179946
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Jan 9, 2025
The minidump in the bug (https://bugs.documentfoundation.org/attachment.cgi?id=198431)
shows these three stacks:

1. VCL main thread:

  ntdll.dll!NtWaitForAlertByThreadId()
  ntdll.dll!RtlpAcquireSRWLockExclusiveContended()
  ntdll.dll!RtlAcquireSRWLockExclusive()
  msvcp140.dll!mtx_do_lock(_Mtx_internal_imp_t * mtx, const xtime * target) Line 103
  [Inline Frame] vclplug_winlo.dll!std::_Mutex_base::lock() Line 50
  [Inline Frame] vclplug_winlo.dll!std::unique_lock<std::mutex>::{ctor}(std::mutex &) Line 133
  vclplug_winlo.dll!CWinClipboard::getContents() Line 125
  sclo.dll!ScTabViewShell::GetClipData(vcl::Window * pWin) Line 542
  [Inline Frame] vbaobjlo.dll!ooo::vba::excel::implnPasteSpecial(const com::sun::star::uno::Reference<com::sun::star::frame::XModel> &) Line 235
  vbaobjlo.dll!ScVbaRange::PasteSpecial(const com::sun::star::uno::Any & Paste, const com::sun::star::uno::Any & Operation, const com::sun::star::uno::Any & SkipBlanks, const com::sun::star::uno::Any & Transpose) Line 2942
  mscx_uno.dll!`anonymous namespace'::cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, bridges::cpp_uno::shared::VtableSlot aVtableSlot, _typelib_TypeDescriptionReference * pReturnTypeRef, long nParams, _typelib_MethodParameter * pParams, void * pUnoReturn, void * * pUnoArgs, _uno_Any * * ppUnoExc) Line 214
  mscx_uno.dll!unoInterfaceProxyDispatch(_uno_Interface * pUnoI, const _typelib_TypeDescription * pMemberTD, void * pReturn, void * * pArgs, _uno_Any * * ppException) Line 430
  reflectionlo.dll!stoc_corefl::`anonymous namespace'::IdlInterfaceMethodImpl::invoke(const com::sun::star::uno::Any & rObj, com::sun::star::uno::Sequence<com::sun::star::uno::Any> & rArgs) Line 593
  mergedlo.dll!SbUnoObject::Notify(SfxBroadcaster & rBC, const SfxHint & rHint) Line 2246
  mergedlo.dll!SfxBroadcaster::Broadcast(const SfxHint & rHint) Line 36
  mergedlo.dll!SbxVariable::Broadcast(SfxHintId nHintId) Line 155
  mergedlo.dll!SbxValue::SbxValue(const SbxValue & r) Line 68
  mergedlo.dll!SbxVariable::SbxVariable(const SbxVariable & r) Line 49
  mergedlo.dll!SbxMethod::SbxMethod(const SbxMethod & r) Line 847
  mergedlo.dll!SbiRuntime::FindElement(SbxObject * pObj, unsigned long nOp1, unsigned long nOp2, ErrCode nNotFound, bool bLocal, bool bStatic) Line 3703
  mergedlo.dll!SbiRuntime::StepELEM(unsigned long nOp1, unsigned long nOp2) Line 4189
  mergedlo.dll!SbiRuntime::Step() Line 811
  [Inline Frame] mergedlo.dll!`anonymous-namespace'::RunInitGuard::run() Line 1017
  mergedlo.dll!SbModule::Run(SbMethod * pMeth) Line 1177
  mergedlo.dll!SbModule::Notify(SfxBroadcaster & rBC, const SfxHint & rHint) Line 776
  mergedlo.dll!SfxBroadcaster::Broadcast(const SfxHint & rHint) Line 36
  mergedlo.dll!SbMethod::Broadcast(SfxHintId nHintId) Line 2121
  mergedlo.dll!SbxValue::Get(SbxValues & rRes) Line 290
  mergedlo.dll!SbMethod::Call(SbxValue * pRet, SbxVariable * pCaller) Line 2078
  mergedlo.dll!basprov::BasicScriptImpl::invoke(const com::sun::star::uno::Sequence<com::sun::star::uno::Any> & aParams, com::sun::star::uno::Sequence<short> & aOutParamIndex, com::sun::star::uno::Sequence<com::sun::star::uno::Any> & aOutParam) Line 264
  mergedlo.dll!SfxObjectShell::CallXScript(const com::sun::star::uno::Reference<com::sun::star::uno::XInterface> & _rxScriptContext, const rtl::OUString & _rScriptURL, const com::sun::star::uno::Sequence<com::sun::star::uno::Any> & aParams, com::sun::star::uno::Any & aRet, com::sun::star::uno::Sequence<short> & aOutParamIndex, com::sun::star::uno::Sequence<com::sun::star::uno::Any> & aOutParam, bool bRaiseError, const com::sun::star::uno::Any * pCaller) Line 1545
  mergedlo.dll!SfxApplication::OfaExec_Impl::__l120::<lambda_2>::operator()(long nDialogResult) Line 1768
  [Inline Frame] mergedlo.dll!std::_Func_class<void,long>::operator()(long <_Args_0>) Line 869
  mergedlo.dll!Dialog::EndDialog(__int64 nResult) Line 1212
  [Inline Frame] mergedlo.dll!Link<weld::Button &,void>::Call(weld::Button &) Line 111
  [Inline Frame] mergedlo.dll!weld::Button::signal_clicked() Line 1508
  [Inline Frame] mergedlo.dll!SalInstanceButton::ClickHdl(Button *) Line 2941
  mergedlo.dll!SalInstanceButton::LinkStubClickHdl(void * instance, Button * data) Line 2929
  [Inline Frame] mergedlo.dll!std::_Func_class<void>::operator()() Line 869
  [Inline Frame] mergedlo.dll!Control::ImplCallEventListenersAndHandler(VclEventId) Line 311
  mergedlo.dll!Button::Click() Line 130
  mergedlo.dll!PushButton::Tracking(const TrackingEvent & rTEvt) Line 1324
  mergedlo.dll!vcl::Window::EndTracking(TrackingEventFlags nFlags) Line 341
  mergedlo.dll!ImplHandleMouseEvent(const VclPtr<vcl::Window> & xWindow, NotifyEventType nSVEvent, bool bMouseLeave, __int64 nX, __int64 nY, unsigned __int64 nMsgTime, unsigned short nCode, MouseEventModifiers nMode) Line 715
  mergedlo.dll!ImplHandleSalMouseButtonUp(vcl::Window * pWindow, const SalMouseEvent * pEvent) Line 2353
  mergedlo.dll!ImplWindowFrameProc(vcl::Window * _pWindow, SalEvent nEvent, const void * pEvent) Line 2702
  mergedlo.dll!SalFrame::CallCallback(SalEvent nEvent, const void * pEvent) Line 312
  vclplug_winlo.dll!ImplHandleMouseMsg(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 3318
  vclplug_winlo.dll!SalFrameWndProc(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam, bool & rDef) Line 5876
  vclplug_winlo.dll!SalFrameWndProcW(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 6231
  user32.dll!UserCallWinProcCheckWow(struct _ACTIVATION_CONTEXT *,__int64 (*)(struct tagWND *,unsigned int,unsigned __int64,__int64),struct HWND__ *,enum _WM_VALUE,unsigned __int64,__int64,void *,int)
  user32.dll!DispatchMessageWorker()
  vclplug_winlo.dll!ImplSalDispatchMessage(const tagMSG * pMsg) Line 476
  vclplug_winlo.dll!ImplSalYield(bool bWait, bool bHandleAllCurrentEvents) Line 552
  vclplug_winlo.dll!WinSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents) Line 581
  mergedlo.dll!ImplYield(bool i_bWait, bool i_bAllEvents) Line 387
  mergedlo.dll!Application::Execute() Line 360
  mergedlo.dll!desktop::Desktop::Main() Line 1652
  mergedlo.dll!ImplSVMain() Line 229
  [Inline Frame] mergedlo.dll!SVMain() Line 247
  mergedlo.dll!soffice_main() Line 99
  [Inline Frame] soffice.bin!sal_main() Line 51
  soffice.bin!main(int argc, char * * argv) Line 49
  [Inline Frame] soffice.bin!invoke_main() Line 78
  soffice.bin!__scrt_common_main_seh() Line 288
  kernel32.dll!BaseThreadInitThunk()
  ntdll.dll!RtlUserThreadStart()

2. Clipboard thread:

  ntdll.dll!NtWaitForAlertByThreadId()
  ntdll.dll!RtlpWaitOnCriticalSection()
  ntdll.dll!RtlpEnterCriticalSectionContended()
  ntdll.dll!RtlEnterCriticalSection()
  sal3.dll!osl_acquireMutex(_oslMutexImpl * Mutex) Line 65
  [Inline Frame] vclplug_winlo.dll!osl::Mutex::acquire() Line 63
  vclplug_winlo.dll!SalYieldMutex::doAcquire(unsigned long nLockCount) Line 148
  [Inline Frame] mergedlo.dll!comphelper::SolarMutex::acquire(unsigned long) Line 86
  [Inline Frame] mergedlo.dll!osl::Guard<comphelper::SolarMutex>::{ctor}(comphelper::SolarMutex & t) Line 144
  [Inline Frame] mergedlo.dll!SolarMutexGuard::{ctor}() Line 1340
  mergedlo.dll!TransferableHelper::getTransferDataFlavors() Line 477
  vclplug_winlo.dll!CFormatRegistrar::RegisterFormats(const com::sun::star::uno::Reference<com::sun::star::datatransfer::XTransferable> & aXTransferable, CFormatEtcContainer & aFormatEtcContainer) Line 145
  [Inline Frame] vclplug_winlo.dll!CXTDataObject::InitializeFormatEtcContainer() Line 648
  vclplug_winlo.dll!CXTDataObject::EnumFormatEtc(unsigned long dwDirection, IEnumFORMATETC * * ppenumFormatetc) Line 549
  ole32.dll!SetClipboardFormats(HWND__ * hClipWnd, IDataObject * pDataObj) Line 4482
  ole32.dll!OleSetClipboardInternal(IDataObject * pDataObject, IDataObject * pSourceDataObject, void * * ppDataObjectMTAAddress, const wchar_t * pszCallerPackageFullName, unsigned long pid) Line 3750
  ole32.dll!OleSetClipboard(IDataObject * pDataObject) Line 3602
  [Inline Frame] vclplug_winlo.dll!CMtaOleClipboard::onSetClipboard::__l2::<lambda_1>::operator()() Line 464
  [Inline Frame] vclplug_winlo.dll!sal::systools::RetryIfFailed(unsigned int) Line 31
  [Inline Frame] vclplug_winlo.dll!CMtaOleClipboard::onSetClipboard(IDataObject *) Line 463
  vclplug_winlo.dll!CMtaOleClipboard::mtaOleReqWndProc(HWND__ * hWnd, unsigned int uMsg, unsigned __int64 wParam, __int64 lParam) Line 541
  user32.dll!UserCallWinProcCheckWow(struct _ACTIVATION_CONTEXT *,__int64 (*)(struct tagWND *,unsigned int,unsigned __int64,__int64),struct HWND__ *,enum _WM_VALUE,unsigned __int64,__int64,void *,int)
  user32.dll!DispatchMessageWorker()
  [Inline Frame] vclplug_winlo.dll!CMtaOleClipboard::run() Line 668
  vclplug_winlo.dll!CMtaOleClipboard::oleThreadProc(void * pParam) Line 685
  ucrtbase.dll!thread_start<unsigned int (__cdecl*)(void *),1>()
  kernel32.dll!BaseThreadInitThunk()
  ntdll.dll!RtlUserThreadStart()

3. Clipboard content changed notification thread:

  win32u.dll!NtUserMsgWaitForMultipleObjectsEx()
  combase.dll!CCliModalLoop::BlockFn(void * * ahEvent, unsigned long cEvents, unsigned long * lpdwSignaled) Line 2105
  combase.dll!ModalLoop(CSyncClientCall * pClientCall) Line 171
  combase.dll!ClassicSTAThreadDispatchCrossApartmentCall(tagRPCOLEMESSAGE * pMessage, OXIDEntry * pOXIDEntry, CSyncClientCall * pClientCall) Line 324
  [Inline Frame] combase.dll!CSyncClientCall::SwitchAptAndDispatchCall(tagRPCOLEMESSAGE * pMessage) Line 5704
  combase.dll!CSyncClientCall::SendReceive2(tagRPCOLEMESSAGE * pMessage, unsigned long * pstatus) Line 5310
  [Inline Frame] combase.dll!SyncClientCallRetryContext::SendReceiveWithRetry(tagRPCOLEMESSAGE *) Line 1493
  [Inline Frame] combase.dll!CSyncClientCall::SendReceiveInRetryContext(SyncClientCallRetryContext *) Line 581
  combase.dll!ClassicSTAThreadSendReceive(CSyncClientCall * pClientCall, tagRPCOLEMESSAGE * pMsg, unsigned long * pulStatus) Line 563
  combase.dll!CSyncClientCall::SendReceive(tagRPCOLEMESSAGE * pMessage, unsigned long * pulStatus) Line 797
  [Inline Frame] combase.dll!CClientChannel::SendReceive(tagRPCOLEMESSAGE *) Line 674
  combase.dll!NdrExtpProxySendReceive(void * pThis, _MIDL_STUB_MESSAGE * pStubMsg) Line 1899
  rpcrt4.dll!NdrpClientCall3()
  combase.dll!ObjectStublessClient(void * ParamAddress, __int64 * FloatRegisters, long Method) Line 366
  combase.dll!ObjectStubless() Line 176
  [Inline Frame] combase.dll!RemoteReleaseRifRefHelper(IRemUnknown *) Line 8720
  combase.dll!RemoteReleaseRifRef(CStdMarshal * pMarshal, OXIDEntry * pOXIDEntry, unsigned short cRifRef, tagREMINTERFACEREF * pRifRef) Line 8627
  combase.dll!CStdMarshal::DisconnectCliIPIDs(unsigned long) Line 5357
  combase.dll!CStdMarshal::DisconnectWorker_ReleasesLock(unsigned long dwType, bool logEventIsActive, CObjectContext * explicitServerContext, bool performCallback, CIDObject * pIDDelayRelease, const void *) Line 4676
  combase.dll!CStdMarshal::Disconnect(unsigned long dwType, const void * callerAddressForDiagnostics) Line 4441
  combase.dll!CStdIdentity::~CStdIdentity() Line 388
  combase.dll!CStdIdentity::`scalar deleting destructor'(unsigned int)
  [Inline Frame] combase.dll!CStdIdentity::CInternalUnk::ReleaseWithCallerAddress(const void *) Line 945
  combase.dll!CStdIdentity::CInternalUnk::Release() Line 851
  [Inline Frame] vclplug_winlo.dll!sal::systools::COMReference<IDataObject>::release(IDataObject * ptr) Line 229
  [Inline Frame] vclplug_winlo.dll!sal::systools::COMReference<IDataObject>::{dtor}() Line 158
  [Inline Frame] vclplug_winlo.dll!CAPNDataObject::{dtor}() Line 97
  vclplug_winlo.dll!CAPNDataObject::`scalar deleting destructor'(unsigned int)
  vclplug_winlo.dll!CAPNDataObject::Release() Line 140
  [Inline Frame] vclplug_winlo.dll!sal::systools::COMReference<IDataObject>::release(IDataObject * ptr) Line 229
  [Inline Frame] vclplug_winlo.dll!sal::systools::COMReference<IDataObject>::{dtor}() Line 158
  vclplug_winlo.dll!CDOTransferable::`scalar deleting destructor'(unsigned int)
  [Inline Frame] vclplug_winlo.dll!com::sun::star::uno::Reference<com::sun::star::datatransfer::XTransferable>::{dtor}() Line 114
  vclplug_winlo.dll!CWinClipboard::handleClipboardContentChanged() Line 330
  vclplug_winlo.dll!CWinClipboard::onClipboardContentChanged() Line 412
  vclplug_winlo.dll!CMtaOleClipboard::clipboardChangedNotifierThreadProc(void * pParam) Line 699
  ucrtbase.dll!thread_start<unsigned int (__cdecl*)(void *),1>()
  kernel32.dll!BaseThreadInitThunk()
  ntdll.dll!RtlUserThreadStart()

Thread #3 has locked m_aMutex in CWinClipboard::handleClipboardContentChanged, and
tries to destroy CDOTransferable in the reference dtor. That delegates to another
thread (not entirely clear which, but could be either thread #1 or #2); at this
point, thread #1 is in CWinClipboard::getContents waiting for the same m_aMutex,
and thread #2 is in TransferableHelper::getTransferDataFlavors, waiting for the
solar mutex (locked by VCL main thread in basprov::BasicScriptImpl::invoke).

This change releases m_aMutex in CWinClipboard::handleClipboardContentChanged as
soon as it in not needed anymore. This aligns with comment several lines above,
telling that transferables must be destroyed only outside of the mutex lock.

Change-Id: I9faf254930a8913d1621f5ed504aeb369b37adfc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179984
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Jan 9, 2025
The minidump in the bug (https://bugs.documentfoundation.org/attachment.cgi?id=198431)
shows these three stacks:

1. VCL main thread:

  ntdll.dll!NtWaitForAlertByThreadId()
  ntdll.dll!RtlpAcquireSRWLockExclusiveContended()
  ntdll.dll!RtlAcquireSRWLockExclusive()
  msvcp140.dll!mtx_do_lock(_Mtx_internal_imp_t * mtx, const xtime * target) Line 103
  [Inline Frame] vclplug_winlo.dll!std::_Mutex_base::lock() Line 50
  [Inline Frame] vclplug_winlo.dll!std::unique_lock<std::mutex>::{ctor}(std::mutex &) Line 133
  vclplug_winlo.dll!CWinClipboard::getContents() Line 125
  sclo.dll!ScTabViewShell::GetClipData(vcl::Window * pWin) Line 542
  [Inline Frame] vbaobjlo.dll!ooo::vba::excel::implnPasteSpecial(const com::sun::star::uno::Reference<com::sun::star::frame::XModel> &) Line 235
  vbaobjlo.dll!ScVbaRange::PasteSpecial(const com::sun::star::uno::Any & Paste, const com::sun::star::uno::Any & Operation, const com::sun::star::uno::Any & SkipBlanks, const com::sun::star::uno::Any & Transpose) Line 2942
  mscx_uno.dll!`anonymous namespace'::cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, bridges::cpp_uno::shared::VtableSlot aVtableSlot, _typelib_TypeDescriptionReference * pReturnTypeRef, long nParams, _typelib_MethodParameter * pParams, void * pUnoReturn, void * * pUnoArgs, _uno_Any * * ppUnoExc) Line 214
  mscx_uno.dll!unoInterfaceProxyDispatch(_uno_Interface * pUnoI, const _typelib_TypeDescription * pMemberTD, void * pReturn, void * * pArgs, _uno_Any * * ppException) Line 430
  reflectionlo.dll!stoc_corefl::`anonymous namespace'::IdlInterfaceMethodImpl::invoke(const com::sun::star::uno::Any & rObj, com::sun::star::uno::Sequence<com::sun::star::uno::Any> & rArgs) Line 593
  mergedlo.dll!SbUnoObject::Notify(SfxBroadcaster & rBC, const SfxHint & rHint) Line 2246
  mergedlo.dll!SfxBroadcaster::Broadcast(const SfxHint & rHint) Line 36
  mergedlo.dll!SbxVariable::Broadcast(SfxHintId nHintId) Line 155
  mergedlo.dll!SbxValue::SbxValue(const SbxValue & r) Line 68
  mergedlo.dll!SbxVariable::SbxVariable(const SbxVariable & r) Line 49
  mergedlo.dll!SbxMethod::SbxMethod(const SbxMethod & r) Line 847
  mergedlo.dll!SbiRuntime::FindElement(SbxObject * pObj, unsigned long nOp1, unsigned long nOp2, ErrCode nNotFound, bool bLocal, bool bStatic) Line 3703
  mergedlo.dll!SbiRuntime::StepELEM(unsigned long nOp1, unsigned long nOp2) Line 4189
  mergedlo.dll!SbiRuntime::Step() Line 811
  [Inline Frame] mergedlo.dll!`anonymous-namespace'::RunInitGuard::run() Line 1017
  mergedlo.dll!SbModule::Run(SbMethod * pMeth) Line 1177
  mergedlo.dll!SbModule::Notify(SfxBroadcaster & rBC, const SfxHint & rHint) Line 776
  mergedlo.dll!SfxBroadcaster::Broadcast(const SfxHint & rHint) Line 36
  mergedlo.dll!SbMethod::Broadcast(SfxHintId nHintId) Line 2121
  mergedlo.dll!SbxValue::Get(SbxValues & rRes) Line 290
  mergedlo.dll!SbMethod::Call(SbxValue * pRet, SbxVariable * pCaller) Line 2078
  mergedlo.dll!basprov::BasicScriptImpl::invoke(const com::sun::star::uno::Sequence<com::sun::star::uno::Any> & aParams, com::sun::star::uno::Sequence<short> & aOutParamIndex, com::sun::star::uno::Sequence<com::sun::star::uno::Any> & aOutParam) Line 264
  mergedlo.dll!SfxObjectShell::CallXScript(const com::sun::star::uno::Reference<com::sun::star::uno::XInterface> & _rxScriptContext, const rtl::OUString & _rScriptURL, const com::sun::star::uno::Sequence<com::sun::star::uno::Any> & aParams, com::sun::star::uno::Any & aRet, com::sun::star::uno::Sequence<short> & aOutParamIndex, com::sun::star::uno::Sequence<com::sun::star::uno::Any> & aOutParam, bool bRaiseError, const com::sun::star::uno::Any * pCaller) Line 1545
  mergedlo.dll!SfxApplication::OfaExec_Impl::__l120::<lambda_2>::operator()(long nDialogResult) Line 1768
  [Inline Frame] mergedlo.dll!std::_Func_class<void,long>::operator()(long <_Args_0>) Line 869
  mergedlo.dll!Dialog::EndDialog(__int64 nResult) Line 1212
  [Inline Frame] mergedlo.dll!Link<weld::Button &,void>::Call(weld::Button &) Line 111
  [Inline Frame] mergedlo.dll!weld::Button::signal_clicked() Line 1508
  [Inline Frame] mergedlo.dll!SalInstanceButton::ClickHdl(Button *) Line 2941
  mergedlo.dll!SalInstanceButton::LinkStubClickHdl(void * instance, Button * data) Line 2929
  [Inline Frame] mergedlo.dll!std::_Func_class<void>::operator()() Line 869
  [Inline Frame] mergedlo.dll!Control::ImplCallEventListenersAndHandler(VclEventId) Line 311
  mergedlo.dll!Button::Click() Line 130
  mergedlo.dll!PushButton::Tracking(const TrackingEvent & rTEvt) Line 1324
  mergedlo.dll!vcl::Window::EndTracking(TrackingEventFlags nFlags) Line 341
  mergedlo.dll!ImplHandleMouseEvent(const VclPtr<vcl::Window> & xWindow, NotifyEventType nSVEvent, bool bMouseLeave, __int64 nX, __int64 nY, unsigned __int64 nMsgTime, unsigned short nCode, MouseEventModifiers nMode) Line 715
  mergedlo.dll!ImplHandleSalMouseButtonUp(vcl::Window * pWindow, const SalMouseEvent * pEvent) Line 2353
  mergedlo.dll!ImplWindowFrameProc(vcl::Window * _pWindow, SalEvent nEvent, const void * pEvent) Line 2702
  mergedlo.dll!SalFrame::CallCallback(SalEvent nEvent, const void * pEvent) Line 312
  vclplug_winlo.dll!ImplHandleMouseMsg(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 3318
  vclplug_winlo.dll!SalFrameWndProc(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam, bool & rDef) Line 5876
  vclplug_winlo.dll!SalFrameWndProcW(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 6231
  user32.dll!UserCallWinProcCheckWow(struct _ACTIVATION_CONTEXT *,__int64 (*)(struct tagWND *,unsigned int,unsigned __int64,__int64),struct HWND__ *,enum _WM_VALUE,unsigned __int64,__int64,void *,int)
  user32.dll!DispatchMessageWorker()
  vclplug_winlo.dll!ImplSalDispatchMessage(const tagMSG * pMsg) Line 476
  vclplug_winlo.dll!ImplSalYield(bool bWait, bool bHandleAllCurrentEvents) Line 552
  vclplug_winlo.dll!WinSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents) Line 581
  mergedlo.dll!ImplYield(bool i_bWait, bool i_bAllEvents) Line 387
  mergedlo.dll!Application::Execute() Line 360
  mergedlo.dll!desktop::Desktop::Main() Line 1652
  mergedlo.dll!ImplSVMain() Line 229
  [Inline Frame] mergedlo.dll!SVMain() Line 247
  mergedlo.dll!soffice_main() Line 99
  [Inline Frame] soffice.bin!sal_main() Line 51
  soffice.bin!main(int argc, char * * argv) Line 49
  [Inline Frame] soffice.bin!invoke_main() Line 78
  soffice.bin!__scrt_common_main_seh() Line 288
  kernel32.dll!BaseThreadInitThunk()
  ntdll.dll!RtlUserThreadStart()

2. Clipboard thread:

  ntdll.dll!NtWaitForAlertByThreadId()
  ntdll.dll!RtlpWaitOnCriticalSection()
  ntdll.dll!RtlpEnterCriticalSectionContended()
  ntdll.dll!RtlEnterCriticalSection()
  sal3.dll!osl_acquireMutex(_oslMutexImpl * Mutex) Line 65
  [Inline Frame] vclplug_winlo.dll!osl::Mutex::acquire() Line 63
  vclplug_winlo.dll!SalYieldMutex::doAcquire(unsigned long nLockCount) Line 148
  [Inline Frame] mergedlo.dll!comphelper::SolarMutex::acquire(unsigned long) Line 86
  [Inline Frame] mergedlo.dll!osl::Guard<comphelper::SolarMutex>::{ctor}(comphelper::SolarMutex & t) Line 144
  [Inline Frame] mergedlo.dll!SolarMutexGuard::{ctor}() Line 1340
  mergedlo.dll!TransferableHelper::getTransferDataFlavors() Line 477
  vclplug_winlo.dll!CFormatRegistrar::RegisterFormats(const com::sun::star::uno::Reference<com::sun::star::datatransfer::XTransferable> & aXTransferable, CFormatEtcContainer & aFormatEtcContainer) Line 145
  [Inline Frame] vclplug_winlo.dll!CXTDataObject::InitializeFormatEtcContainer() Line 648
  vclplug_winlo.dll!CXTDataObject::EnumFormatEtc(unsigned long dwDirection, IEnumFORMATETC * * ppenumFormatetc) Line 549
  ole32.dll!SetClipboardFormats(HWND__ * hClipWnd, IDataObject * pDataObj) Line 4482
  ole32.dll!OleSetClipboardInternal(IDataObject * pDataObject, IDataObject * pSourceDataObject, void * * ppDataObjectMTAAddress, const wchar_t * pszCallerPackageFullName, unsigned long pid) Line 3750
  ole32.dll!OleSetClipboard(IDataObject * pDataObject) Line 3602
  [Inline Frame] vclplug_winlo.dll!CMtaOleClipboard::onSetClipboard::__l2::<lambda_1>::operator()() Line 464
  [Inline Frame] vclplug_winlo.dll!sal::systools::RetryIfFailed(unsigned int) Line 31
  [Inline Frame] vclplug_winlo.dll!CMtaOleClipboard::onSetClipboard(IDataObject *) Line 463
  vclplug_winlo.dll!CMtaOleClipboard::mtaOleReqWndProc(HWND__ * hWnd, unsigned int uMsg, unsigned __int64 wParam, __int64 lParam) Line 541
  user32.dll!UserCallWinProcCheckWow(struct _ACTIVATION_CONTEXT *,__int64 (*)(struct tagWND *,unsigned int,unsigned __int64,__int64),struct HWND__ *,enum _WM_VALUE,unsigned __int64,__int64,void *,int)
  user32.dll!DispatchMessageWorker()
  [Inline Frame] vclplug_winlo.dll!CMtaOleClipboard::run() Line 668
  vclplug_winlo.dll!CMtaOleClipboard::oleThreadProc(void * pParam) Line 685
  ucrtbase.dll!thread_start<unsigned int (__cdecl*)(void *),1>()
  kernel32.dll!BaseThreadInitThunk()
  ntdll.dll!RtlUserThreadStart()

3. Clipboard content changed notification thread:

  win32u.dll!NtUserMsgWaitForMultipleObjectsEx()
  combase.dll!CCliModalLoop::BlockFn(void * * ahEvent, unsigned long cEvents, unsigned long * lpdwSignaled) Line 2105
  combase.dll!ModalLoop(CSyncClientCall * pClientCall) Line 171
  combase.dll!ClassicSTAThreadDispatchCrossApartmentCall(tagRPCOLEMESSAGE * pMessage, OXIDEntry * pOXIDEntry, CSyncClientCall * pClientCall) Line 324
  [Inline Frame] combase.dll!CSyncClientCall::SwitchAptAndDispatchCall(tagRPCOLEMESSAGE * pMessage) Line 5704
  combase.dll!CSyncClientCall::SendReceive2(tagRPCOLEMESSAGE * pMessage, unsigned long * pstatus) Line 5310
  [Inline Frame] combase.dll!SyncClientCallRetryContext::SendReceiveWithRetry(tagRPCOLEMESSAGE *) Line 1493
  [Inline Frame] combase.dll!CSyncClientCall::SendReceiveInRetryContext(SyncClientCallRetryContext *) Line 581
  combase.dll!ClassicSTAThreadSendReceive(CSyncClientCall * pClientCall, tagRPCOLEMESSAGE * pMsg, unsigned long * pulStatus) Line 563
  combase.dll!CSyncClientCall::SendReceive(tagRPCOLEMESSAGE * pMessage, unsigned long * pulStatus) Line 797
  [Inline Frame] combase.dll!CClientChannel::SendReceive(tagRPCOLEMESSAGE *) Line 674
  combase.dll!NdrExtpProxySendReceive(void * pThis, _MIDL_STUB_MESSAGE * pStubMsg) Line 1899
  rpcrt4.dll!NdrpClientCall3()
  combase.dll!ObjectStublessClient(void * ParamAddress, __int64 * FloatRegisters, long Method) Line 366
  combase.dll!ObjectStubless() Line 176
  [Inline Frame] combase.dll!RemoteReleaseRifRefHelper(IRemUnknown *) Line 8720
  combase.dll!RemoteReleaseRifRef(CStdMarshal * pMarshal, OXIDEntry * pOXIDEntry, unsigned short cRifRef, tagREMINTERFACEREF * pRifRef) Line 8627
  combase.dll!CStdMarshal::DisconnectCliIPIDs(unsigned long) Line 5357
  combase.dll!CStdMarshal::DisconnectWorker_ReleasesLock(unsigned long dwType, bool logEventIsActive, CObjectContext * explicitServerContext, bool performCallback, CIDObject * pIDDelayRelease, const void *) Line 4676
  combase.dll!CStdMarshal::Disconnect(unsigned long dwType, const void * callerAddressForDiagnostics) Line 4441
  combase.dll!CStdIdentity::~CStdIdentity() Line 388
  combase.dll!CStdIdentity::`scalar deleting destructor'(unsigned int)
  [Inline Frame] combase.dll!CStdIdentity::CInternalUnk::ReleaseWithCallerAddress(const void *) Line 945
  combase.dll!CStdIdentity::CInternalUnk::Release() Line 851
  [Inline Frame] vclplug_winlo.dll!sal::systools::COMReference<IDataObject>::release(IDataObject * ptr) Line 229
  [Inline Frame] vclplug_winlo.dll!sal::systools::COMReference<IDataObject>::{dtor}() Line 158
  [Inline Frame] vclplug_winlo.dll!CAPNDataObject::{dtor}() Line 97
  vclplug_winlo.dll!CAPNDataObject::`scalar deleting destructor'(unsigned int)
  vclplug_winlo.dll!CAPNDataObject::Release() Line 140
  [Inline Frame] vclplug_winlo.dll!sal::systools::COMReference<IDataObject>::release(IDataObject * ptr) Line 229
  [Inline Frame] vclplug_winlo.dll!sal::systools::COMReference<IDataObject>::{dtor}() Line 158
  vclplug_winlo.dll!CDOTransferable::`scalar deleting destructor'(unsigned int)
  [Inline Frame] vclplug_winlo.dll!com::sun::star::uno::Reference<com::sun::star::datatransfer::XTransferable>::{dtor}() Line 114
  vclplug_winlo.dll!CWinClipboard::handleClipboardContentChanged() Line 330
  vclplug_winlo.dll!CWinClipboard::onClipboardContentChanged() Line 412
  vclplug_winlo.dll!CMtaOleClipboard::clipboardChangedNotifierThreadProc(void * pParam) Line 699
  ucrtbase.dll!thread_start<unsigned int (__cdecl*)(void *),1>()
  kernel32.dll!BaseThreadInitThunk()
  ntdll.dll!RtlUserThreadStart()

Thread #3 has locked m_aMutex in CWinClipboard::handleClipboardContentChanged, and
tries to destroy CDOTransferable in the reference dtor. That delegates to another
thread (not entirely clear which, but could be either thread #1 or #2); at this
point, thread #1 is in CWinClipboard::getContents waiting for the same m_aMutex,
and thread #2 is in TransferableHelper::getTransferDataFlavors, waiting for the
solar mutex (locked by VCL main thread in basprov::BasicScriptImpl::invoke).

This change releases m_aMutex in CWinClipboard::handleClipboardContentChanged as
soon as it in not needed anymore. This aligns with comment several lines above,
telling that transferables must be destroyed only outside of the mutex lock.

Change-Id: I9faf254930a8913d1621f5ed504aeb369b37adfc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179984
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <[email protected]>
(cherry picked from commit 171acae)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179992
Reviewed-by: Michael Stahl <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Jan 10, 2025
...when generating Python/deepfreeze/deepfreeze.c during the build of
ExternalProject_python3 after 5052448 "Python:
upgrade to 3.11.11 (master only)",

> Objects/dictobject.c:1500:40: runtime error: load of misaligned address 0x555853494d81 for type 'PyDictUnicodeEntry *', which requires 8 byte alignment
> 0x555853494d81: note: pointer points here
>  00 00 00  ff ff ff ff ff ff ff ff  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00
>               ^
>  #0 in dictresize at workdir/UnpackedTarball/python3/Objects/dictobject.c:1500:21
>  #1 in dict_merge at workdir/UnpackedTarball/python3/Objects/dictobject.c:2880:17
>  #2 in _PyDict_MergeEx at workdir/UnpackedTarball/python3/Objects/dictobject.c:3003:12
>  #3 in _PyEval_EvalFrameDefault at workdir/UnpackedTarball/python3/Python/ceval.c:3432:17
>  #4 in _PyEval_EvalFrame at workdir/UnpackedTarball/python3/./Include/internal/pycore_ceval.h:73:16
>  #5 in _PyEval_Vector at workdir/UnpackedTarball/python3/Python/ceval.c:6434:24
>  #6 in _PyFunction_Vectorcall at workdir/UnpackedTarball/python3/Objects/call.c:393:16
>  #7 in _PyObject_FastCallDictTstate at workdir/UnpackedTarball/python3/Objects/call.c:141:15
>  #8 in _PyObject_Call_Prepend at workdir/UnpackedTarball/python3/Objects/call.c:482:24
>  #9 in slot_tp_init at workdir/UnpackedTarball/python3/Objects/typeobject.c:7855:15
>  #10 in type_call at workdir/UnpackedTarball/python3/Objects/typeobject.c:1103:19
>  #11 in _PyObject_MakeTpCall at workdir/UnpackedTarball/python3/Objects/call.c:214:18
>  #12 in _PyObject_VectorcallTstate at workdir/UnpackedTarball/python3/./Include/internal/pycore_call.h:90:16
>  #13 in PyObject_Vectorcall at workdir/UnpackedTarball/python3/Objects/call.c:299:12
>  #14 in _PyEval_EvalFrameDefault at workdir/UnpackedTarball/python3/Python/ceval.c:4769:23
>  #15 in _PyEval_EvalFrame at workdir/UnpackedTarball/python3/./Include/internal/pycore_ceval.h:73:16
>  #16 in _PyEval_Vector at workdir/UnpackedTarball/python3/Python/ceval.c:6434:24
>  #17 in PyEval_EvalCode at workdir/UnpackedTarball/python3/Python/ceval.c:1148:21
>  #18 in run_eval_code_obj at workdir/UnpackedTarball/python3/Python/pythonrun.c:1741:9
>  #19 in run_mod at workdir/UnpackedTarball/python3/Python/pythonrun.c:1762:19
>  #20 in pyrun_file at workdir/UnpackedTarball/python3/Python/pythonrun.c:1657:15
>  #21 in _PyRun_SimpleFileObject at workdir/UnpackedTarball/python3/Python/pythonrun.c:440:13
>  #22 in _PyRun_AnyFileObject at workdir/UnpackedTarball/python3/Python/pythonrun.c:79:15
>  #23 in pymain_run_file_obj at workdir/UnpackedTarball/python3/Modules/main.c:360:15
>  #24 in pymain_run_file at workdir/UnpackedTarball/python3/Modules/main.c:379:15
>  #25 in pymain_run_python at workdir/UnpackedTarball/python3/Modules/main.c:605:21
>  #26 in Py_RunMain at workdir/UnpackedTarball/python3/Modules/main.c:684:5
>  #27 in main at workdir/UnpackedTarball/python3/Programs/_bootstrap_python.c:109:12

Change-Id: I0bacef11b5874bca6104516a206076a0505528ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180037
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <[email protected]>
tdf-gerrit pushed a commit that referenced this pull request Jan 12, 2025
maybe since:

commit 8cb4db9
CommitDate: Wed Aug 31 08:29:49 2022 +0200

    tdf#30731: Improve caret travelling in Writer

 #3  0x00007ffff74dabf0 in std::__glibcxx_assert_fail(char const*, int, char const*, char const*) () at /lib64/libstdc++.so.6
 #4  0x00007fffce3e97b3 in std::clamp<int> (__val=@0x7ffffffe52b4: 1897, __lo=@0x7ffffffe51f0: 1900, __hi=@0x7ffffffe51e8: 1897)
     at /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/stl_algo.h:3625
 #5  0x00007fffce3e41ff in GetTextArray
     (rDevice=..., rStr='x' <repeats 200 times>..., rDXAry=std::__debug::vector of length 0, capacity 0, nIndex=1875, nLen=25, nLayoutContext=std::optional = {...}, nMaxAscent=0x7ffffffe5680, nMaxDescent=0x7ffffffe5678, bCaret=true, layoutCache=0x0) at core/sw/source/core/txtnode/fntcache.cxx:763
 #6  0x00007fffce3e2a47 in SwFntObj::GetTextSize (this=0x6134340, rInf=...) at core/sw/source/core/txtnode/fntcache.cxx:1734
 #7  0x00007fffce461147 in SwSubFont::GetTextSize_ (this=0x6281450, rInf=...) at core/sw/source/core/txtnode/swfont.cxx:1039
 #8  0x00007fffce1f953c in SwFont::GetTextSize_ (this=0x6281450, rInf=...) at sw/source/core/inc/swfont.hxx:321
 #9  0x00007fffce2234e2 in SwTextSizeInfo::GetTextSize (this=0x7ffffffe6b80, nLayoutContext=std::optional = {...}) at core/sw/source/core/text/inftxt.cxx:439
 #10 0x00007fffce2f2217 in SwTextPortion::GetTextSize (this=0x62a3d40, rInf=...) at core/sw/source/core/text/portxt.cxx:586
 #11 0x00007fffce250b8c in SwTextCursor::GetCharRect_ (this=0x7ffffffe6fc8, pOrig=0x7ffffffe81c8, nOfst=..., pCMS=0x7ffffffe6e20) at core/sw/source/core/text/itrcrsr.cxx:956
 #12 0x00007fffce24d978 in SwTextCursor::GetCharRect (this=0x7ffffffe6fc8, pOrig=0x7ffffffe81c8, nOfst=..., pCMS=0x7ffffffe6e20, nMax=20604)
     at core/sw/source/core/text/itrcrsr.cxx:1281
 #13 0x00007fffce1f08c1 in SwTextFrame::GetAutoPos (this=0x6259250, rOrig=SwRect = {...}, rPos=SwPosition (node 28, offset 1897)) at core/sw/source/core/text/frmcrsr.cxx:430

Change-Id: I8230c9cbb99126b513bea38517b1dbfac5a50f4b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180131
Reviewed-by: Caolán McNamara <[email protected]>
Tested-by: Jenkins
tdf-gerrit pushed a commit that referenced this pull request Jan 13, 2025
maybe since:

commit 8cb4db9
CommitDate: Wed Aug 31 08:29:49 2022 +0200

    tdf#30731: Improve caret travelling in Writer

 #3  0x00007ffff74dabf0 in std::__glibcxx_assert_fail(char const*, int, char const*, char const*) () at /lib64/libstdc++.so.6
 #4  0x00007fffce3e97b3 in std::clamp<int> (__val=@0x7ffffffe52b4: 1897, __lo=@0x7ffffffe51f0: 1900, __hi=@0x7ffffffe51e8: 1897)
     at /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/stl_algo.h:3625
 #5  0x00007fffce3e41ff in GetTextArray
     (rDevice=..., rStr='x' <repeats 200 times>..., rDXAry=std::__debug::vector of length 0, capacity 0, nIndex=1875, nLen=25, nLayoutContext=std::optional = {...}, nMaxAscent=0x7ffffffe5680, nMaxDescent=0x7ffffffe5678, bCaret=true, layoutCache=0x0) at core/sw/source/core/txtnode/fntcache.cxx:763
 #6  0x00007fffce3e2a47 in SwFntObj::GetTextSize (this=0x6134340, rInf=...) at core/sw/source/core/txtnode/fntcache.cxx:1734
 #7  0x00007fffce461147 in SwSubFont::GetTextSize_ (this=0x6281450, rInf=...) at core/sw/source/core/txtnode/swfont.cxx:1039
 #8  0x00007fffce1f953c in SwFont::GetTextSize_ (this=0x6281450, rInf=...) at sw/source/core/inc/swfont.hxx:321
 #9  0x00007fffce2234e2 in SwTextSizeInfo::GetTextSize (this=0x7ffffffe6b80, nLayoutContext=std::optional = {...}) at core/sw/source/core/text/inftxt.cxx:439
 #10 0x00007fffce2f2217 in SwTextPortion::GetTextSize (this=0x62a3d40, rInf=...) at core/sw/source/core/text/portxt.cxx:586
 #11 0x00007fffce250b8c in SwTextCursor::GetCharRect_ (this=0x7ffffffe6fc8, pOrig=0x7ffffffe81c8, nOfst=..., pCMS=0x7ffffffe6e20) at core/sw/source/core/text/itrcrsr.cxx:956
 #12 0x00007fffce24d978 in SwTextCursor::GetCharRect (this=0x7ffffffe6fc8, pOrig=0x7ffffffe81c8, nOfst=..., pCMS=0x7ffffffe6e20, nMax=20604)
     at core/sw/source/core/text/itrcrsr.cxx:1281
 #13 0x00007fffce1f08c1 in SwTextFrame::GetAutoPos (this=0x6259250, rOrig=SwRect = {...}, rPos=SwPosition (node 28, offset 1897)) at core/sw/source/core/text/frmcrsr.cxx:430

Change-Id: I8230c9cbb99126b513bea38517b1dbfac5a50f4b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180131
Reviewed-by: Caolán McNamara <[email protected]>
Tested-by: Jenkins
(cherry picked from commit 029540b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180158
tdf-gerrit pushed a commit that referenced this pull request Jan 14, 2025
When using the qt6 vcl plugin with the Orca screen reader
running, selecting text in Writer resulted in a crash
due to an IndexOutOfBoundsException being thrown.

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
    warning: 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  0x00007f889b09ddef in __pthread_kill_internal (threadid=<optimized out>, signo=6) at ./nptl/pthread_kill.c:78
    #2  0x00007f889b049d02 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
    #3  0x00007f889b0324f0 in __GI_abort () at ./stdlib/abort.c:79
    #4  0x00007f889aca1a3d in ??? () at /lib/x86_64-linux-gnu/libstdc++.so.6
    #5  0x00007f889acb300a in ??? () at /lib/x86_64-linux-gnu/libstdc++.so.6
    #6  0x00007f889aca15e9 in std::terminate() () at /lib/x86_64-linux-gnu/libstdc++.so.6
    #7  0x00007f889acb3288 in __cxa_throw () at /lib/x86_64-linux-gnu/libstdc++.so.6
    #8  0x00007f8862346900 in SwAccessibleSelectionHelper::throwIndexOutOfBoundsException (this=0x561f2f8d1910) at .../libreoffice/sw/source/core/access/accselectionhelper.cxx:72
    #9  0x00007f8862347df8 in SwAccessibleSelectionHelper::getSelectedAccessibleChild (this=0x561f2f8d1910, nSelectedChildIndex=0) at .../libreoffice/sw/source/core/access/accselectionhelper.cxx:283
    #10 0x00007f8862298e6f in SwAccessibleDocument::getSelectedAccessibleChild (this=0x561f2f8d1800, nSelectedChildIndex=0) at .../libreoffice/sw/source/core/access/accdoc.cxx:467
    #11 0x00007f8862298eaf in non-virtual thunk to SwAccessibleDocument::getSelectedAccessibleChild(long) () at .../libreoffice/sw/source/core/access/accdoc.cxx:467
    #12 0x00007f88878c6200 in QtAccessibleWidget::selectedItem (this=0x7f887c014ac0, nSelectionIndex=0) at vcl/qt6/../qt5/QtAccessibleWidget.cxx:1861
    #13 0x00007f8885f08ba0 in AtSpiAdaptor::selectionInterface (this=0x561f2b8a7070, interface=0x7f887c014ac0, function=..., message=..., connection=...)
        at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:2596
    #14 0x00007f8885f03ce1 in AtSpiAdaptor::handleMessage (this=0x561f2b8a7070, message=..., connection=...) at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1479
    #15 0x00007f888366d217 in QDBusConnectionPrivate::activateObject (this=0x7f887c00a390, node=..., msg=..., pathStartPos=27) at .../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1448
    #16 0x00007f888366e1d0 in QDBusActivateObjectEvent::placeMetaCall (this=0x7f887c03aca0) at .../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1604
    #17 0x00007f8886b09bb1 in QObject::event (this=0x561f2b8a7070, e=0x7f887c03aca0) at .../qt5/qtbase/src/corelib/kernel/qobject.cpp:1431
    #18 0x00007f88849e2dd0 in QApplicationPrivate::notify_helper (this=0x561f2a554ae0, receiver=0x561f2b8a7070, e=0x7f887c03aca0) at .../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3305
    #19 0x00007f88849e6ced in QApplication::notify (this=0x561f2a541420, receiver=0x561f2b8a7070, e=0x7f887c03aca0) at .../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3255
    #20 0x00007f8886a481b9 in QCoreApplication::notifyInternal2 (receiver=0x561f2b8a7070, event=0x7f887c03aca0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1118
    #21 0x00007f8886a48e29 in QCoreApplication::sendEvent (receiver=0x561f2b8a7070, event=0x7f887c03aca0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1558
    #22 0x00007f8886a49d68 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x561f2a56fee0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1898
    #23 0x00007f8886a48c6c in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at .../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1752
    #24 0x00007f88870377b1 in postEventSourceDispatch (s=0x561f2a5cce80) at .../qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:246
    #25 0x00007f888d50b81f in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #26 0x00007f888d50da57 in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #27 0x00007f888d50e1c0 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
    #28 0x00007f88870369eb in QEventDispatcherGlib::processEvents (this=0x561f2a545d00, flags=...) at .../qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:399
    #29 0x00007f8886164858 in QPAEventDispatcherGlib::processEvents (this=0x561f2a545d00, flags=...) at .../qt5/qtbase/src/gui/platform/unix/qeventdispatcher_glib.cpp:89
    #30 0x00007f888796a492 in QtInstance::ImplYield (this=0x561f2a5d16c0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:464
    #31 0x00007f888796d511 in QtInstance::DoYield (this=0x561f2a5d16c0, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:475
    #32 0x00007f88924bd626 in ImplYield (i_bWait=true, i_bAllEvents=false) at .../libreoffice/vcl/source/app/svapp.cxx:385
    #33 0x00007f88924bcf3f in Application::Yield () at .../libreoffice/vcl/source/app/svapp.cxx:488
    #34 0x00007f88924bcd20 in Application::Execute () at .../libreoffice/vcl/source/app/svapp.cxx:360
    #35 0x00007f889b327b89 in desktop::Desktop::Main (this=0x7ffcd9ea1c00) at .../libreoffice/desktop/source/app/app.cxx:1679
    #36 0x00007f88924deaa6 in ImplSVMain () at .../libreoffice/vcl/source/app/svmain.cxx:230
    #37 0x00007f88924e0699 in SVMain () at .../libreoffice/vcl/source/app/svmain.cxx:248
    #38 0x00007f889b3a146a in soffice_main () at .../libreoffice/desktop/source/app/sofficemain.cxx:121
    #39 0x0000561ef2802a6d in sal_main () at .../libreoffice/desktop/source/app/main.c:51
    #40 0x0000561ef2802a47 in main (argc=2, argv=0x7ffcd9ea1e08) at .../libreoffice/desktop/source/app/main.c:49

While QtAccessibleWidget::selectedItem already returns early
if the passed selection index is too large according to what
XAccessibleSelection::getSelectedAccessibleChildCount()
returns, this is not enough because Writer's SwAccessibleSelectionHelper
has an inconsistent/broken implementation:

SwAccessibleSelectionHelper::getSelectedAccessibleChildCount
returns the count of paragraphs that are (partially) selected
by the text cursor if no other objects are selected.
However, SwAccessibleSelectionHelper::getSelectedAccessibleChild
doesn't take these into account and therefore throws the
IndexOutOfBoundsException when called with any index.

Temporarily (in particular for backporting to release branches),
handle the exception in QtAccessibleWidget::selectedItem like
other a11y bridges do (see e.g. `selection_ref_selection`
for the gtk3 VCL plugin) to avoid the crash.

The underlying Writer issue described above will be fixed in a
separate commit (and for master only).

Change-Id: I874ad4a7a9faf79492967c943517d83df5f47e75
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180228
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <[email protected]>
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