This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 1400 - Assertion fails in stableNorm()
Summary: Assertion fails in stableNorm()
Status: RESOLVED FIXED
Alias: None
Product: Eigen
Classification: Unclassified
Component: Core - vectorization (show other bugs)
Version: unspecified
Hardware: All All
: Normal Unknown
Assignee: Nobody
URL:
Whiteboard:
Keywords:
: 1429 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-03-06 12:08 UTC by Shuntaro Yamazaki
Modified: 2019-12-04 16:51 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. ***
Comment 3 Nobody 2019-12-04 16:51:49 UTC
-- 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/1400.

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