apollo9.0 运行camera_detection_single_stage报Eigen对齐错误
系统:ubuntu18.04 CPU:AMD Ryzen9 5950x 显卡:NVIDIA RTX 2060 显卡驱动:470
Describe the bug
(mainboard: external/eigen/Eigen/src/Core/DenseStorage.h:128: Eigen::internal::plain_array<T, Size, MatrixOrArrayOptions, 32>::plain_array() [with T = double; int Size = 16; int MatrixOrArrayOptions = 0]: Assertion `(internal::UIntPtr(eigen_unaligned_array_assert_workaround_gcc47(array)) & (31)) == 0 && "this assertion is explained here: " "http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" " **** READ THIS WEB PAGE !!! ****"' failed.)
最后定位到下图modules/perception/camera_detection_single_stage/detector/smoke/postprocess.cc,这个文件中make_shared的对象中存在Eigen的EIGEN_MAKE_ALIGNED_OPERATOR_NEW声明,造成忽略了对象中重载的operate new。
将
base::ObjectPtr obj = std::make_shared<base::Object>();
改为如下,解决问题
base::ObjectPtr obj (new base::Object());
疑惑
为什么camera_detection_multi_stage中,同样的逻辑处理位置,使用的是new。camera_detection_single_stage的问题是偶然的吗?