[Libreoffice-commits] core.git: sw/source

Stephan Bergmann sbergman at redhat.com
Tue Nov 21 06:46:00 UTC 2017


 sw/source/core/layout/flylay.cxx |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 1b84f797509a6d531f4198c8260851d580088617
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Nov 20 17:02:26 2017 +0100

    Avoid static_cast on dead SwVirtFlyDrawObj object for now
    
    ...in SwFlyFrame::GetVirtDrawObj (sw/source/core/layout/fly.cxx) after
    487ac20ecd73cf3d98071ba30cf5597d957017f7 "RotateFlyFrame3: add support for
    AutoContour" added this code, which causes at least UBSan (e.g., during
    CppunitTest_sw_rtfimport) to produce errors (starting with
    <https://ci.libreoffice.org/job/lo_ubsan/733/console>).
    
    There appear to be no negative consequences across 'make check' with this code
    disabled, so do that for now to unblock UBSan builds, until a real fix is
    provided.
    
    The backtrace of the bad static_cast on dead SwVirtFlyDrawObj is
    
    > SwFlyFrame::GetVirtDrawObj() (/sw/source/core/layout/fly.cxx:2599)
    > SwFlyFreeFrame::~SwFlyFreeFrame() (/sw/source/core/layout/flylay.cxx:93)
    > SwFlyAtContentFrame::~SwFlyAtContentFrame() (/sw/source/core/inc/flyfrms.hxx:161)
    > SwFlyAtContentFrame::~SwFlyAtContentFrame() (/sw/source/core/inc/flyfrms.hxx:161)
    > SwFrame::DestroyFrame(SwFrame*) (/sw/source/core/layout/ssfrm.cxx:431)
    > SwLayoutFrame::DestroyImpl() (/sw/source/core/layout/ssfrm.cxx:517)
    > SwFrame::DestroyFrame(SwFrame*) (/sw/source/core/layout/ssfrm.cxx:429)
    > SwLayoutFrame::DestroyImpl() (/sw/source/core/layout/ssfrm.cxx:540)
    > SwPageFrame::DestroyImpl() (/sw/source/core/layout/pagechg.cxx:295)
    > SwFrame::DestroyFrame(SwFrame*) (/sw/source/core/layout/ssfrm.cxx:429)
    > SwLayoutFrame::DestroyImpl() (/sw/source/core/layout/ssfrm.cxx:540)
    > SwRootFrame::DestroyImpl() (/sw/source/core/layout/newfrm.cxx:621)
    > SwFrame::DestroyFrame(SwFrame*) (/sw/source/core/layout/ssfrm.cxx:429)
    > std::_Sp_counted_deleter<SwRootFrame*, void (*)(SwFrame*), std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() (/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr_base.h:470)
    > std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr_base.h:154)
    > std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() (/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr_base.h:684)
    > std::__shared_ptr<SwRootFrame, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() (/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr_base.h:1123)
    > std::shared_ptr<SwRootFrame>::~shared_ptr() (/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr.h:93)
    > SwViewShell::~SwViewShell() (/sw/source/core/view/vnew.cxx:364)
    > SwCursorShell::~SwCursorShell() (/sw/source/core/crsr/crsrsh.cxx:2743)
    > SwEditShell::~SwEditShell() (/sw/source/core/edit/edws.cxx:64)
    > SwFEShell::~SwFEShell() (/sw/source/core/frmedt/fews.cxx:700)
    > SwWrtShell::~SwWrtShell() (/sw/source/uibase/wrtsh/wrtsh1.cxx:1662)
    > SwWrtShell::~SwWrtShell() (/sw/source/uibase/wrtsh/wrtsh1.cxx:1655)
    > SwView::~SwView() (/sw/source/uibase/uiview/view.cxx:1045)
    > SwView::~SwView() (/sw/source/uibase/uiview/view.cxx:1011)
    > SfxViewFrame::ReleaseObjectShell_Impl() (/sfx2/source/view/viewfrm.cxx:992)
    > SfxViewFrame::~SfxViewFrame() (/sfx2/source/view/viewfrm.cxx:1363)
    > SfxViewFrame::~SfxViewFrame() (/sfx2/source/view/viewfrm.cxx:1357)
    > SfxViewFrame::Close() (/sfx2/source/view/viewfrm.cxx:1044)
    > SfxFrame::DoClose_Impl() (/sfx2/source/view/frame.cxx:155)
    > SfxBaseController::dispose() (/sfx2/source/view/sfxbasecontroller.cxx:1003)
    > (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&) (/framework/source/services/frame.cxx:1474)
    > (anonymous namespace)::Frame::close(unsigned char) (/framework/source/services/frame.cxx:1681)
    > SfxFrame::DoClose() (/sfx2/source/view/frame.cxx:121)
    > SfxViewFrame::Notify(SfxBroadcaster&, SfxHint const&) (/sfx2/source/view/viewfrm.cxx:1251)
    > SfxBroadcaster::Broadcast(SfxHint const&) (/svl/source/notify/SfxBroadcaster.cxx:49)
    > SfxModelListener_Impl::notifyClosing(com::sun::star::lang::EventObject const&) (/sfx2/source/doc/objxtor.cxx:167)
    > SfxBaseModel::close(unsigned char) (/sfx2/source/doc/sfxbasemodel.cxx:1348)
    > SwXTextDocument::close(unsigned char) (/sw/source/uibase/uno/unotxdoc.cxx:623)
    > SfxBaseModel::dispose() (/sfx2/source/doc/sfxbasemodel.cxx:722)
    > SwXTextDocument::dispose() (/sw/source/uibase/uno/unotxdoc.cxx:615)
    > SwModelTestBase::tearDown() (/sw/qa/extras/inc/swmodeltestbase.hxx:206)
    > CppUnit::TestCaller<testN695479>::tearDown() (/workdir/UnpackedTarball/cppunit/include/cppunit/TestCaller.h:185)
    > CppUnit::TestCaseMethodFunctor::operator()() const (/workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:32)
    > (anonymous namespace)::Protector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (/test/source/vclbootstrapprotector.cxx:39)
    > CppUnit::ProtectorChain::ProtectFunctor::operator()() const (/workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20)
    > (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (/unotest/source/cpp/unobootstrapprotector/unobootstrapprotector.cxx:89)
    > CppUnit::ProtectorChain::ProtectFunctor::operator()() const (/workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20)
    > (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (/unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx:63)
    
    and the backtrace of the destruction of that SwVirtFlyDrawObj object is
    
    > operator delete(void*) (/builddir/build/BUILD/valgrind-3.13.0/coregrind/m_replacemalloc/vg_replace_malloc.c:576)
    > SwVirtFlyDrawObj::~SwVirtFlyDrawObj() (/sw/source/core/draw/dflyobj.cxx:433)
    > SwFlyFrame::FinitDrawObj() (/sw/source/core/layout/fly.cxx:379)
    > SwFlyFrame::DestroyImpl() (/sw/source/core/layout/fly.cxx:277)
    > SwFlyFreeFrame::DestroyImpl() (/sw/source/core/layout/flylay.cxx:87)
    > SwFrame::DestroyFrame(SwFrame*) (/sw/source/core/layout/ssfrm.cxx:429)
    > SwLayoutFrame::DestroyImpl() (/sw/source/core/layout/ssfrm.cxx:517)
    > SwFrame::DestroyFrame(SwFrame*) (/sw/source/core/layout/ssfrm.cxx:429)
    > SwLayoutFrame::DestroyImpl() (/sw/source/core/layout/ssfrm.cxx:540)
    > SwPageFrame::DestroyImpl() (/sw/source/core/layout/pagechg.cxx:295)
    > SwFrame::DestroyFrame(SwFrame*) (/sw/source/core/layout/ssfrm.cxx:429)
    > SwLayoutFrame::DestroyImpl() (/sw/source/core/layout/ssfrm.cxx:540)
    > SwRootFrame::DestroyImpl() (/sw/source/core/layout/newfrm.cxx:621)
    > SwFrame::DestroyFrame(SwFrame*) (/sw/source/core/layout/ssfrm.cxx:429)
    > std::_Sp_counted_deleter<SwRootFrame*, void (*)(SwFrame*), std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() (/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr_base.h:470)
    > std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr_base.h:154)
    > std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() (/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr_base.h:684)
    > std::__shared_ptr<SwRootFrame, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() (/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr_base.h:1123)
    > std::shared_ptr<SwRootFrame>::~shared_ptr() (/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/shared_ptr.h:93)
    > SwViewShell::~SwViewShell() (/sw/source/core/view/vnew.cxx:364)
    > SwCursorShell::~SwCursorShell() (/sw/source/core/crsr/crsrsh.cxx:2743)
    > SwEditShell::~SwEditShell() (/sw/source/core/edit/edws.cxx:64)
    > SwFEShell::~SwFEShell() (/sw/source/core/frmedt/fews.cxx:700)
    > SwWrtShell::~SwWrtShell() (/sw/source/uibase/wrtsh/wrtsh1.cxx:1662)
    > SwWrtShell::~SwWrtShell() (/sw/source/uibase/wrtsh/wrtsh1.cxx:1655)
    > SwView::~SwView() (/sw/source/uibase/uiview/view.cxx:1045)
    > SwView::~SwView() (/sw/source/uibase/uiview/view.cxx:1011)
    > SfxViewFrame::ReleaseObjectShell_Impl() (/sfx2/source/view/viewfrm.cxx:992)
    > SfxViewFrame::~SfxViewFrame() (/sfx2/source/view/viewfrm.cxx:1363)
    > SfxViewFrame::~SfxViewFrame() (/sfx2/source/view/viewfrm.cxx:1357)
    > SfxViewFrame::Close() (/sfx2/source/view/viewfrm.cxx:1044)
    > SfxFrame::DoClose_Impl() (/sfx2/source/view/frame.cxx:155)
    > SfxBaseController::dispose() (/sfx2/source/view/sfxbasecontroller.cxx:1003)
    > (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&) (/framework/source/services/frame.cxx:1474)
    > (anonymous namespace)::Frame::close(unsigned char) (/framework/source/services/frame.cxx:1681)
    > SfxFrame::DoClose() (/sfx2/source/view/frame.cxx:121)
    > SfxViewFrame::Notify(SfxBroadcaster&, SfxHint const&) (/sfx2/source/view/viewfrm.cxx:1251)
    > SfxBroadcaster::Broadcast(SfxHint const&) (/svl/source/notify/SfxBroadcaster.cxx:49)
    > SfxModelListener_Impl::notifyClosing(com::sun::star::lang::EventObject const&) (/sfx2/source/doc/objxtor.cxx:167)
    > SfxBaseModel::close(unsigned char) (/sfx2/source/doc/sfxbasemodel.cxx:1348)
    > SwXTextDocument::close(unsigned char) (/sw/source/uibase/uno/unotxdoc.cxx:623)
    > SfxBaseModel::dispose() (/sfx2/source/doc/sfxbasemodel.cxx:722)
    > SwXTextDocument::dispose() (/sw/source/uibase/uno/unotxdoc.cxx:615)
    > SwModelTestBase::tearDown() (/sw/qa/extras/inc/swmodeltestbase.hxx:206)
    > CppUnit::TestCaller<testN695479>::tearDown() (/workdir/UnpackedTarball/cppunit/include/cppunit/TestCaller.h:185)
    > CppUnit::TestCaseMethodFunctor::operator()() const (/workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:32)
    > (anonymous namespace)::Protector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (/test/source/vclbootstrapprotector.cxx:39)
    > CppUnit::ProtectorChain::ProtectFunctor::operator()() const (/workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20)
    > (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (/unotest/source/cpp/unobootstrapprotector/unobootstrapprotector.cxx:89)
    > CppUnit::ProtectorChain::ProtectFunctor::operator()() const (/workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20)
    
    Change-Id: Ida6e66c3bc8f85c9cbe60a33aaf40f5e83f16212
    Reviewed-on: https://gerrit.libreoffice.org/44976
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx
index 8f6452b9b874..42e488a6b1b3 100644
--- a/sw/source/core/layout/flylay.cxx
+++ b/sw/source/core/layout/flylay.cxx
@@ -89,8 +89,10 @@ void SwFlyFreeFrame::DestroyImpl()
 
 SwFlyFreeFrame::~SwFlyFreeFrame()
 {
+#if 0
     // we are possibly in ContourCache, make sure we vanish
     ::ClrContourCache(GetVirtDrawObj());
+#endif
 }
 
 // #i28701#


More information about the Libreoffice-commits mailing list