[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - sw/source

Miklos Vajna vmiklos at collabora.co.uk
Fri Feb 16 09:47:01 UTC 2018


 sw/source/core/layout/anchoredobject.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit ea3111651ee4e88f7abc359ce8f8eb390bbe7d45
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Feb 13 11:44:36 2018 +0100

    sw: work around what seems to be a gcc-4.8 compiler bug
    
            Thread 1 "soffice.bin" received signal SIGSEGV, Segmentation fault.
            (anonymous namespace)::print_type<15> (ctx=..., info=0x7fffffff7f90, unknown_name=...) at ../../../../../libstdc++-v3/src/c++11/debug.cc:641
            641     ../../../../../libstdc++-v3/src/c++11/debug.cc: No such file or directory.
            (gdb) up
            #1  0x00007ffff6abb008 in (anonymous namespace)::print_description (ctx=..., inst=...) at ../../../../../libstdc++-v3/src/c++11/debug.cc:817
            817     in ../../../../../libstdc++-v3/src/c++11/debug.cc
            (gdb)
            #2  0x00007ffff6abc7aa in (anonymous namespace)::print_description (param=..., ctx=...) at ../../../../../libstdc++-v3/src/c++11/debug.cc:835
            835     in ../../../../../libstdc++-v3/src/c++11/debug.cc
            (gdb)
            #3  __gnu_debug::_Error_formatter::_M_error (this=0x7fffffff7af0) at ../../../../../libstdc++-v3/src/c++11/debug.cc:1061
            1061    in ../../../../../libstdc++-v3/src/c++11/debug.cc
            (gdb)
            #4  0x00007fffca2b6313 in __gnu_debug::operator!=<__gnu_cxx::__normal_iterator<SwAnchoredObject* const*, std::__cxx1998::vector<SwAnchoredObject*, std::allocator<SwAnchoredObject*> > >, std::__debug::vector<SwAnchoredObject*, std::allocator<SwAnchoredObject*> > > (__lhs=0x0, __rhs=invalid iterator) at /usr/include/c++/4.8/debug/safe_iterator.h:535
            535           _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
            (gdb)
            #5  0x00007fffca7f3de2 in SwAnchoredObject::UpdateObjInSortedList (this=0x1fa6fd8) at /git/libreoffice/master/sw/source/core/layout/anchoredobject.cxx:629
            629                     for (SwAnchoredObject* pAnchoredObj : *pObjs)
    
    Given that valgrind doesn't point out anything and the old and the new code is
    meant to be the same, my only guess is that the baseline gcc has some codegen
    bug. This happens reasonably frequently, current bugdoc was a DOCX file
    with 4 shapes anchored to the same paragraph, affecting only dbgutil
    builds, it seems.
    
    The tdf#115719 bugdoc is a reproducer for the crash.
    
    (cherry picked from commit d34dcde1d0ccee2d78eea08185f12949f53ceae3)
    
    Change-Id: I2316e25eea87f2aa5736576d5168e113480f80e4
    Reviewed-on: https://gerrit.libreoffice.org/49835
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/source/core/layout/anchoredobject.cxx b/sw/source/core/layout/anchoredobject.cxx
index 4b79a357771f..dc85d1d235a0 100644
--- a/sw/source/core/layout/anchoredobject.cxx
+++ b/sw/source/core/layout/anchoredobject.cxx
@@ -625,8 +625,9 @@ void SwAnchoredObject::UpdateObjInSortedList()
             {
                 const SwSortedObjs* pObjs = GetAnchorFrame()->GetDrawObjs();
                 // determine start index
-                for (SwAnchoredObject* pAnchoredObj : *pObjs)
+                for (auto it = pObjs->begin(); it != pObjs->end(); ++it)
                 {
+                    SwAnchoredObject* pAnchoredObj = *it;
                     if ( pAnchoredObj->ConsiderObjWrapInfluenceOnObjPos() )
                         pAnchoredObj->InvalidateObjPosForConsiderWrapInfluence();
                     else


More information about the Libreoffice-commits mailing list