<div dir="ltr"><div></div>Am Montag, 27. Januar 2020 10:57:23 UTC+1 schrieb Robert Osfield:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir="ltr">Hi Fiabian,<br><br>On Monday, 27 January 2020 09:41:43 UTC, Fabian Roth wrote:<blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi,</div><div>I am currently testing this RC with openmw.</div><div>If i have the fps display or profiler open while exiting the application i get a crash on exit.</div><div>I am not sure if this is due to a bug in my build, a bug in openmw or a real issue with osg.</div><div>The issue seems to be related to the destruction of the default font, but i was not able to investigate further.</div><div>Attached is a Backtrace of the issue i am currently observing.</div></div></blockquote><div><br></div><div>That stack trace looks like the automatic clean up of the ObjectCache with the DefaultFont within it is related somehow to the crash. How the DefaultFont is managed has changed, to address bugs ironically, and in a general sense the clean up the stack trace looks just fine to me, it's roughly what I'd expect to happen. However, I don't have any clear idea why in this instance the crash has occurred.</div><div><br></div><div>Given there isn't any obvious amiss we are unfortunately are left to widen out the search for what is amiss. <br></div><div><br></div><div>Does running an OSG example like osgtext fail?</div><div><br></div><div>Do others in the OpenMMW community seen this same crash?</div><div><br></div><div>Is it possible to run OpenMMW single threaded to see if there might be some thread interaction?</div><div><br></div><div>What OS/compile and OpenMMW version combination are you using?</div><div><br></div><div>One possible cause of crash like this is memory corruption during the run of the application that is only revealed on clean up. Using a memory tools like valgrind might be spot this type of issue.</div><div><br></div><div>Perhaps others might have seen something similar and can help shed some light on the nature of the crash.</div><div><br></div><div>If it's possible to recreate the crash with an standard OSG example, or a small modification of one, then this would be really helpful for me to jump in a start investigating the issue.</div><div><br></div><div>Cheers.<br></div><div>Robert.<br></div></div></blockquote><div> </div><div>Hi,</div><div>Thank you for the fast reply.</div><div></div><div>My build is using static osg, static osg-plugins and link time optimization.</div><div>I created an address sanitizer enabled build.</div><div>It exhibits a heap-use-after-free.<br></div>I will try to further investigate this week.<br><div><br></div><div>Greetings,</div><div>Fabian</div><div><br></div><div><br></div><div>=================================================================<br>==11872==ERROR: AddressSanitizer: heap-use-after-free on address 0x6030000082c0 at pc 0x55b4b9659551 bp 0x7ffdf8a9c190 sp 0x7ffdf8a9c180<br>READ of size 8 at 0x6030000082c0 thread T0<br> #0 0x55b4b9659550 in OpenThreads::ScopedPointerLock<OpenThreads::Mutex>::ScopedPointerLock(OpenThreads::Mutex*) ./openmw/extern-git/OpenSceneGraph/include/OpenThreads/ScopedLock:54<br> #1 0x55b4b9659550 in osg::StateAttribute::removeParent(osg::StateSet*) ./openmw/extern-git/OpenSceneGraph/src/osg/StateAttribute.cpp:38<br> #2 0x55b4b965a033 in osg::StateSet::clear() ./openmw/extern-git/OpenSceneGraph/src/osg/StateSet.cpp:734<br> #3 0x55b4b965a5ef in __base_dtor ./openmw/extern-git/OpenSceneGraph/src/osg/StateSet.cpp:285<br> #4 0x55b4b965a9f8 in __deleting_dtor ./openmw/extern-git/OpenSceneGraph/src/osg/StateSet.cpp:286<br> #5 0x55b4b9c98246 in osg::Referenced::unref() const ./openmw/extern-git/OpenSceneGraph/include/osg/Referenced:201<br> #6 0x55b4b9c98246 in osg::ref_ptr<osg::StateSet>::~ref_ptr() ./openmw/extern-git/OpenSceneGraph/include/osg/ref_ptr:41<br> #7 0x55b4b9c98246 in void std::_Destroy<osg::ref_ptr<osg::StateSet> >(osg::ref_ptr<osg::StateSet>*) /usr/include/c++/7/bits/stl_construct.h:98<br> #8 0x55b4b9c98246 in void std::_Destroy_aux<false>::__destroy<osg::ref_ptr<osg::StateSet>*>(osg::ref_ptr<osg::StateSet>*, osg::ref_ptr<osg::StateSet>*) /usr/include/c++/7/bits/stl_construct.h:108<br> #9 0x55b4b9c98246 in void std::_Destroy<osg::ref_ptr<osg::StateSet>*>(osg::ref_ptr<osg::StateSet>*, osg::ref_ptr<osg::StateSet>*) /usr/include/c++/7/bits/stl_construct.h:137<br> #10 0x55b4b9c98246 in void std::_Destroy<osg::ref_ptr<osg::StateSet>*, osg::ref_ptr<osg::StateSet> >(osg::ref_ptr<osg::StateSet>*, osg::ref_ptr<osg::StateSet>*, std::allocator<osg::ref_ptr<osg::StateSet> >&) /usr/include/c++/7/bits/stl_construct.h:206<br> #11 0x55b4b9c98246 in std::vector<osg::ref_ptr<osg::StateSet>, std::allocator<osg::ref_ptr<osg::StateSet> > >::~vector() [clone .lto_priv.5218] /usr/include/c++/7/bits/stl_vector.h:434<br> #12 0x55b4b9da20dd in osgText::Font::~Font() ./openmw/extern-git/OpenSceneGraph/src/osgText/Font.cpp:295<br> #13 0x55b4b9e59ed2 in __base_dtor ./openmw/extern-git/OpenSceneGraph/src/osgText/DefaultFont.cpp:35<br> #14 0x55b4b9e59ed2 in __deleting_dtor ./openmw/extern-git/OpenSceneGraph/src/osgText/DefaultFont.cpp:37<br> #15 0x55b4b8df93d6 in osg::Referenced::unref() const ./openmw/extern-git/OpenSceneGraph/include/osg/Referenced:201<br> #16 0x55b4b98e7518 in osg::ref_ptr<osg::Object>::~ref_ptr() ./openmw/extern-git/OpenSceneGraph/include/osg/ref_ptr:41<br> #17 0x55b4b98e7518 in std::pair<osg::ref_ptr<osg::Object>, double>::~pair() /usr/include/c++/7/bits/stl_pair.h:208<br> #18 0x55b4b98e7518 in __base_dtor /usr/include/c++/7/bits/stl_pair.h:208<br> #19 0x55b4b98e7518 in void __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, osg::ref_ptr<osgDB::Options const> > const, std::pair<osg::ref_ptr<osg::Object>, double> > > >::destroy<std::pair<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, osg::ref_ptr<osgDB::Options const> > const, std::pair<osg::ref_ptr<osg::Object>, double> > >(std::pair<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, osg::ref_ptr<osgDB::Options const> > const, std::pair<osg::ref_ptr<osg::Object>, double> >*) /usr/include/c++/7/ext/new_allocator.h:140<br> #20 0x55b4b98e7518 in void std::allocator_traits<std::allocator<std::_Rb_tree_node<std::pair<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, osg::ref_ptr<osgDB::Options const> > const, std::pair<osg::ref_ptr<osg::Object>, double> > > > >::destroy<std::pair<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, osg::ref_ptr<osgDB::Options const> > const, std::pair<osg::ref_ptr<osg::Object>, double> > >(std::allocator<std::_Rb_tree_node<std::pair<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, osg::ref_ptr<osgDB::Options const> > const, std::pair<osg::ref_ptr<osg::Object>, double> > > >&, std::pair<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, osg::ref_ptr<osgDB::Options const> > const, std::pair<osg::ref_ptr<osg::Object>, double> >*) /usr/include/c++/7/bits/alloc_traits.h:487<br> #21 0x55b4b98e7518 in std::_Rb_tree<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, osg::ref_ptr<osgDB::Options const> >, std::pair<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, osg::ref_ptr<osgDB::Options const> > const, std::pair<osg::ref_ptr<osg::Object>, double> >, std::_Select1st<std::pair<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, osg::ref_ptr<osgDB::Options const> > const, std::pair<osg::ref_ptr<osg::Object>, double> > >, osgDB::ObjectCache::ClassComp, std::allocator<std::pair<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, osg::ref_ptr<osgDB::Options const> > const, std::pair<osg::ref_ptr<osg::Object>, double> > > >::_M_destroy_node(std::_Rb_tree_node<std::pair<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, osg::ref_ptr<osgDB::Options const> > const, std::pair<osg::ref_ptr<osg::Object>, double> > >*) /usr/include/c++/7/bits/stl_tree.h:650<br> #22 0x55b4b98e7518 in std::_Rb_tree<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, osg::ref_ptr<osgDB::Options const> >, std::pair<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, osg::ref_ptr<osgDB::Options const> > const, std::pair<osg::ref_ptr<osg::Object>, double> >, std::_Select1st<std::pair<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, osg::ref_ptr<osgDB::Options const> > const, std::pair<osg::ref_ptr<osg::Object>, double> > >, osgDB::ObjectCache::ClassComp, std::allocator<std::pair<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, osg::ref_ptr<osgDB::Options const> > const, std::pair<osg::ref_ptr<osg::Object>, double> > > >::_M_drop_node(std::_Rb_tree_node<std::pair<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, osg::ref_ptr<osgDB::Options const> > const, std::pair<osg::ref_ptr<osg::Object>, double> > >*) /usr/include/c++/7/bits/stl_tree.h:658<br> #23 0x55b4b98e7518 in _M_erase /usr/include/c++/7/bits/stl_tree.h:1858<br> #24 0x55b4b990fe4f in std::_Rb_tree<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, osg::ref_ptr<osgDB::Options const> >, std::pair<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, osg::ref_ptr<osgDB::Options const> > const, std::pair<osg::ref_ptr<osg::Object>, double> >, std::_Select1st<std::pair<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, osg::ref_ptr<osgDB::Options const> > const, std::pair<osg::ref_ptr<osg::Object>, double> > >, osgDB::ObjectCache::ClassComp, std::allocator<std::pair<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, osg::ref_ptr<osgDB::Options const> > const, std::pair<osg::ref_ptr<osg::Object>, double> > > >::clear() /usr/include/c++/7/bits/stl_tree.h:1171<br> #25 0x55b4b990fe4f in std::map<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, osg::ref_ptr<osgDB::Options const> >, std::pair<osg::ref_ptr<osg::Object>, double>, osgDB::ObjectCache::ClassComp, std::allocator<std::pair<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, osg::ref_ptr<osgDB::Options const> > const, std::pair<osg::ref_ptr<osg::Object>, double> > > >::clear() /usr/include/c++/7/bits/stl_map.h:1127<br> #26 0x55b4b990fe4f in osgDB::ObjectCache::clear() ./openmw/extern-git/OpenSceneGraph/src/osgDB/ObjectCache.cpp:189<br> #27 0x55b4b9914418 in clearObjectCache ./openmw/extern-git/OpenSceneGraph/src/osgDB/Registry.cpp:1654<br> #28 0x55b4b9914418 in osgDB::Registry::destruct() ./openmw/extern-git/OpenSceneGraph/src/osgDB/Registry.cpp:507<br> #29 0x55b4b9917574 in __base_dtor ./openmw/extern-git/OpenSceneGraph/src/osgDB/Registry.cpp:486<br> #30 0x55b4b9918268 in __deleting_dtor ./openmw/extern-git/OpenSceneGraph/src/osgDB/Registry.cpp:487<br> #31 0x55b4b8df93d6 in osg::Referenced::unref() const ./openmw/extern-git/OpenSceneGraph/include/osg/Referenced:201<br> #32 0x7fde57502040 (/lib/x86_64-linux-gnu/libc.so.6+0x43040)<br> #33 0x7fde57502139 in exit (/lib/x86_64-linux-gnu/libc.so.6+0x43139)<br> #34 0x7fde574e0b9d in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b9d)<br> #35 0x55b4b872bf79 in _start (.//openmw-build/openmw+0x3e9f79)<br><br>0x6030000082c0 is located 0 bytes inside of 24-byte region [0x6030000082c0,0x6030000082d8)<br>freed by thread T0 here:<br> #0 0x7fde579919d8 in operator delete(void*, unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe19d8)<br> #1 0x7fde57502040 (/lib/x86_64-linux-gnu/libc.so.6+0x43040)<br><br>previously allocated by thread T0 here:<br> #0 0x7fde57990458 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe0458)<br> #1 0x55b4b9658949 in osg::Referenced::getGlobalReferencedMutex() ./openmw/extern-git/OpenSceneGraph/src/osg/Referenced.cpp:86<br><br>SUMMARY: AddressSanitizer: heap-use-after-free ./openmw/extern-git/OpenSceneGraph/include/OpenThreads/ScopedLock:54 in OpenThreads::ScopedPointerLock<OpenThreads::Mutex>::ScopedPointerLock(OpenThreads::Mutex*)<br>Shadow bytes around the buggy address:<br> 0x0c067fff9000: fd fd fa fa fa fa fa fa fa fa fd fd fd fd fa fa<br> 0x0c067fff9010: fa fa fa fa fa fa fd fd fd fd fa fa fa fa fa fa<br> 0x0c067fff9020: fa fa fd fd fd fd fa fa fa fa fa fa fa fa fd fd<br> 0x0c067fff9030: fd fd fa fa fa fa fa fa fa fa fd fd fd fa fa fa<br> 0x0c067fff9040: fa fa fa fa fa fa fd fd fd fa fa fa fa fa fa fa<br>=>0x0c067fff9050: fa fa fd fd fd fd fa fa[fd]fd fd fa fa fa fd fd<br> 0x0c067fff9060: fd fa fa fa fa fa fa fa fa fa fd fd fd fa fa fa<br> 0x0c067fff9070: fa fa fa fa fa fa fd fd fd fa fa fa fa fa fa fa<br> 0x0c067fff9080: fa fa fd fd fd fa fa fa fa fa fa fa fa fa 00 00<br> 0x0c067fff9090: 05 fa fa fa 00 00 05 fa fa fa fa fa fa fa fa fa<br> 0x0c067fff90a0: 00 00 07 fa fa fa 00 00 07 fa fa fa fa fa fa fa<br>Shadow byte legend (one shadow byte represents 8 application bytes):<br> Addressable: 00<br> Partially addressable: 01 02 03 04 05 06 07 <br> Heap left redzone: fa<br> Freed heap region: fd<br> Stack left redzone: f1<br> Stack mid redzone: f2<br> Stack right redzone: f3<br> Stack after return: f5<br> Stack use after scope: f8<br> Global redzone: f9<br> Global init order: f6<br> Poisoned by user: f7<br> Container overflow: fc<br> Array cookie: ac<br> Intra object redzone: bb<br> ASan internal: fe<br> Left alloca redzone: ca<br> Right alloca redzone: cb<br>==11872==ABORTING<br></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:osg-users+unsubscribe@googlegroups.com">osg-users+unsubscribe@googlegroups.com</a>.<br />
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/osg-users/222411d9-3219-4d28-8090-a0602ce81f01%40googlegroups.com?utm_medium=email&utm_source=footer">https://groups.google.com/d/msgid/osg-users/222411d9-3219-4d28-8090-a0602ce81f01%40googlegroups.com</a>.<br />