moveit segfaults due to eigen
I am running ros melodic on an up to date unstable x86_64 gentoo with ebuilds from the ros-overlay. As far as I am aware the last update of the ebuilds was three days ago. I tested with moveit-0.10.0 as well as the recently released moveit-1.0.0.
So far I have tested gcc-7.3.0, gcc-7.4.0, gcc-8.2.0 and gcc-8.3.0 with binutils-2.31.1 and -2.32 with the same results.
I have tested eigen 3.3.4, 3.3.5 and 3.3.7 against gcc-8.3.0, binutils-2.32 and moveit-1.0.0 with the same results.
Either rviz or move_group will crash somewhere in moveit code with segfaults cause by eigen. I have attached a few crash reports with similar failures.
After reading "Eigen Memory Issues" and "Explanation of the assertion on unaligned arrays" I am aware eigen related segfaults can be caused by mismatched build flags which might be an issue on gentoo. All ros related packages are build with "-O2 -pipe -march=native -mtune=native -Wall -g -ggdb". I also created a local catkin workspace where I rebuild industrial_core, motoman, moveit, moveit_visual_tools and rviz with the same build flags and both -std=c++11 and -std=c++14 with no change in outcome.
I used to be able to run the same commands i tested with eigen-3.2.8 and moveit-0.10.0 but since moveit-1.0.0 requires eigen-3.3 and eigen-3.2 has been deprecated in gentoo I am reluctant to downgrade back to that. Blender and meshlab which also depend on eigen do run without segfaults.
Since I am not fully certain if this is a build system error or an error in moveit I haven't filled an issue on github yet.
When i compile moveit_core with "-Wall" set I get this suspicious warning:
/var/tmp/portage/ros-melodic-moveit_core-1.0.0/work/moveit_core-1.0.0/robot_state/src/robot_state.cpp: In member function 'void moveit::core::RobotState::copyFrom(const moveit::core::RobotState&)':
/var/tmp/portage/ros-melodic-moveit_core-1.0.0/work/moveit_core-1.0.0/robot_state/src/robot_state.cpp:161:79: warning: 'void* memcpy(void*, const void*, size_t)' writing to an object of type 'Eigen::Isometry3d' {aka 'class Eigen::Transform<double, 3, 1>'} with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
memcpy(variable_joint_transforms_, other.variable_joint_transforms_, bytes);
^
In file included from /usr/include/eigen3/Eigen/Geometry:44,
from /var/tmp/portage/ros-melodic-moveit_core-1.0.0/work/moveit_core-1.0.0/robot_model/include/moveit/robot_model/joint_model.h:47,
from /var/tmp/portage/ros-melodic-moveit_core-1.0.0/work/moveit_core-1.0.0/robot_model/include/moveit/robot_model/joint_model_group.h:41,
from /var/tmp/portage/ros-melodic-moveit_core-1.0.0/work/moveit_core-1.0.0/robot_model/include/moveit/robot_model/robot_model.h:47,
from /var/tmp/portage/ros-melodic-moveit_core-1.0.0/work/moveit_core-1.0.0/robot_state/include/moveit/robot_state/robot_state.h:41,
from /var/tmp/portage/ros-melodic-moveit_core-1.0.0/work/moveit_core-1.0.0/robot_state/src/robot_state.cpp:38:
/usr/include/eigen3/Eigen/src/Geometry/Transform.h:201:7: note: 'Eigen::Isometry3d ...