[osg-users] RayIntersector with KdTree causes a crash

Robert Osfield robert.osfield at gmail.com
Thu Jul 26 03:41:27 PDT 2018


Hi Ale,

The KdTree was refactored in 3.6.x to add support for points and lines
and PolytopeIntersector.  While there has been lots of internal
changes in it, it of course shouldn't crash.

At this point in time I don't have any idea where the issue stems
from.  Could you create a small example that reproduces the crash, I
or others can then step through what is happening and work out a fix.

Given this regression it looks like we'll have to make a 3.6.3 sooner
rather than later, but not before we fix the crash...

Cheers,
Robert.
On Thu, 26 Jul 2018 at 10:39, Ale Maro <sasha71 at teletu.it> wrote:
>
> Hi,
>
> we have a problem with OSG 3.6.2 and Visual Studio 2017
>
> We have a pick functionality in our software that uses RayIntersector.
> We enabled KdTrees for this use.
>
> When we apply the intersector to an object with a negative scale in the MatrixTransform parent node (e.g. scale = (-1, 1, 1)), it crashes inside the KdTree code.
>
> If we disable kdtree everything works fine.
> It also works with Visual Studio 2013 and OSG 3.4.0.
>
> Here is the call stack when crashed:
>
>
> >
> > >             osg157-osgUtild.dll!std::vector<unsigned int,std::allocator<unsigned int> >::operator[](const unsigned __int64 _Pos) Line 1818 C++
> >                osg157-osgUtild.dll!osg::KdTree::intersect<osg::TemplatePrimitiveFunctor<LineSegmentIntersectorUtils::IntersectFunctor<osg::Vec3d,double> > >(osg::TemplatePrimitiveFunctor<LineSegmentIntersectorUtils::IntersectFunctor<osg::Vec3d,double> > & functor, const osg::KdTree::KdNode & node) Line 160      C++
> >                osg157-osgUtild.dll!osg::KdTree::intersect<osg::TemplatePrimitiveFunctor<LineSegmentIntersectorUtils::IntersectFunctor<osg::Vec3d,double> > >(osg::TemplatePrimitiveFunctor<LineSegmentIntersectorUtils::IntersectFunctor<osg::Vec3d,double> > & functor, const osg::KdTree::KdNode & node) Line 176      C++
> >                osg157-osgUtild.dll!osg::KdTree::intersect<osg::TemplatePrimitiveFunctor<LineSegmentIntersectorUtils::IntersectFunctor<osg::Vec3d,double> > >(osg::TemplatePrimitiveFunctor<LineSegmentIntersectorUtils::IntersectFunctor<osg::Vec3d,double> > & functor, const osg::KdTree::KdNode & node) Line 176      C++
> >                osg157-osgUtild.dll!osgUtil::LineSegmentIntersector::intersect(osgUtil::IntersectionVisitor & iv, osg::Drawable * drawable, const osg::Vec3d & s, const osg::Vec3d & e) Line 540             C++
> >                osg157-osgUtild.dll!osgUtil::RayIntersector::intersect(osgUtil::IntersectionVisitor & iv, osg::Drawable * drawable) Line 122          C++
> >                osg157-osgUtild.dll!osgUtil::IntersectionVisitor::intersect(osg::Drawable * drawable) Line 282   C++
> >                osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Geode & geode) Line 240     C++
> >                osg157-osgd.dll!osg::Geode::accept(osg::NodeVisitor & nv) Line 37         C++
> >                osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) Line 63      C++
> >                osg157-osgFXd.dll!osgFX::Effect::inherited_traverse(osg::NodeVisitor & nv) Line 213      C++
> >                osg157-osgFXd.dll!osgFX::Effect::traverse(osg::NodeVisitor & nv) Line 51              C++
> >                osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) Line 278                C++
> >                osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Group & group) Line 221       C++
> >                osg157-osgFXd.dll!osgFX::Outline::accept(osg::NodeVisitor & nv) Line 54              C++
> >                osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) Line 63      C++
> >                osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) Line 278                C++
> >                osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Transform & transform) Line 417      C++
> >                osg157-osgd.dll!osg::NodeVisitor::apply(osg::MatrixTransform & node) Line 158              C++
> >                osg157-osgd.dll!osg::MatrixTransform::accept(osg::NodeVisitor & nv) Line 37    C++
> >                osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) Line 63      C++
> >                osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) Line 278                C++
> >                osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Group & group) Line 221       C++
> >                osg157-osgd.dll!osg::Group::accept(osg::NodeVisitor & nv) Line 38          C++
> >                osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) Line 63      C++
> >                osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) Line 278                C++
> >                osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Transform & transform) Line 417      C++
> >                osg157-osgd.dll!osg::NodeVisitor::apply(osg::MatrixTransform & node) Line 158              C++
> >                osg157-osgd.dll!osg::MatrixTransform::accept(osg::NodeVisitor & nv) Line 37    C++
> >                osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) Line 63      C++
> >                osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) Line 278                C++
> >                osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Group & group) Line 221       C++
> >                osg157-osgd.dll!osg::Group::accept(osg::NodeVisitor & nv) Line 38          C++
> >                osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) Line 63      C++
> >                osg157-osgShadowd.dll!osgShadow::ShadowedScene::traverse(osg::NodeVisitor & nv) Line 69  C++
> >                osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) Line 278                C++
> >                osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Group & group) Line 221       C++
> >                osg157-osgShadowd.dll!osgShadow::ShadowedScene::accept(osg::NodeVisitor & nv) Line 36     C++
> >                osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) Line 63      C++
> >                osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) Line 278                C++
> >                osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Group & group) Line 221       C++
> >                osg157-osgd.dll!osg::NodeVisitor::apply(osg::ClipNode & node) Line 128              C++
> >                osg157-osgd.dll!osg::ClipNode::accept(osg::NodeVisitor & nv) Line 35    C++
> >                osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) Line 63      C++
> >                osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) Line 278                C++
> >                osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Group & group) Line 221       C++
> >                osg157-osgd.dll!osg::Group::accept(osg::NodeVisitor & nv) Line 38          C++
> >                osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) Line 63      C++
> >                osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) Line 278                C++
> >                osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Camera & camera) Line 498 C++
> >                osg157-osgd.dll!osg::Camera::accept(osg::NodeVisitor & nv) Line 54       C++
> >
> >
>
>
>
> Thank you in advance.
>
>
> Berst regards
>
> Ale
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=74387#74387
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


More information about the osg-users mailing list