Segfault on Scalar * (Matrix * Vector)
Submitted by Gilles Daviet
Assigned to Nobody
Link to original bugzilla bug (#1311)
Version: 3.3 (current stable)
Description
Created attachment 739
Backtrace
I might be doing something wrong, but since this used to work
without any issue, here is a minimal example segfaulting on 3.3-rc1.
cat test.cc
#include <Eigen/Core>
int main() {
Eigen::Matrix< double, 3, 2 > block ;
block.setOnes() ;
Eigen::Vector2d rhs = Eigen::Vector2d::Zero() ;
Eigen::Vector3d res = 1. * ( block * rhs ) ;
return 0 ;
}
g++-5 -I eigen-33r1/ test.cc -o test && ./test
Segmentation fault
g++-5 -I eigen-33b2 test.cc -o test && ./test
Happens with recent versions of gcc and clang
g++-6 -I eigen-33r1/ test.cc -o test && ./test
Segmentation fault
clang++ -I eigen-33r1/ test.cc -o test && ./test
Segmentation fault
..but can disappear once optimizations are enabled
clang++ -O3 -I eigen-eigen-a72752ca/ test.cc -o test && ./test
Regression seems to have been introduced in commit a72752ca
g++-5 -I eigen-eigen-a72752ca/ test.cc -o test && ./test
Segmentation fault
g++-5 -I eigen-eigen-cc2f6d68/ test.cc -o test && ./test
Reverting this patch on 3.3-rc1 fixed the issue on my side.
Attachment 739, "Backtrace":
gdb.txt