Matti Kortelainen
Matti Kortelainen
`EIGEN_MALLOC_ALREADY_ALIGNED` is defined as ```cpp #ifndef EIGEN_MALLOC_ALREADY_ALIGNED // ... #if defined(__GLIBC__) && ((__GLIBC__>=2 && __GLIBC_MINOR__ >= 8) || __GLIBC__>2) \ && defined(__LP64__) && ! defined( __SANITIZE_ADDRESS__ ) && (EIGEN_DEFAULT_ALIGN_BYTES ==...
Playing with the definitions of the various Eigen macros the `EIGEN_DEFAULT_ALIGN_BYTES` seems to be `64`, so the macro logic in https://github.com/cms-sw/cmssw/issues/44188#issuecomment-1969174886 leads to setting `EIGEN_GLIBC_MALLOC_ALREADY_ALIGNED=0`. The `EIGEN_DEFAULT_ALIGN_BYTES` is defined as...
Should we explicitly set `EIGEN_MALLOC_ALREADY_ALIGNED=1`?
From https://eigen.tuxfamily.org/dox/TopicPreprocessorDirectives.html > * **`EIGEN_MALLOC_ALREADY_ALIGNED`** - Can be set to 0 or 1 to tell whether default system malloc already returns aligned buffers. In not defined, then this information is...
> Should we explicitly set `EIGEN_MALLOC_ALREADY_ALIGNED=1`? Not sure if that would be correct for the 64-byte alignment we request though...
https://gitlab.com/libeigen/eigen/-/issues/1409 has some discussion about the use of (or why not) `std::aligned_alloc`
@Dr15Jones suspected ODR violation, and here is proof ``` (gdb) where #0 0x00007ffff4ecc780 in malloc () from /lib64/libc.so.6 #1 0x00007fffb88a17ac in Eigen::PlainObjectBase::resize(long, long) () from /build/mkortela/debug/el8/issue44188/CMSSW_14_1_X_2024-02-27-2300/external/el8_amd64_gcc12/lib/liblwtnn.so #2 0x00007fffac85f5a3 in Eigen::PlainObjectBase::_init2...
I'm testing more consistent build settings in https://github.com/cms-sw/cmsdist/pull/9043 I also tested `LD_PRELOAD=.../libGBL.so` with `cmsRunGlibC`. The job proceeded beyond the earlier crash point, but still crashed. Valgrind showed ``` ==28159== Invalid...
Hmh, building the `lwtnn`, `opencv`, and `pytorch` with `-DEIGEN_MAX_ALIGN_BYTES=64 -msse3` in https://github.com/cms-sw/cmsdist/pull/9043 didn't make a difference, the job still fails (log from valgring + cmsRunGlibC) ``` ==4590== Invalid read of...
> I suspect a flaw in my build setup Looking at the build log of `lwtnn` https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-9dec1c/37832/externals/lwtnn/2.13-dc060310f9f71ab2d7dcf18f48a8216e/log it's clear that the `-DEIGEN_MAX_ALIGN_BYTES=64 -msse3` did not propagate to the actual compilation.