setZero(), setConstant() etc. raise "Illegal Instruction" when called on Eigen::VectorXd

Submitted by Dmitry Zhdanov

Assigned to Nobody

Link to original bugzilla bug (#1108)
Version: 3.3 (current stable)
Operating system: Windows

Description

Problem appeared after migrating from v3.2.7 to v3.3. Patches for PacketMath.h and MathFunctions.h were used to compile the code with MSVC.

Sample code:
int dim=255;
Eigen::VectorXd _A_Squared_vector(dim); // Worked in v3.2.7
Eigen::VectorXd _A_Diagonal_vector(dim,1); //Expected to also work
Eigen::VectorXd _A_Diagonal_vector2(1,dim); //Should not work but works (effectively creates 1x1 matrix)
_A_Squared_vector.setZero(); // Crash: Unhandled exception at 0x000007F6F613FBA0 in QI++.exe: 0xC000001D: Illegal Instruction.
_A_Diagonal_vector.setZero(); // Crash: Unhandled exception at 0x000007F6F613FBA0 in QI++.exe: 0xC000001D: Illegal Instruction.
_A_Diagonal_vector2.setZero(); // No errors!

Specifically, debugger complains about line 699 of of AssignEvaluator.

Note that there is no any problem with complex numbers: the same code with VectorXcd works as expected!

Blocking

#558 (closed)

Edited by Eigen Bugzilla