[osg-users] prog crashes sometimes with error in ot20-OpenThreadsd.dll

Christian Kunz christian.kunz83 at gmail.com
Thu Jun 18 09:02:22 PDT 2015


Hi,

I'm using OSG 3.2.2 with Qt 5.4.1. Compiler is VS2013.

To integrate into QtWidget I used a tutorial code, shown beneath.
The program crashes very often when I start it. I would say 8 of 10 tries.

When the program has started correctly everything is working fine.

I had the same problem on another machine and switched the compiled VS 2013 OSG sources and 3rdParty Tools to a version compiled with VS2012 and it worked.
The error did not occurred any more. On another machine this is not working. Error occurs with VS 2013 and VS2012 compiler.

I don´t know where the error could be or where to start. Any suggestions are welcome.

The program crashes and it says APPCRASH, error in ot20-OpenThreadsd.dll
when I debug it with VS2013 it looks like he crashes in Viewer.frame, or OpenThreads::setProcessorAffinity


So where could be the problem? Thank you for your help.




Code:
ViewerWidgetAS1::ViewerWidgetAS1( osgQt::GraphicsWindowQt* gw, osg::Node* scene, Ui::scenario1 *sceneUi, mySock *mysock1) : QWidget()
{
const osg::GraphicsContext::Traits* traits = gw->getTraits();

osg::Camera* camera = _viewer.getCamera();
camera->setGraphicsContext( gw );
camera->setClearColor( osg::Vec4(0.2, 0.2, 0.6, 1.0) );
camera->setViewport( new osg::Viewport(0, 0, traits->width, traits->height) );


camera->setProjectionMatrixAsPerspective(
30.0f, static_cast<double>(traits->width)/static_cast<double>(traits->height), 1.0f, 5000.0f );
_viewer.setSceneData( scene );
_viewer.addEventHandler( new osgViewer::StatsHandler );

osg::Vec3d eye( 1249.0, -390.0, 2200.0 );
osg::Vec3d center( 1250.0, -390.0, 285.0 );
osg::Vec3d up( 0.0, 1.0, 0.0 );

_viewer.getCamera()->setViewMatrixAsLookAt( eye, center, up );
_viewer.setThreadingModel( osgViewer::Viewer::SingleThreaded );

picker = new PickHandler(...);

_viewer.addEventHandler(picker);



QVBoxLayout* layout = new QVBoxLayout;
layout->addWidget( gw->getGLWidget() );
setLayout( layout );

connect( &_timer, SIGNAL(timeout()), this, SLOT(update()) );
_timer.start( 10 );



// full screen antialiasing (if supported)
osg::DisplaySettings::instance()->setNumMultiSamples( 16 );

//Add Group Node to root Node
m_scene->addChild(groupNodeGeodes);
// m_scene->addChild(groupNodeLines);

}






... 

Thank you!

Cheers,
Christian[/code]

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








More information about the osg-users mailing list