Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StaticVector for testOctree fails on both debug and release #340

Open
pgruenbacher opened this issue Jun 1, 2019 · 2 comments
Open

StaticVector for testOctree fails on both debug and release #340

pgruenbacher opened this issue Jun 1, 2019 · 2 comments
Labels
type: bug Something isn't working
Milestone

Comments

@pgruenbacher
Copy link
Contributor

I'm still investigating, trying to get build_tests actually running...

it doesn't look like StaticVector is used anywhere other than octree and quadtree.

==6812== Invalid free() / delete / delete[] / realloc()
==6812==    at 0x4C30D3B: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6812==    by 0x12310B: bs::FreeAlloc::free(void*) (BsFreeAlloc.h:29)
==6812==    by 0x1408CF: bs::StaticAlloc<6144, bs::FreeAlloc>::free(void*, unsigned int) (BsStaticAlloc.h:134)
==6812==    by 0x13EB26: bs::StdStaticAlloc<6144, bs::Octree<unsigned int, bs::DebugOctreeOptions>::HNode>::deallocate(bs::Octree<unsigned int, bs::DebugOctreeOptions>::HNode*, unsigned long) const (BsStaticAlloc.h:265)
==6812==    by 0x13BD28: std::allocator_traits<bs::StdStaticAlloc<6144, bs::Octree<unsigned int, bs::DebugOctreeOptions>::HNode> >::deallocate(bs::StdStaticAlloc<6144, bs::Octree<unsigned int, bs::DebugOctreeOptions>::HNode>&, bs::Octree<unsigned int, bs::DebugOctreeOptions>::HNode*, unsigned long) (alloc_traits.h:333)
==6812==    by 0x1369FB: std::_Vector_base<bs::Octree<unsigned int, bs::DebugOctreeOptions>::HNode, bs::StdStaticAlloc<6144, bs::Octree<unsigned int, bs::DebugOctreeOptions>::HNode> >::_M_deallocate(bs::Octree<unsigned int, bs::DebugOctreeOptions>::HNode*, unsigned long) (stl_vector.h:351)
==6812==    by 0x12B4FD: std::_Vector_base<bs::Octree<unsigned int, bs::DebugOctreeOptions>::HNode, bs::StdStaticAlloc<6144, bs::Octree<unsigned int, bs::DebugOctreeOptions>::HNode> >::~_Vector_base() (stl_vector.h:332)
==6812==    by 0x127ECB: std::vector<bs::Octree<unsigned int, bs::DebugOctreeOptions>::HNode, bs::StdStaticAlloc<6144, bs::Octree<unsigned int, bs::DebugOctreeOptions>::HNode> >::~vector() (stl_vector.h:680)
==6812==    by 0x127271: bs::Octree<unsigned int, bs::DebugOctreeOptions>::NodeIterator::~NodeIterator() (BsOctree.h:378)
==6812==    by 0x12728D: bs::Octree<unsigned int, bs::DebugOctreeOptions>::BoxIntersectIterator::~BoxIntersectIterator() (BsOctree.h:498)
==6812==    by 0x1166AF: bs::UtilityTestSuite::testOctree() (BsUtilityTestSuite.cpp:241)
==6812==    by 0x5FDFF78: bs::TestSuite::run(bs::TestOutput&) (BsTestSuite.cpp:22)
==6812==  Address 0x1ffeffe0e0 is on thread 1's stack
==6812==  in frame #10, created by bs::UtilityTestSuite::testOctree() (BsUtilityTestSuite.cpp:180)
==6812== 
@BearishSun BearishSun added the type: bug Something isn't working label Jun 2, 2019
@BearishSun BearishSun added this to the v1.2 milestone Jun 2, 2019
@BearishSun
Copy link
Member

Thanks for the report. StaticVector is a remnant from before when we had SmallVector. Hopefully switching these uses to SmallVector will resolve the problem.

@pgruenbacher
Copy link
Contributor Author

yea I just switched it to std::vector in the meantime and unit-tests are working for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants