Hi,

Maybe your picking threads traverse the scene graph while the database pager or the incremental compile operation modify it.

During the update traversal of the viewer, the no longer visible terrain tiles are removed from the scene graph and the just loaded tiles are merged with the scene graph. If an intersection visitor traverse a part of the scene graph while the paging processadds or removes a child, the application will most probably crash.

The solution I used is to break up the Viewer::run method and call the event, update, rendering traversalsmanually:

eventTraversal()
stop the picking threads
updateTraversal()
restart the picking threads
renderingTraversal()

The ViewerBase::updateTraversalmethod is virtual. Another solution is to sub-class the Viewerand overload the update traversal:

::updateTraversal
{
stop the picking threads
Viewer::updateTraversal()
restart the picking threads
}

On 15/05/2013 23:08, Joe Doob wrote:
Hi,

I wonder if anyone can offer some insight on why I may be experiencing these 
random crashes.

Essentially I have many line intersection visitors following a node which is 
moving through the scene and performing line intersections on terrain, which is 
a pagedLOD database of proxynodes.

This is done in a multithreaded fashion, i.e. there are many threads each with 
a lineSegmentIntersector and intersectionVisitor of its own. By and large, it 
works great, but on very rare and seemingly random occasions the application 
crashes with a segmentation fault.

It traces to the accept call, where I am calling the terrain's group node's 
accept function on an intersection visitor.

A human-friendly version of the backtrace is as follows:
Code:

osg::Group::computeBound at Group.cpp
  osg::LOD::computeBound at LOD.cpp
getBound at Node.cpp
isCullingActive at Node.cpp
enter at LineSegmentIntersector.cpp
enter at IntersectionVisitor.cpp
accept at Group.cpp
traverse at Group.cpp
apply at IntersectionVisitor.cpp
accept at Group.cpp




The code that performs the actual intersection looks like this:


Code:

lineSegmentIntersector->setStart(start);
lineSegmentIntersector->setEnd(end);
intersectionVisitor->reset();
root->accept(*intersectionVisitor);




It's possible I am doing something evil with this multithreading setup that I 
am unaware of (please tell me!), but since everything works 99.9% of the time, 
I suspect there is something more subtle going on.

I am running OSG 3.0.1 in C++.

Thanks,
Stathibus

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





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


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

Reply via email to