Bug 96920 - OpenGL: don't crash on exit ...
Summary: OpenGL: don't crash on exit ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
5.1.0.1 rc
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: VCL-OpenGL
  Show dependency treegraph
 
Reported: 2016-01-06 10:52 UTC by Michael Meeks
Modified: 2016-01-06 15:38 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Meeks 2016-01-06 10:52:35 UTC
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.
Comment 1 Michael Meeks 2016-01-06 15:38:52 UTC
Fixed on master, and merged into pending commit for -5-1.