[osg-users] crashing with paged LODs, line intersector on computeBound

22 views
Skip to first unread message

Joe Doob

unread,
May 15, 2013, 5:08:53 PM5/15/13
to osg-...@lists.openscenegraph.org
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
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Lionel Lagarde

unread,
May 16, 2013, 4:54:42 AM5/16/13
to osg-...@lists.openscenegraph.org
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 process adds 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 traversals manually:

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

The ViewerBase::
updateTraversal method is virtual. Another solution is to sub-class the Viewer and overload the update traversal:

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

Reply all
Reply to author
Forward
0 new messages