[Bf-committers] Eigen3 128bit alignment issues in ceres

Stephan Kassemeyer stapfx at gmx.de
Tue May 29 03:10:01 CEST 2012


Sorry if this mailing list is not the appropriate place
to discuss this... I guess it is more a problem of ceres, which
stores Eigen3 objects in structs without properly handling 128 bit alignment.
The following is not a proper patch, since InnerContainer
is more general and can also store non-Eigen3-objects, but
the patch fixes the segfaults on my system by ensuring alignment
for Eigen3-objects:


Index: extern/libmv/third_party/ceres/include/ceres/internal/fixed_array.h
===================================================================
--- extern/libmv/third_party/ceres/include/ceres/internal/fixed_array.h	(revision 47131)
+++ extern/libmv/third_party/ceres/include/ceres/internal/fixed_array.h	(working copy)
@@ -136,7 +136,8 @@
   // and T must be the same, otherwise callers' assumptions about use
   // of this code will be broken.
   struct InnerContainer {
-    T element;
+   EIGEN_MAKE_ALIGNED_OPERATOR_NEW 
+   T element;
   };




-------- Original-Nachricht --------
> Datum: Tue, 29 May 2012 02:15:05 +0200
> Von: "Stephan Kassemeyer" <stapfx at gmx.de>
> An: bf-blender developers <bf-committers at blender.org>
> Betreff: Re: [Bf-committers] Eigen3 128bit alignment issues in ceres

> The assertion occured on linux, using gcc 4.4.3.
> Here is a backtrace:
> http://www.pasteall.org/32377
> 
> -------- Original-Nachricht --------
> > Datum: Mon, 28 May 2012 14:01:07 +0600
> > Von: Sergey Sharybin <sergey.vfx at gmail.com>
> > An: bf-blender developers <bf-committers at blender.org>
> > Betreff: Re: [Bf-committers] Eigen3 128bit alignment issues in ceres
> 
> > Hi,
> > 
> > It'll help knowing ehich operation system and compiler you're using.
> > 
> > Thanks.
> > 
> > On Mon, May 28, 2012 at 7:14 AM, Stephan Kassemeyer <stapfx at gmx.de>
> wrote:
> > 
> > > Hi,
> > >
> > > in tomato branch, I get a segfault when doing video tracking.
> > > I turned on debug mode and got an Eigen3 assertion
> > > EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT which mentions this
> > > web page:
> > > http://eigen.tuxfamily.org/dox-devel/TopicUnalignedArrayAssert.html
> > >
> > > I tried their suggestions, so far without any success.
> > > The only thing that helps is to disable all
> > > vectorization with the following definitions:
> > > CMAKE_CXX_FLAGS:STRING=-D EIGEN_DONT_VECTORIZE -D
> > > EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT
> > >
> > > In the backtrace,
> > > the last non-Eigen3 code is
> > >
> > >   FixedArray<JetT, (256 * 7) / sizeof(JetT)> x(
> > >        N0 + N1 + N2 + N3 + N4 + N5 + num_outputs);
> > >
> > > in extern/libmv/third_party/ceres/include/ceres/internal/autodiff:303
> > >
> > > I was compiling using cmake.
> > > If you have any ideas, please let me know, I can test.
> > >
> > > regards,
> > > Stephan Kassemeyer.
> > > --
> > > NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone!
> > > Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a
> > > _______________________________________________
> > > Bf-committers mailing list
> > > Bf-committers at blender.org
> > > http://lists.blender.org/mailman/listinfo/bf-committers
> > >
> > 
> > 
> > 
> > -- 
> > With best regards, Sergey Sharybin
> > _______________________________________________
> > Bf-committers mailing list
> > Bf-committers at blender.org
> > http://lists.blender.org/mailman/listinfo/bf-committers
> 
> -- 
> Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
> belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers

-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de


More information about the Bf-committers mailing list