[eigen] Matrix product crashes when compiled with MSVC 2010 in release |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: [eigen] Matrix product crashes when compiled with MSVC 2010 in release
- From: Ilya Baran <baran37@xxxxxxxxx>
- Date: Thu, 12 Aug 2010 21:50:46 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=k6I6jXzB5Qz15VYXUIqGyE+y1DUFKtT6kVLgGCACFn8=; b=fIte50ggSc953s1UXB/usP6I2LDBtQktWJ1ncmOqS67CJ+3MLK1jcRLSlVD0ncJJOw w9p0DRC/cQ8vI7SsC6NMuJ5g3qvtsLGWs0TTk8counqP3cex+SSJBHuPLciLQcSH/CJz ikkpUUxX5R0djIgCbbshxhyfHjgAwwrH//8ko=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=RB2mFqBqpCxuGOPAyXpzQJHfrQQVvm4eSoUWNx0TwuQVQ2I2rd/ncoiyEqdyXzCVMK SUQ32NqtM3eUqRUFVCk7V9B4BnAkiEDY33nOnim3Y5M60YwYrqIyuRr7exQlNQdmthMV h1gqy4MBAj+2+BbD6wemQ6OtcSw+hW29VY+Ds=
Hi,
I've run into a nasty crash with recent Eigen dev builds. The
following code reproduces it:
void test()
{
typedef Eigen::MatrixXd Mat;
Mat r = Mat::Random(5, 2);
Mat r2 = Mat::Random(2, 5);
Mat r3 = r * r2;
std::cout << r3;
}
It crashes only when the output matrix has an odd number of entries
and only when built in release mode on MSVC 2010 and only when whole
program optimization is turned off. I suspect that this is a compiler
bug, but perhaps it can be worked around. I traced the crash to
changeset 3260 (431547872cf7); 3259 works.
Here's the backtrace (lines as in rev 3260, because it's a release
build, debug info is unreliable):
First-chance exception at 0x00ea34bd in EigenTest.exe: 0xC0000005:
Access violation reading location 0xffffffff.
EigenTest.exe!Eigen::ei_gebp_kernel<double,double,int,4,4,0,0>::operator()(double
* res=0x004d3e20, int resStride=5, const double * blockA=0x0037fc70,
const double * blockB=0x0037fc20, int rows=5, int depth=2, int cols=5,
double alpha=1.0000000000000000, int strideA=2, int strideB=2, int
offsetA=0, int offsetB=0, double * unpackedB=0x0037fba0) Line 459 +
0x8 bytes C++
EigenTest.exe!Eigen::ei_general_matrix_matrix_product<int,double,0,0,double,0,0,0>::run(int
rows=5, int cols=5, int depth=2, const double * _lhs=0x004d3d20, int
lhsStride=5, const double * _rhs=0x004d3da0, int rhsStride=2, double *
res=0x004d3e20, int resStride=5, double alpha=1.0000000000000000,
Eigen::ei_level3_blocking<double,double> & blocking={...},
Eigen::GemmParallelInfo<int> * info=0x00000000) Line 203 + 0x37
bytes C++
EigenTest.exe!Eigen::GeneralProduct<Eigen::Matrix<double,-1,-1,0,-1,-1>,Eigen::Matrix<double,-1,-1,0,-1,-1>,5>::scaleAndAddTo<Eigen::Matrix<double,-1,-1,0,-1,-1>
>(Eigen::Matrix<double,-1,-1,0,-1,-1> & dst={...}, double
alpha=1.0000000000000000) Line 444 C++
EigenTest.exe!Eigen::ProductBase<Eigen::GeneralProduct<Eigen::Matrix<double,-1,-1,0,-1,-1>,Eigen::Matrix<double,-1,-1,0,-1,-1>,5>,Eigen::Matrix<double,-1,-1,0,-1,-1>,Eigen::Matrix<double,-1,-1,0,-1,-1>
>::evalTo<Eigen::Matrix<double,-1,-1,0,-1,-1>
>(Eigen::Matrix<double,-1,-1,0,-1,-1> & dst={...}) Line 110 + 0x83
bytes C++
EigenTest.exe!test() Line 9 + 0x97 bytes C++
EigenTest.exe!main() Line 16 C++
Figuring out ei_gebp_kernel looks daunting--do you (well, Gael is the
person who needs to look at this, I expect) need any additional info?
Thanks,
-Ilya