This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 1758 - ei_declare_aligned_stack_constructed_variable ignores alignment requirement of custom types
Summary: ei_declare_aligned_stack_constructed_variable ignores alignment requirement o...
Status: CONFIRMED
Alias: None
Product: Eigen
Classification: Unclassified
Component: Core - general (show other bugs)
Version: 3.3 (current stable)
Hardware: All All
: Lowest Crash
Assignee: Nobody
URL:
Whiteboard:
Keywords: test-needed
Depends on:
Blocks: 3.x
  Show dependency treegraph
 
Reported: 2019-10-14 12:31 UTC by Christoph Hertzberg
Modified: 2019-12-04 18:50 UTC (History)
3 users (show)



Attachments

Description Christoph Hertzberg 2019-10-14 12:31:58 UTC
As found on this SO post:
https://stackoverflow.com/questions/58366939/eigen3-boost-mpfr-segfault-when-alignment-is-disabled

Eigen fails to work with MPFR if compiled with `-DEIGEN_MAX_ALIGN_BYTES=0`.
The reason appears to be that the specific type used in the example requires 16 byte alignment, which however is ignored by `ei_declare_aligned_stack_constructed_variable`.

Similar issues likely arise for custom types which require more than the standard alignment.
Comment 1 Gael Guennebaud 2019-10-14 20:24:59 UTC
Do we re
Comment 2 Gael Guennebaud 2019-10-14 20:28:38 UTC
Do we really want to fix that one? I mean compiling with `-DEIGEN_MAX_ALIGN_BYTES=0` while using a scalar type requiring over-alignment at the same time does not looks right to me. I'm not against a fix, but I see it as low priority.
Comment 3 Christoph Hertzberg 2019-10-15 09:48:47 UTC
Ok, good point. We could statically assert, if someone tries to use an over-aligned type. But that requires some code to make sure that PODs don't break (e.g., alignof(double)==8 on many platforms).

--> Changed to blocking 3.x

Also, we don't really have a good mechanism to individually set the alignment of types (and I don't see good solutions without breaking the API ...)
Comment 4 Nobody 2019-12-04 18:50:07 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/1758.

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