I am running a program with a composite viewer which contains one viewer for 
pure openGL rendering and multiple other views for scene rendering.  The scene 
consists of any number of loaded 3d models and a TerraPage database.  The code 
is set up as follows (I have copy/pasted and inserted pseudo code as the 
program is not compact enough to fully include.  If any omitted parts are 
important, let me know and I'll post them!):

this->_view = new osgViewer::Viewer;
this->_view->setName("_view");
this->_view->setSceneData(this->_sceneGroup.get());

this->_compositeViewer = new osgViewer::CompositeViewer;
this->_compositeViewer->setName("_compositeViewer");
this->_compositeViewer->addView(this->_view);

// Set up Traits ...


// Set up Graphics Context...


// Set up Display Settings


this->_view->setThreadingModel(osgViewer::Viewer::SingleThreaded);
this->_view->setUpThreading(); 
this->_view->startThreading();

this->_compositeViewer->setThreadingModel(osgViewer::Viewer::SingleThreaded);
this->_compositeViewer->realize();

this->_view->getCamera()->setInitialDrawCallback(new 
CameraInitialDrawCallback(this));
this->_view->getCamera()->setFinalDrawCallback(new 
CameraFinalDrawCallback(this));
this->_compositeViewer->setUpThreading();
this->_compositeViewer->startThreading();

while(...)
{

this->_compositeViewer->frame();
}


Other views are added via:

void ...addViewer(osgViewer::Viewer* x)
{
const unsigned int viewSize = this->_compositeViewer->getNumViews();

for(unsigned int i = 0; i < viewSize; i++)
{
if(this->_compositeViewer->getView(i) == x)
{
return;
}
}

x->setThreadingModel(osgViewer::Viewer::SingleThreaded);
x->addEventHandler(this->_eventHandler);
x->setKeyEventSetsDone(24);
x->setUpThreading();
x->startThreading();

this->_compositeViewer->addView(x);
}

These other views have a database pager attached to them:

this->_scene = this->_viewer->getScene();

if(this->_scene->getDatabasePager() == NULL)
{
this->_scene->setDatabasePager(new osgDB::DatabasePager);
this->_scene->getDatabasePager()->setTargetFrameRate(60.0f);
this->_scene->getDatabasePager()->registerPagedLODs(this->getSceneManager()->getTerrainDatabase());
}

Just a few frames into the applicaiton, it can crash.  It appears as though all 
threads continue to run except for the database pager.  I get the following 
stack trace with the current version on SVN:

>osg60-osg.dll!osg::BoundingBoxImpl<osg::Vec3f>::expandBy(const osg::Vec3f & 
>v={...})  Line 152C++
 osg60-osg.dll!ComputeBound::drawArrays(unsigned int __formal=5, int first=354, 
int count=1197852551)  Line 706 + 0x2f bytesC++
 osg60-osg.dll!osg::DrawArrayLengths::accept(osg::PrimitiveFunctor & 
functor={...})  Line 92C++
 osg60-osg.dll!osg::Geometry::accept(osg::PrimitiveFunctor & functor={...})  
Line 2241 + 0x29 bytesC++
 osg60-osg.dll!osg::Drawable::computeBound()  Line 781C++
 osg60-osg.dll!osg::Drawable::getBound()  Line 203 + 0xe bytesC++
 osg60-osg.dll!osg::Geode::computeBound()  Line 192 + 0x1e bytesC++
 osg60-osg.dll!osg::Node::getBound()  Line 334 + 0xe bytesC++
 osg60-osg.dll!osg::Group::computeBound()  Line 357 + 0x16 bytesC++
 osg60-osg.dll!osg::Node::getBound()  Line 334 + 0xe bytesC++
 osg60-osg.dll!osg::Group::computeBound()  Line 357 + 0x16 bytesC++
 osg60-osg.dll!osg::Node::getBound()  Line 334 + 0xe bytesC++
 osg60-osg.dll!osg::Group::computeBound()  Line 357 + 0x16 bytesC++
 osgdb_txp.dll!txp::TXPPagedLOD::computeBound()  Line 121C++
 osg60-osg.dll!osg::Node::getBound()  Line 334 + 0xe bytesC++
 osg60-osg.dll!osg::Group::computeBound()  Line 357 + 0x16 bytesC++
 osg60-osg.dll!osg::Node::getBound()  Line 334 + 0xe bytesC++
 osg60-osgDB.dll!osgDB::DatabasePager::DatabaseThread::run()  Line 607C++
 ot11-OpenThreads.dll!OpenThreads::ThreadPrivateActions::StartThread(void * 
data=0x037c9d5c)  Line 65535C++
 msvcr90.dll!_callthreadstartex()  Line 348 + 0x6 bytesC
 msvcr90.dll!_threadstartex(void * ptd=0x06aae2e8)  Line 326 + 0x5 bytesC
 kernel32.dll!7c80b729() 
 [Frames below may be incorrect and/or missing, no symbols loaded for 
kernel32.dll]

I am not an OSG expert by any means, but have been trying to fix this for over 
a week and just don't have any insight into what might cause this.  Any help 
would be appreciated!

- John


      
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to