coal-library / coal

An extension of the Flexible Collision Library
Other
328 stars 93 forks source link

test: bvh_model dereferences a null smart_ptr #600

Open nim65s opened 5 months ago

nim65s commented 5 months ago

Hi,

Some linux distributions (ArchLinux, but also Fedora and other RedHat things) use the _GLIBCXX_ASSERTIONS flag in their packages. And when we activate this flag on hpp-fcl devel / coal branches, the building_bvh_models test fail with:

/usr/include/c++/11/bits/shared_ptr_base.h:979: std::__shared_ptr_access<_Tp, _Lp, <anonymous>, <anonymous> >::element_type& std::__shared_ptr_access<_Tp, _Lp, <anonymous>, <anonymous
> >::operator*() const [with _Tp = std::vector<coal::Triangle>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic; bool <anonymous> = false; bool <anonymous> = false; std::__shared_ptr_acc
ess<_Tp, _Lp, <anonymous>, <anonymous> >::element_type = std::vector<coal::Triangle>]: Assertion '_M_get() != nullptr' failed.
unknown location(0): fatal error: in "building_bvh_models": signal: SIGABRT (application abort requested)

This show a null smart_ptr was dereferenced somewhere in that test.

To reproduce this, CXXFLAGS=-D_GLIBCXX_ASSERTIONS shoud be enough.