[osg-users] segfaults with glDeleteShader

Roman Grigoriev grigoriev at gosniias.ru
Mon Nov 2 01:55:26 PST 2015


Hi, I use osg and osgearth git version under linux  Lubuntu 15.04 nvidia 352 driver.
And got segfaults on delete shaders 

Code:

#0  0x00007ffff34fbe09 in glDeleteShader () from /usr/lib/nvidia-352/libGL.so.1 
#1  0x00007ffff6c8bce5 in osg::Shader::PerContextShader::~PerContextShader() () from /usr/local/lib64/libosg.so.140 
#2  0x00007ffff6c8bf59 in osg::Shader::PerContextShader::~PerContextShader() () from /usr/local/lib64/libosg.so.140 
#3  0x00007ffff6c8c3ae in osg::Shader::ShaderObjects::~ShaderObjects() () from /usr/local/lib64/libosg.so.140 
#4  0x00007ffff6c8ae8d in osg::Shader::releaseGLObjects(osg::State*) const () from /usr/local/lib64/libosg.so.140 
#5  0x00007ffff6c73375 in osg::Program::releaseGLObjects(osg::State*) const () from /usr/local/lib64/libosg.so.140 
#6  0x00007ffff7a8af81 in osgEarth::VirtualProgram::releaseGLObjects(osg::State*) const () from /usr/local/lib64/libosgEarth.so.0 
#7  0x00007ffff7a2eb55 in osgEarth::StateSetCache::prune() () from /usr/local/lib64/libosgEarth.so.0 
#8  0x00007ffff7a2ea0e in osgEarth::StateSetCache::pruneIfNecessary() () from /usr/local/lib64/libosgEarth.so.0 
#9  0x00007ffff7a2e8a5 in osgEarth::StateSetCache::share(osg::ref_ptr<osg::StateAttribute>&, osg::ref_ptr<osg::StateAttribute>&, bool) () from /usr/local/lib64/libosgEarth.so.0 
#10 0x00007ffff7a2db0a in (anonymous namespace)::ShareStateAttributes::applyStateSet(osg::StateSet*) () from /usr/local/lib64/libosgEarth.so.0 
#11 0x00007ffff7a2d89c in (anonymous namespace)::ShareStateAttributes::apply(osg::Node&) () from /usr/local/lib64/libosgEarth.so.0 
#12 0x00007ffff7895ef6 in osg::Group::accept(osg::NodeVisitor&) () from /usr/local/lib64/libosgEarth.so.0 
#13 0x00007ffff7a2e4fd in osgEarth::StateSetCache::consolidateStateAttributes(osg::Node*) () from /usr/local/lib64/libosgEarth.so.0 
#14 0x00007ffff2e84753 in osgEarth::Features::GeometryCompiler::compile(std::list<osg::ref_ptr<osgEarth::Features::Feature>, std::allocator<osg::ref_ptr<osgEarth::Features::Feature> > >&, osgEarth::Symbology::Style const&, osgEarth::Features::FilterContext const&) () from /usr/local/lib64/libosgEarthFeatures.so.0 
#15 0x00007ffff2e825cf in osgEarth::Features::GeometryCompiler::compile(osgEarth::Features::FeatureCursor*, osgEarth::Symbology::Style const&, osgEarth::Features::FilterContext const&) () 
   from /usr/local/lib64/libosgEarthFeatures.so.0 
#16 0x00007ffff2e6563b in osgEarth::Features::GeomFeatureNodeFactory::createOrUpdateNode(osgEarth::Features::FeatureCursor*, osgEarth::Symbology::Style const&, osgEarth::Features::FilterContext const&, osg::ref_ptr<osg::Node>&) () from /usr/local/lib64/libosgEarthFeatures.so.0 
#17 0x00007ffff2e51339 in osgEarth::Features::FeatureModelGraph::createStyleGroup(osgEarth::Symbology::Style const&, std::list<osg::ref_ptr<osgEarth::Features::Feature>, std::allocator<osg::ref_ptr<osgEarth::Features::Feature> > >&, osgEarth::Features::FilterContext const&) () from /usr/local/lib64/libosgEarthFeatures.so.0 
#18 0x00007ffff2e51726 in osgEarth::Features::FeatureModelGraph::createStyleGroup(osgEarth::Symbology::Style const&, osgEarth::Symbology::Query const&, osgEarth::Features::FeatureIndexBuilder*) () 
   from /usr/local/lib64/libosgEarthFeatures.so.0 
#19 0x00007ffff2e4eeed in osgEarth::Features::FeatureModelGraph::buildLevel(osgEarth::Features::FeatureLevel const&, osgEarth::GeoExtent const&, osgEarth::TileKey const*) () 
   from /usr/local/lib64/libosgEarthFeatures.so.0 
#20 0x00007ffff2e4e08a in osgEarth::Features::FeatureModelGraph::load(unsigned int, unsigned int, unsigned int, std::string const&) () from /usr/local/lib64/libosgEarthFeatures.so.0 
#21 0x00007ffff2e55d1a in osgEarthFeatureModelPseudoLoader::readNode(std::string const&, osgDB::Options const*) const () from /usr/local/lib64/libosgEarthFeatures.so.0 
#22 0x00007ffff67ecb73 in osgDB::Registry::ReadNodeFunctor::doRead(osgDB::ReaderWriter&) const () from /usr/local/lib64/libosgDB.so.140 
#23 0x00007ffff67e6903 in osgDB::Registry::read(osgDB::Registry::ReadFunctor const&) () from /usr/local/lib64/libosgDB.so.140 
#24 0x00007ffff67e786f in osgDB::Registry::readImplementation(osgDB::Registry::ReadFunctor const&, osgDB::Options::CacheHintOptions) () from /usr/local/lib64/libosgDB.so.140 
#25 0x00007ffff67e831f in osgDB::Registry::readNodeImplementation(std::string const&, osgDB::Options const*) () from /usr/local/lib64/libosgDB.so.140 
#26 0x00007ffff679a5c6 in osgDB::DatabasePager::DatabaseThread::run() () from /usr/local/lib64/libosgDB.so.140 
#27 0x00007ffff482bb5e in OpenThreads::ThreadPrivateActions::StartThread(void*) () from /usr/local/lib64/libOpenThreads.so.20 
#28 0x00007ffff58c46aa in start_thread (arg=0x7fffc97fa700) at pthread_create.c:333 
#29 0x00007ffff5be1eed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109 




So if I comment line 47 in Shader.cpp
        if (extensions->isGlslSupported) extensions->glDeleteShader( globj );
and 51 in Program.cpp
        if (extensions->isGlslSupported) extensions->glDeleteProgram( globj );
and I don't have segfaults.

It's very easily to reproduse simple run osgearth_viewer with any earth file. 

Thank you!

Cheers,
Roman[/code]

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=65510#65510








More information about the osg-users mailing list