<div dir="ltr">Just a quick remark,<div>I think the warning you see is caused by the State destructor deleting the context's extensions:</div><div><br></div><div>file src/osg/State.cpp (line 138)</div><div><br></div><div>in State::~State() <br></div><div> GLExtensions::Set(_contextID, 0); </div><div><br></div><div>I think it caused me problems with loosing the extensions wen a camera was deleted, causing the databasethread to stop loading compressed images, as it cannot query the openGL context.</div><div>I have no proposal for a fix yet, as I do not feel I fully understand the intention of the code. Removing the "GLExtensions::Set()" call seemed to remove my problem.</div><div><br></div><div>Laurens.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 2, 2015 at 2:19 PM, Robert Osfield <span dir="ltr"><<a href="mailto:robert.osfield@gmail.com" target="_blank">robert.osfield@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hi Roman,<br><br></div>I have just built osgearth git head, but had to make a couple of build fixes to enable me to compile it against OSG head which is OSG-3.5.0. I have cloned osgearth on git hub and post my fixes to this:<br><br><a href="https://github.com/robertosfield/osgearth" target="_blank">https://github.com/robertosfield/osgearth</a><br><br></div>I haven't seen the error you have but do get a warning: <br> <br><div> Error: OpenGL version test failed, requires valid graphics context.<br><br></div><div>On exit from osgearth_viewer. This suggests that the GLExtensions object is be constructed during cleanup for some reason. Since the GLExensions object is used when called glDeleteShader there is chance the error you seeing is related to this.<br><br></div><div>However, if I run the same .earth file with osgviewer I get a clean exit with no warnings.<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Robert<br></div><div><br></div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On 2 November 2015 at 09:55, Roman Grigoriev <span dir="ltr"><<a href="mailto:grigoriev@gosniias.ru" target="_blank">grigoriev@gosniias.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi, I use osg and osgearth git version under linux Lubuntu 15.04 nvidia 352 driver.<br>
And got segfaults on delete shaders<br>
<br>
Code:<br>
<br>
#0 0x00007ffff34fbe09 in glDeleteShader () from /usr/lib/nvidia-352/libGL.so.1<br>
#1 0x00007ffff6c8bce5 in osg::Shader::PerContextShader::~PerContextShader() () from /usr/local/lib64/libosg.so.140<br>
#2 0x00007ffff6c8bf59 in osg::Shader::PerContextShader::~PerContextShader() () from /usr/local/lib64/libosg.so.140<br>
#3 0x00007ffff6c8c3ae in osg::Shader::ShaderObjects::~ShaderObjects() () from /usr/local/lib64/libosg.so.140<br>
#4 0x00007ffff6c8ae8d in osg::Shader::releaseGLObjects(osg::State*) const () from /usr/local/lib64/libosg.so.140<br>
#5 0x00007ffff6c73375 in osg::Program::releaseGLObjects(osg::State*) const () from /usr/local/lib64/libosg.so.140<br>
#6 0x00007ffff7a8af81 in osgEarth::VirtualProgram::releaseGLObjects(osg::State*) const () from /usr/local/lib64/libosgEarth.so.0<br>
#7 0x00007ffff7a2eb55 in osgEarth::StateSetCache::prune() () from /usr/local/lib64/libosgEarth.so.0<br>
#8 0x00007ffff7a2ea0e in osgEarth::StateSetCache::pruneIfNecessary() () from /usr/local/lib64/libosgEarth.so.0<br>
#9 0x00007ffff7a2e8a5 in osgEarth::StateSetCache::share(osg::ref_ptr<osg::StateAttribute>&, osg::ref_ptr<osg::StateAttribute>&, bool) () from /usr/local/lib64/libosgEarth.so.0<br>
#10 0x00007ffff7a2db0a in (anonymous namespace)::ShareStateAttributes::applyStateSet(osg::StateSet*) () from /usr/local/lib64/libosgEarth.so.0<br>
#11 0x00007ffff7a2d89c in (anonymous namespace)::ShareStateAttributes::apply(osg::Node&) () from /usr/local/lib64/libosgEarth.so.0<br>
#12 0x00007ffff7895ef6 in osg::Group::accept(osg::NodeVisitor&) () from /usr/local/lib64/libosgEarth.so.0<br>
#13 0x00007ffff7a2e4fd in osgEarth::StateSetCache::consolidateStateAttributes(osg::Node*) () from /usr/local/lib64/libosgEarth.so.0<br>
#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<br>
#15 0x00007ffff2e825cf in osgEarth::Features::GeometryCompiler::compile(osgEarth::Features::FeatureCursor*, osgEarth::Symbology::Style const&, osgEarth::Features::FilterContext const&) ()<br>
from /usr/local/lib64/libosgEarthFeatures.so.0<br>
#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<br>
#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<br>
#18 0x00007ffff2e51726 in osgEarth::Features::FeatureModelGraph::createStyleGroup(osgEarth::Symbology::Style const&, osgEarth::Symbology::Query const&, osgEarth::Features::FeatureIndexBuilder*) ()<br>
from /usr/local/lib64/libosgEarthFeatures.so.0<br>
#19 0x00007ffff2e4eeed in osgEarth::Features::FeatureModelGraph::buildLevel(osgEarth::Features::FeatureLevel const&, osgEarth::GeoExtent const&, osgEarth::TileKey const*) ()<br>
from /usr/local/lib64/libosgEarthFeatures.so.0<br>
#20 0x00007ffff2e4e08a in osgEarth::Features::FeatureModelGraph::load(unsigned int, unsigned int, unsigned int, std::string const&) () from /usr/local/lib64/libosgEarthFeatures.so.0<br>
#21 0x00007ffff2e55d1a in osgEarthFeatureModelPseudoLoader::readNode(std::string const&, osgDB::Options const*) const () from /usr/local/lib64/libosgEarthFeatures.so.0<br>
#22 0x00007ffff67ecb73 in osgDB::Registry::ReadNodeFunctor::doRead(osgDB::ReaderWriter&) const () from /usr/local/lib64/libosgDB.so.140<br>
#23 0x00007ffff67e6903 in osgDB::Registry::read(osgDB::Registry::ReadFunctor const&) () from /usr/local/lib64/libosgDB.so.140<br>
#24 0x00007ffff67e786f in osgDB::Registry::readImplementation(osgDB::Registry::ReadFunctor const&, osgDB::Options::CacheHintOptions) () from /usr/local/lib64/libosgDB.so.140<br>
#25 0x00007ffff67e831f in osgDB::Registry::readNodeImplementation(std::string const&, osgDB::Options const*) () from /usr/local/lib64/libosgDB.so.140<br>
#26 0x00007ffff679a5c6 in osgDB::DatabasePager::DatabaseThread::run() () from /usr/local/lib64/libosgDB.so.140<br>
#27 0x00007ffff482bb5e in OpenThreads::ThreadPrivateActions::StartThread(void*) () from /usr/local/lib64/libOpenThreads.so.20<br>
#28 0x00007ffff58c46aa in start_thread (arg=0x7fffc97fa700) at pthread_create.c:333<br>
#29 0x00007ffff5be1eed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109<br>
<br>
<br>
<br>
<br>
So if I comment line 47 in Shader.cpp<br>
if (extensions->isGlslSupported) extensions->glDeleteShader( globj );<br>
and 51 in Program.cpp<br>
if (extensions->isGlslSupported) extensions->glDeleteProgram( globj );<br>
and I don't have segfaults.<br>
<br>
It's very easily to reproduse simple run osgearth_viewer with any earth file.<br>
<br>
Thank you!<br>
<br>
Cheers,<br>
Roman[/code]<br>
<br>
------------------<br>
Read this topic online here:<br>
<a href="http://forum.openscenegraph.org/viewtopic.php?p=65510#65510" rel="noreferrer" target="_blank">http://forum.openscenegraph.org/viewtopic.php?p=65510#65510</a><br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
<br></blockquote></div><br></div>