https://bugs.documentfoundation.org/show_bug.cgi?id=96920

            Bug ID: 96920
           Summary: OpenGL: don't crash on exit ...
           Product: LibreOffice
           Version: 5.1.0.1 rc
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: graphics stack
          Assignee: libreoffice-bugs@lists.freedesktop.org
          Reporter: michael.me...@collabora.com

The fix to re-order the FixedTextureAtlas shutdown appears to have pulled up
the code there that ignores the ref-counting of textures:

==15600== Invalid read of size 4
==15600==    at 0xCE0BCA5: OpenGLTexture::Id() const (texture.cxx:303)
==15600==    by 0xCDF8D80: OpenGLSalBitmap::Destroy() (salbmp.cxx:238)
==15600==    by 0xCDF81E5: OpenGLSalBitmap::~OpenGLSalBitmap() (salbmp.cxx:119)
==15600==    by 0xCDF82C5: OpenGLSalBitmap::~OpenGLSalBitmap() (salbmp.cxx:121)
==15600==    by 0xD2299CF: ImpBitmap::~ImpBitmap() (impbmp.cxx:41)
==15600==    by 0xD1B035F: Bitmap::ImplReleaseRef() (bitmap.cxx:307)
==15600==    by 0xD1AF9EB: Bitmap::~Bitmap() (bitmap.cxx:133)
==15600==    by 0xD1BA231: BitmapEx::~BitmapEx() (bitmapex.cxx:186)
==15600==    by 0xD3B9A4D: std::pair<bool, BitmapEx>::~pair() (stl_pair.h:96)
==15600==    by 0xD3BFCA7: std::pair<rtl::OUString const, std::pair<bool,
BitmapEx> >::~pair() (stl_pair.h:96)
==15600==    by 0xD3BFF0B: std::__detail::_Hash_node<std::pair<rtl::OUString
const, std::pair<bool, BitmapEx> >, true>::~_Hash_node()
(hashtable_policy.h:170)
==15600==    by 0xD3BFF29: void
__gnu_cxx::new_allocator<std::__detail::_Hash_node<std::pair<rtl::OUString
const, std::pair<bool, BitmapEx> >, true>
>::destroy<std::__detail::_Hash_node<std::pair<rtl::OUString const,
std::pair<bool, BitmapEx> >, true>
>(std::__detail::_Hash_node<std::pair<rtl::OUString const, std::pair<bool,
BitmapEx> >, true>*) (new_allocator.h:124)

==15600==  Address 0x2cf1c1b4 is 4 bytes inside a block of size 40 free'd
==15600==    at 0x4C2A84C: operator delete(void*) (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==15600==    by 0xCE01481:
std::default_delete<ImplOpenGLTexture>::operator()(ImplOpenGLTexture*) const
(unique_ptr.h:67)
==15600==    by 0xCE012D0: std::unique_ptr<ImplOpenGLTexture,
std::default_delete<ImplOpenGLTexture> >::~unique_ptr() (unique_ptr.h:184)
==15600==    by 0xCE010D5: void
std::_Destroy<std::unique_ptr<ImplOpenGLTexture,
std::default_delete<ImplOpenGLTexture> > >(std::unique_ptr<ImplOpenGLTexture,
std::default_delete<ImplOpenGLTexture> >*) (stl_construct.h:93)
==15600==    by 0xCE00E79: void
std::_Destroy_aux<false>::__destroy<std::unique_ptr<ImplOpenGLTexture,
std::default_delete<ImplOpenGLTexture> >*>(std::unique_ptr<ImplOpenGLTexture,
std::default_delete<ImplOpenGLTexture> >*, std::unique_ptr<ImplOpenGLTexture,
std::default_delete<ImplOpenGLTexture> >*) (stl_construct.h:103)
==15600==    by 0xCE00C1E: void
std::_Destroy<std::unique_ptr<ImplOpenGLTexture,
std::default_delete<ImplOpenGLTexture> >*>(std::unique_ptr<ImplOpenGLTexture,
std::default_delete<ImplOpenGLTexture> >*, std::unique_ptr<ImplOpenGLTexture,
std::default_delete<ImplOpenGLTexture> >*) (stl_construct.h:126)
==15600==    by 0xCE00804: void
std::_Destroy<std::unique_ptr<ImplOpenGLTexture,
std::default_delete<ImplOpenGLTexture> >*, std::unique_ptr<ImplOpenGLTexture,
std::default_delete<ImplOpenGLTexture> > >(std::unique_ptr<ImplOpenGLTexture,
std::default_delete<ImplOpenGLTexture> >*, std::unique_ptr<ImplOpenGLTexture,
std::default_delete<ImplOpenGLTexture> >*,
std::allocator<std::unique_ptr<ImplOpenGLTexture,
std::default_delete<ImplOpenGLTexture> > >&) (stl_construct.h:151)
==15600==    by 0xCE00048:
std::__cxx1998::vector<std::unique_ptr<ImplOpenGLTexture,
std::default_delete<ImplOpenGLTexture> >,
std::allocator<std::unique_ptr<ImplOpenGLTexture,
std::default_delete<ImplOpenGLTexture> > > >::~vector() (stl_vector.h:415)
==15600==    by 0xCDFF631:
std::__debug::vector<std::unique_ptr<ImplOpenGLTexture,
std::default_delete<ImplOpenGLTexture> >,
std::allocator<std::unique_ptr<ImplOpenGLTexture,
std::default_delete<ImplOpenGLTexture> > > >::~vector() (vector:144)
==15600==    by 0xCDFE531:
FixedTextureAtlasManager::~FixedTextureAtlasManager()
(FixedTextureAtlas.hxx:17)
==15600==    by 0xCDFE555:
std::default_delete<FixedTextureAtlasManager>::operator()(FixedTextureAtlasManager*)
const (unique_ptr.h:67)
==15600==    by 0xCDFD7A6: std::unique_ptr<FixedTextureAtlasManager,
std::default_delete<FixedTextureAtlasManager> >::~unique_ptr()
(unique_ptr.h:184)
==15600== 

We should use the ref-counting instead.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to