# Error calling Acts through Dictionary

**URL:** <https://root-forum.cern.ch/t/error-calling-acts-through-dictionary/43802>\
**Category:** ROOT\
**Created:** [March 3, 2021, 4:32pm UTC](https://root-forum.cern.ch/t/error-calling-acts-through-dictionary/43802 "2021-03-03T16:32:39Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![clementhelsens](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/clementhelsens/32/24840_2.png) [@clementhelsens](https://root-forum.cern.ch/u/clementhelsens)\
**Post date:** [March 3, 2021, 4:32pm UTC](https://root-forum.cern.ch/t/error-calling-acts-through-dictionary/43802/1 "2021-03-03T16:32:39Z")

</div>

Dear root expert,

we have seen a very weird thing happening when trying to build a ROOT dictionary with calls to Acts inside. We are only able to make it work properly when compiling acts with x86\_64 the broadwell spack install was giving us very convoluted errors, with as an example the last line in the stack trace before it goes into ROOT itself:

#6 0x00007f5e193657e5 in \_mm256\_store\_pd (\_\_A=…, \_\_P=0x53967f0) at /cvmfs/[sw.hsf.org/spackages/linux-centos7-haswell/gcc-4.8.5/gcc-8.3.0-avsmzt7bekq7ispf6zlarx6vwdretbae/lib/gcc/x86\_64-pc-linux-gnu/8.3.0/include/avxintrin.h:867](http://sw.hsf.org/spackages/linux-centos7-haswell/gcc-4.8.5/gcc-8.3.0-avsmzt7bekq7ispf6zlarx6vwdretbae/lib/gcc/x86_64-pc-linux-gnu/8.3.0/include/avxintrin.h:867)

which is called by an Eigen constructor. Here it appears to be calling an AVX intrinsic. While this probably would result in an instruction error, rather than a stack trace: are you maybe compiling different pieces differently? Or could it be that the statically compiled code uses/doesn’t use AVX, and the code called through ROOT does the opposite? Maybe this causes a memory inconsistency that sometimes occurs and sometimes doesn’t, depending on memory location and/or alignment?

We are asking some help to understand this issue.

to reproduce the problem:

```auto
git clone https://github.com/HEP-FCC/FCCAnalyses.git
cd FCCAnalyses
source /cvmfs/fcc.cern.ch/sw/latest/setup.sh
export PYTHONPATH=$PWD:$PYTHONPATH
export LD_LIBRARY_PATH=$PWD/install/lib:$LD_LIBRARY_PATH
export ROOT_INCLUDE_PATH=$PWD/install/include/FCCAnalyses:$ROOT_INCLUDE_PATH

spack load acts@5.0.0

mkdir build install
cd build/
cmake .. -DCMAKE_INSTALL_PREFIX=../install
make install
cd ..

root -l
.L examples/FCCee/vertex/reproducer.cc
reproducer()

```

If you want to see it running, change to

```auto
spack load acts@5.0.0 arch=linux-centos7-x86_64

```

and recompile.  
Cheers and thanks,  
Clement

* * *

\_ROOT Version: root-6.22.06  
\_Platform: centos7  
\_Compiler: gcc-8.3.0

* * *

---

<div class="post-metadata">

**Author:** ![clementhelsens](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/clementhelsens/32/24840_2.png) [@clementhelsens](https://root-forum.cern.ch/u/clementhelsens)\
**Post date:** [March 3, 2021, 4:36pm UTC](https://root-forum.cern.ch/t/error-calling-acts-through-dictionary/43802/2 "2021-03-03T16:36:07Z")

</div>

And of course please let us know if any other informations could be provided.

---

<div class="post-metadata">

**Author:** ![jalopezg](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jalopezg/32/25844_2.png) [@jalopezg](https://root-forum.cern.ch/u/jalopezg)\
**Post date:** [March 4, 2021, 4:25pm UTC](https://root-forum.cern.ch/t/error-calling-acts-through-dictionary/43802/3 "2021-03-04T16:25:18Z")

</div>

Hi @clementhelsens; let me try to reproduce the problem this evening. I will reach back to you after that.

Cheers.

---

<div class="post-metadata">

**Author:** ![clementhelsens](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/clementhelsens/32/24840_2.png) [@clementhelsens](https://root-forum.cern.ch/u/clementhelsens)\
**Post date:** [March 10, 2021, 7:59pm UTC](https://root-forum.cern.ch/t/error-calling-acts-through-dictionary/43802/4 "2021-03-10T19:59:45Z")

</div>

Hello @jalopezg ,

did you get a chance to reproduce the problem?

Cheers,  
Clement

---

<div class="post-metadata">

**Author:** ![jalopezg](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jalopezg/32/25844_2.png) [@jalopezg](https://root-forum.cern.ch/u/jalopezg)\
**Post date:** [March 10, 2021, 9:34pm UTC](https://root-forum.cern.ch/t/error-calling-acts-through-dictionary/43802/5 "2021-03-10T21:34:42Z")

</div>

Hi @clementhelsens,

Sorry for the delay, I had this in the TODO list. No, I couldn’t reproduce it with the `acts@5.00.0%gcc@8.3.0 arch=linux-centos7-broadwell` spack package on an Intel® Xeon® Platinum 8160 CPU, i.e.

```auto
$ spack load --first acts@5.00.0%gcc@8.3.0 arch=linux-centos7-broadwell
$ # ...
$ root -l
root [0] .L examples/FCCee/vertex/reproducer.cc
root [1]

```

Are you running on a node on LXPLUS? Could you please attach here the output of `$ cat /proc/cpuinfo` and the backtrace that you obtained?

Cheers,  
J.

---

<div class="post-metadata">

**Author:** ![clementhelsens](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/clementhelsens/32/24840_2.png) [@clementhelsens](https://root-forum.cern.ch/u/clementhelsens)\
**Post date:** [March 10, 2021, 9:51pm UTC](https://root-forum.cern.ch/t/error-calling-acts-through-dictionary/43802/6 "2021-03-10T21:51:40Z")

</div>

No problem, but the crash occurs at runtime. Have you also executed `reproducer()`?  
To answer your question, I am running from lxplus centos 7.  
Tomorrow I will attach what you are asking.

thanks,  
Clement

---

<div class="post-metadata">

**Author:** ![jalopezg](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jalopezg/32/25844_2.png) [@jalopezg](https://root-forum.cern.ch/u/jalopezg)\
**Post date:** [March 11, 2021, 8:38am UTC](https://root-forum.cern.ch/t/error-calling-acts-through-dictionary/43802/7 "2021-03-11T08:38:16Z")

</div>

Yes, I also ran the macro. Sorry -I didn’t copied the `reproducer()` line here.

Cheers.

---

<div class="post-metadata">

**Author:** ![vavolkl](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/vavolkl/32/23100_2.png) [@vavolkl](https://root-forum.cern.ch/u/vavolkl)\
**Post date:** [March 11, 2021, 9:56am UTC](https://root-forum.cern.ch/t/error-calling-acts-through-dictionary/43802/8 "2021-03-11T09:56:22Z")

</div>

Hi @jalopezg,

I think with `spack load --first acts@5.00.0%gcc@8.3.0 arch=linux-centos7-broadwell` you might have selected the Debug build. We saw that this works fine too, as I think the offending avx features are also disabled when disabling the compiler optimisations. Sorry about that I only added it after Clement posted his instructions. Could you try with

` spack load --first acts@5.00.0%gcc@8.3.0 build_type=Release arch=linux-centos7-broadwell`

?  
Cheers!  
Valentin

---

<div class="post-metadata">

**Author:** ![vavolkl](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/vavolkl/32/23100_2.png) [@vavolkl](https://root-forum.cern.ch/u/vavolkl)\
**Post date:** [March 11, 2021, 10:06am UTC](https://root-forum.cern.ch/t/error-calling-acts-through-dictionary/43802/9 "2021-03-11T10:06:12Z")

</div>

Just to note that the code in the reproducer is also run in an acts unittest, that runs fine with all our installations. It seems like it is only the combination of ROOT dictionary + avx instructions that leads to the segfault.

---

<div class="post-metadata">

**Author:** ![jalopezg](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jalopezg/32/25844_2.png) [@jalopezg](https://root-forum.cern.ch/u/jalopezg)\
**Post date:** [March 11, 2021, 10:33am UTC](https://root-forum.cern.ch/t/error-calling-acts-through-dictionary/43802/10 "2021-03-11T10:33:17Z")

</div>

Thanks, @vavolkl! I managed to reproduce the failure with the Release build. I will be investigating it in the next few days. I took this Friday off, so expect a response next week. 🙂

Thanks for reporting!  
Cheers.

---

<div class="post-metadata">

**Author:** ![clementhelsens](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/clementhelsens/32/24840_2.png) [@clementhelsens](https://root-forum.cern.ch/u/clementhelsens)\
**Post date:** [March 11, 2021, 10:38am UTC](https://root-forum.cern.ch/t/error-calling-acts-through-dictionary/43802/11 "2021-03-11T10:38:18Z")

</div>

thanks @jalopezg , and sorry I did not re-checked the instructions I provided after @vavolkl updated the default build.  
Cheers and thanks for helping!  
Clement

---

<div class="post-metadata">

**Author:** ![clementhelsens](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/clementhelsens/32/24840_2.png) [@clementhelsens](https://root-forum.cern.ch/u/clementhelsens)\
**Post date:** [March 19, 2021, 9:04am UTC](https://root-forum.cern.ch/t/error-calling-acts-through-dictionary/43802/12 "2021-03-19T09:04:26Z")

</div>

Dear @jalopezg, a ping so that the topic does not get closed.  
Cheers,  
Clement

---

<div class="post-metadata">

**Author:** ![jalopezg](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jalopezg/32/25844_2.png) [@jalopezg](https://root-forum.cern.ch/u/jalopezg)\
**Post date:** [March 30, 2021, 6:42pm UTC](https://root-forum.cern.ch/t/error-calling-acts-through-dictionary/43802/13 "2021-03-30T18:42:35Z")

</div>

Hi @clementhelsens,

Yes, sorry for the delay. I had this on the TODO list. The bad news is that my backtrace appears truncated using the Release build of acts-5.0.0. Could you please attach the original backtrace that you got?

I will be off next week and the rest of this week, but the good news is that I promise to take a look into this as soon as I am back. Again, sorry for the delay in handling this issue!

Cheers,  
J.

---

<div class="post-metadata">

**Author:** ![vavolkl](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/vavolkl/32/23100_2.png) [@vavolkl](https://root-forum.cern.ch/u/vavolkl)\
**Post date:** [April 9, 2021, 6:04pm UTC](https://root-forum.cern.ch/t/error-calling-acts-through-dictionary/43802/14 "2021-04-09T18:04:23Z")

</div>

Hi @clementhelsens @jalopezg,

So I haven’t completely understood this issue yet, but at least I have a workaround that doesn’t force us to disable avx everywhere.

So I was coming back to this after stumbling on a discussion of EXTRA\_CLING\_ARGS and avx, but disappointingly adding an -O3 -mavx there has no effect. Then I noticed that taking FCCAnalyses from the usual arch=broadwell stack, the reproducer runs fine - it is actually only when building FCCAnalyses locally that the segfault appears. So apparently the reproducer either needs -mavx nowhere (like in the debug builds) or everywhere (like in the release builds in the stack), but taking dependencies compiled with avx and then compiling FCCAnalyses without gives the error.

The simple workaround is thus enabling avx in the local build, by adding something like

```auto
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")

```

in the top level CMakeLists.txt Clement, I think if we add an option for this it should be ok, no? Alternatively, installing fccanalyses locally using spack

```auto
# in the repository
spack dev-build fccanalyses@master.01
spack load fccanalyses@master.01 

```

should add the flags for broadwell and thus also work. I’d still be quite interested why this results in a segfault, which is not typical for instruction errors like this…

---

<div class="post-metadata">

**Author:** ![clementhelsens](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/clementhelsens/32/24840_2.png) [@clementhelsens](https://root-forum.cern.ch/u/clementhelsens)\
**Post date:** [April 10, 2021, 6:48am UTC](https://root-forum.cern.ch/t/error-calling-acts-through-dictionary/43802/15 "2021-04-10T06:48:15Z")

</div>

Hello @vavolkl,

seems you found the issue, this is great! I do not see any reason not to add avx locally as suggested. I will give it a try locally as well not using `spack load acts@5.0.0 arch=linux-centos7-x86_64` but the broadwell one.

thanks a lot!

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [April 24, 2021, 6:48am UTC](https://root-forum.cern.ch/t/error-calling-acts-through-dictionary/43802/16 "2021-04-24T06:48:33Z")

</div>

Closed on April 24, 2021, 6:48am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
