Giter Site home page Giter Site logo

Comments (4)

lmontaut avatar lmontaut commented on August 14, 2024 1

Hi @salihmarangoz,
Thanks for reporting this issue! The problem was due do uninitialized iterators, it should be fixed with #515.

from hpp-fcl.

jcarpent avatar jcarpent commented on August 14, 2024

Could you share a reproducible example please?

from hpp-fcl.

salihmarangoz avatar salihmarangoz commented on August 14, 2024

Did some tests:

  • Spheres -> ok
  • Inflated spheres -> ok
  • Spheres + Inflated spheres -> ok
  • Spheres + plane -> ok
  • Inflated spheres + plane -> segmentation fault

Multiple inflated spheres are ok. But planes don't work together with inflated spheres. Perhaps is there a problem with using the copy constructor of Sphere?

#include <hpp/fcl/shape/geometric_shapes.h>
#include <hpp/fcl/collision.h>
#include <hpp/fcl/broadphase/broadphase.h>

using hpp::fcl::DynamicAABBTreeCollisionManager;
using hpp::fcl::Vec3f;
using hpp::fcl::CollisionObject;
using hpp::fcl::Sphere;
using hpp::fcl::Plane;


int main()
{
  DynamicAABBTreeCollisionManager collision_manager;

  std::vector<CollisionObject*> collision_objects;

  // auto o1 = new CollisionObject(hpp::fcl::make_shared<Sphere>(0.1));
  // o1->setTranslation(Vec3f(0.2, 0.1, 0.4));
  // o1->computeAABB();
  // collision_objects.push_back(o1);

  // auto o2 = new CollisionObject(hpp::fcl::make_shared<Sphere>(0.2));
  // o2->setTranslation(Vec3f(0.3, 0.2, 0.4));
  // o2->computeAABB();
  // collision_objects.push_back(o2);

  auto o3 = new CollisionObject(hpp::fcl::make_shared<Plane>(0.0, 0.0, 1.0, 0.0));
  o3->computeAABB();
  collision_objects.push_back(o3);

  auto o4 = new CollisionObject(hpp::fcl::make_shared<Sphere>(Sphere(0.05).inflated(0.05).first));
  o4->setTranslation(Vec3f(0.1, 0.3, 0.4));
  o4->computeAABB();
  collision_objects.push_back(o4);

  collision_manager.registerObjects(collision_objects);
  collision_manager.update();
}

AddressSanitizer output:

AddressSanitizer:DEADLYSIGNAL
=================================================================
==218156==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f5b4ff8df89 bp 0x602000000270 sp 0x7ffd27381ec0 T0)
==218156==The signal is caused by a READ memory access.
==218156==Hint: address points to the zero page.
    #0 0x7f5b4ff8df88 in hpp::fcl::detail::HierarchyTree<hpp::fcl::AABB>::bottomup(__gnu_cxx::__normal_iterator<hpp::fcl::detail::NodeBase<hpp::fcl::AABB>**, std::vector<hpp::fcl::detail::NodeBase<hpp::fcl::AABB>*, std::allocator<hpp::fcl::detail::NodeBase<hpp::fcl::AABB>*> > >, __gnu_cxx::__normal_iterator<hpp::fcl::detail::NodeBase<hpp::fcl::AABB>**, std::vector<hpp::fcl::detail::NodeBase<hpp::fcl::AABB>*, std::allocator<hpp::fcl::detail::NodeBase<hpp::fcl::AABB>*> > >) include/hpp/fcl/broadphase/detail/hierarchy_tree-inl.h:307
    #1 0x7f5b4ff8edd4 in hpp::fcl::detail::HierarchyTree<hpp::fcl::AABB>::topdown_0(__gnu_cxx::__normal_iterator<hpp::fcl::detail::NodeBase<hpp::fcl::AABB>**, std::vector<hpp::fcl::detail::NodeBase<hpp::fcl::AABB>*, std::allocator<hpp::fcl::detail::NodeBase<hpp::fcl::AABB>*> > >, __gnu_cxx::__normal_iterator<hpp::fcl::detail::NodeBase<hpp::fcl::AABB>**, std::vector<hpp::fcl::detail::NodeBase<hpp::fcl::AABB>*, std::allocator<hpp::fcl::detail::NodeBase<hpp::fcl::AABB>*> > >) include/hpp/fcl/broadphase/detail/hierarchy_tree-inl.h:397
    #2 0x7f5b4ff8f044 in hpp::fcl::detail::HierarchyTree<hpp::fcl::AABB>::init_0(std::vector<hpp::fcl::detail::NodeBase<hpp::fcl::AABB>*, std::allocator<hpp::fcl::detail::NodeBase<hpp::fcl::AABB>*> >&) include/hpp/fcl/broadphase/detail/hierarchy_tree-inl.h:468
    #3 0x7f5b4ff8ab51 in hpp::fcl::detail::HierarchyTree<hpp::fcl::AABB>::init(std::vector<hpp::fcl::detail::NodeBase<hpp::fcl::AABB>*, std::allocator<hpp::fcl::detail::NodeBase<hpp::fcl::AABB>*> >&, int) include/hpp/fcl/broadphase/detail/hierarchy_tree-inl.h:83
    #4 0x7f5b4ff8ab51 in hpp::fcl::DynamicAABBTreeCollisionManager::registerObjects(std::vector<hpp::fcl::CollisionObject*, std::allocator<hpp::fcl::CollisionObject*> > const&) src/broadphase/broadphase_dynamic_AABB_tree.cpp:471
    #5 0x555ca7021717 in main (/home/salih/catkin_ws/devel_release/.private/hpp_fcl_issue_514/lib/hpp_fcl_issue_514/hpp_fcl_issue_514_node+0x6717)
    #6 0x7f5b4f84c082 in __libc_start_main ../csu/libc-start.c:308
    #7 0x555ca7021d3d in _start (/home/salih/catkin_ws/devel_release/.private/hpp_fcl_issue_514/lib/hpp_fcl_issue_514/hpp_fcl_issue_514_node+0x6d3d)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV include/hpp/fcl/broadphase/detail/hierarchy_tree-inl.h:307 in hpp::fcl::detail::HierarchyTree<hpp::fcl::AABB>::bottomup(__gnu_cxx::__normal_iterator<hpp::fcl::detail::NodeBase<hpp::fcl::AABB>**, std::vector<hpp::fcl::detail::NodeBase<hpp::fcl::AABB>*, std::allocator<hpp::fcl::detail::NodeBase<hpp::fcl::AABB>*> > >, __gnu_cxx::__normal_iterator<hpp::fcl::detail::NodeBase<hpp::fcl::AABB>**, std::vector<hpp::fcl::detail::NodeBase<hpp::fcl::AABB>*, std::allocator<hpp::fcl::detail::NodeBase<hpp::fcl::AABB>*> > >)
==218156==ABORTING

from hpp-fcl.

jcarpent avatar jcarpent commented on August 14, 2024

Solved via #515

from hpp-fcl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.