Adrian Egli OpenSceneGraph (3D) wrote: > Hi all, > > the problem is (i guess) that freetype is not at all thread safe. my > you can try to test in singlethread mode. if there is no crash, than > we should have a look into the osgText freetype access at clean up. i > still got many crashes in reason of that in other application using > freetype in multi threaded env. > Hello,
You may be right but the symptom is at OSG level and not Freetype. Below is the valgrind report on osgtext example application, OSG version 2.3.4 (normal build), Ubuntu 7.10 Amd64, 2 core Athlon. It reports a double free of *FreeTypeLibrary* instance. Both free operation seems to come from the same context, below the main. Adding a preventive "osgDB::Registry::instance()->clearObjectCache();" as suggested by Jari is removing the mem error from Valgrind report. Antoine ------------------------------------------------- *==7229== Thread 1: ==7229== Invalid write of size 8 ==7229== at 0x94820EC: FreeTypeLibrary::~FreeTypeLibrary() (in /home/tonio/local64/OSG-2.3.4/lib64/osgPlugins-2.3.4/osgdb_freetype.so) ==7229== by 0x4125EB: osg::Referenced::unref() const (in /home/tonio/build/OpenSceneGraph-2.3.4/build64/bin/osgtext) ==7229== by 0x9483A7A: osg::ref_ptr<FreeTypeLibrary>::~ref_ptr() (in /home/tonio/local64/OSG-2.3.4/lib64/osgPlugins-2.3.4/osgdb_freetype.so) ==7229== by 0x9482065: __tcf_0 (in /home/tonio/local64/OSG-2.3.4/lib64/osgPlugins-2.3.4/osgdb_freetype.so) ==7229== by 0x7ED34FF: exit (in /lib/libc-2.6.1.so) ==7229== by 0x7EBCB4A: (below main) (in /lib/libc-2.6.1.so) ==7229== Address 0x93F6058 is 32 bytes inside a block of size 96 free'd ==7229== at 0x4C2153D: operator delete(void*) (vg_replace_malloc.c:244) ==7229== by 0x9477EC3: FreeTypeFont::~FreeTypeFont() (in /home/tonio/local64/OSG-2.3.4/lib64/osgPlugins-2.3.4/osgdb_freetype.so) ==7229== by 0x4125EB: osg::Referenced::unref() const (in /home/tonio/build/OpenSceneGraph-2.3.4/build64/bin/osgtext) ==7229== by 0x66B3073: osg::ref_ptr<osgText::Font::FontImplementation>::operator=(osgText::Font::FontImplementation*) (in /home/tonio/build/OpenSceneGraph-2.3.4/build64/lib/libosgText.so.2.3.4) ==7229== by 0x66A53CF: osgText::Font::setImplementation(osgText::Font::FontImplementation*) (in /home/tonio/build/OpenSceneGraph-2.3.4/build64/lib/libosgText.so.2.3.4) ==7229== by 0x94820E7: FreeTypeLibrary::~FreeTypeLibrary() (in /home/tonio/local64/OSG-2.3.4/lib64/osgPlugins-2.3.4/osgdb_freetype.so) ==7229== by 0x4125EB: osg::Referenced::unref() const (in /home/tonio/build/OpenSceneGraph-2.3.4/build64/bin/osgtext) ==7229== by 0x9483A7A: osg::ref_ptr<FreeTypeLibrary>::~ref_ptr() (in /home/tonio/local64/OSG-2.3.4/lib64/osgPlugins-2.3.4/osgdb_freetype.so) ==7229== by 0x9482065: __tcf_0 (in /home/tonio/local64/OSG-2.3.4/lib64/osgPlugins-2.3.4/osgdb_freetype.so) ==7229== by 0x7ED34FF: exit (in /lib/libc-2.6.1.so) ==7229== by 0x7EBCB4A: (below main) (in /lib/libc-2.6.1.so)* _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

