Replies: 2 comments 4 replies
-
I have ran into a lot of eigen alignment issues on linux also. It turns out if any class or struct contains a member variable which is an alignable type then that class and struct must have |
Beta Was this translation helpful? Give feedback.
-
Adding the compiler flag |
Beta Was this translation helpful? Give feedback.
-
TL;DR Eigen alignment is causing crashes on Windows in some situations. Disabling Eigen using
-DEIGEN_DONT_ALIGN=1 -DEIGEN_DONT_VECTORIZE=1
seems to fix the problem.After a long search for the crashes on Windows, I found #746 and tesseract-robotics/tesseract_ext#44 as the source of the problems, as well as a strange crash with Eigen that took a long time to track down. Eigen attempts to align the data structures so they can be used with vectorized instructions. I am not sure how it is done on Linux, but on Windows the segfaults were tracked down to a function
handmade_aligned_free
. There is a correspondinghandmade_aligned_alloc
.I have read that it may be the DLL interfaces causing the problem, but in general this type of pointer arithmetic is a bad idea.
MSVC has
_aligned_malloc
and_aligned_free
functions which should be used instead, but I don't know enough about eigen or vectorized instructions to easily fix this problem. This problem is showing up in conda builds, but is not appearing in ROS Noetic Windows builds. I don't have an explanation, but it may just be luck or some compiler bug causing the problem.Beta Was this translation helpful? Give feedback.
All reactions