New user self-registration is currently disabled. Please email eigen-core-team @ lists.tuxfamily.org if you need an account.
Bug 1400 - Assertion fails in stableNorm()
Assertion fails in stableNorm()
Status: RESOLVED FIXED
Product: Eigen
Classification: Unclassified
Component: Core - vectorization
unspecified
All All
: Normal Unknown
Assigned To: Nobody
:
: 1429 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-03-06 12:08 UTC by Shuntaro Yamazaki
Modified: 2017-06-06 13:15 UTC (History)
5 users (show)



Attachments

Description Shuntaro Yamazaki 2017-03-06 12:08:28 UTC
$ cat a.cpp
#define EIGEN_DONT_ALIGN_STATICALLY
#include <Eigen/Core>
int main() {
    Eigen::VectorXd x;
    x.setRandom(2);
    return (x + x).stableNorm(); 
}
$ clang++ -I. a.cpp
$ ./a.out 
a.out: ./Eigen/src/Core/MapBase.h:191: void Eigen::MapBase<Eigen::Ref<const Eigen::Matrix<double, -1, 1, 0, 4096, 1>, 16, Eigen::InnerStride<1> >, 0>::checkSanity(typename internal::enable_if<(internal::traits<T>::Alignment > 0), void *>::type) const [Derived = Eigen::Ref<const Eigen::Matrix<double, -1, 1, 0, 4096, 1>, 16, Eigen::InnerStride<1> >, Level = 0, T = Eigen::Ref<const Eigen::Matrix<double, -1, 1, 0, 4096, 1>, 16, Eigen::InnerStride<1> >]: Assertion `( ((internal::UIntPtr(m_data) % internal::traits<Derived>::Alignment) == 0) || (cols() * rows() * innerStride() * sizeof(Scalar)) < internal::traits<Derived>::Alignment ) && "data is not aligned"' failed.
Aborted

hg changeset: 10367:3a05a3e7b733 (HEAD as of today)
OS: ubuntu 14.04 64bit
Compiler: Clang 3.7.1

The code is no problem if EIGEN_DONT_ALIGN_STATICALLY is undefined or the size of 'x' is 1. It causes SegFault with debug build. This pattern appears (and fails) in NonLinearOptimization/LevenbergMarquardt.h in unsupported.

Best regards,
Shuntaro
Comment 2 Gael Guennebaud 2017-06-06 13:15:57 UTC
*** Bug 1429 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.