Summary: | Stack overflow with sqrt of an expression which returns a double (a 1x1 return type) | ||
---|---|---|---|
Product: | Eigen | Reporter: | Tom <tom> |
Component: | Core - expression templates | Assignee: | Nobody <eigen.nobody> |
Status: | RESOLVED DUPLICATE | ||
Severity: | minor | CC: | gael.guennebaud, jacob.benoit.1, jitseniesen |
Priority: | Normal | ||
Version: | 3.1 | ||
Hardware: | All | ||
OS: | Windows | ||
Whiteboard: | |||
Bug Depends on: | |||
Bug Blocks: | 387 |
I've no time at the moment to investigate, but this is probably the same issue as bug 314. However, it is more urgent to fix now that it's more than a theoretical problem. That's indeed the same issue. *** This bug has been marked as a duplicate of bug 314 *** -- 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/508. |
int main(int argc, char* argv[]) { Eigen::Vector2d v(1.0,2.0); double d = sqrt(v.transpose() * v); } This triggers an infinite recursion/stack overflow when sqrt and sqrt_default_impl call each other. Easy to work around--e.g. sqrt(v.dot(v)); Copied from the call stack: > Eigen::internal::sqrt_default_impl<Eigen::GeneralProduct<Eigen::Transpose<Eigen::Matrix<double,2,1,0,2,1> >,Eigen::Matrix<double,2,1,0,2,1>,3>,0>::run(const Eigen::GeneralProduct<Eigen::Transpose<Eigen::Matrix<double,2,1,0,2,1> >,Eigen::Matrix<double,2,1,0,2,1>,3> & x) Line 417 + 0xa bytes C++ Eigen::internal::sqrt<Eigen::GeneralProduct<Eigen::Transpose<Eigen::Matrix<double,2,1,0,2,1> >,Eigen::Matrix<double,2,1,0,2,1>,3> >(const Eigen::GeneralProduct<Eigen::Transpose<Eigen::Matrix<double,2,1,0,2,1> >,Eigen::Matrix<double,2,1,0,2,1>,3> & x) Line 447 + 0xf bytes C++