With a simple code like the one below, everything compiles well but I get a segmentation fault on last line: Eigen::Matrix3Xd points = Eigen::Matrix3Xd::Zero(3, 2); Eigen::DiagonalMatrix<double, 2> diagonal(1, 2); Eigen::Matrix2Xd result = diagonal * points.topRows<2>(); I use Eigen 3.2.0 and compile with g++ 4.8.2 on Ubuntu 14.04 64bit. The segmentation fault happens both in (cmake) Debug and Release modes. I also tried to enable/disable -std=c++11 but nothing changed. The error goes away if the result is not saved, i.e.: Eigen::Matrix3Xd points = Eigen::Matrix3Xd::Zero(3, 2); Eigen::DiagonalMatrix<double, 2> diagonal(1, 2); diagonal * points.topRows<2>(); or if the block operation is saved in a temporary matrix, i.e.: Eigen::Matrix3Xd points = Eigen::Matrix3Xd::Zero(3, 2); Eigen::DiagonalMatrix<double, 2> diagonal(1, 2); Eigen::Matrix2Xd tmp = points.topRows<2>(); Eigen::Matrix2Xd result = diagonal * tmp; Looking at the gdb backtrace it seems an SSE-related bug: http://pastebin.com/NqZuVWZ1
Confirmed with bith 3.2 and devel branches. The problem is that Eigen wrongly assumes that the rhs can be read through aligned loads.
Fixed: devel: https://bitbucket.org/eigen/eigen/commits/be1035dca6ab/ 3.2: https://bitbucket.org/eigen/eigen/commits/be1035dca6ab/
-- GitLab Migration Automatic Message -- This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/987.