Segmentation Fault while Loading Modules

Greetings to everyone,

I recently attempted to install Allpix Squared locally on a Ubuntu 21.04 virtual machine. I downloaded all of the dependencies, and when I was to run a simulation (specifically, the example.conf configuration file), the framework threw me a segmentation fault (core dumped) error, while initializing the module installations. I tried to allocate more RAM and disk size (probably irrelevant) on my virtual machine but the error persisted. Any possible solutions to this? or possible reasons for the issue?

Thank you very much in advance,

PS: There is no urgency in fixing this issue, I can run simulations via CVMFS, but it would be ideal if I had fully-working local installation.

Hi @Andrew

I certainly understand the necessity of having a fully-local setup to play with things… :slight_smile:

Could you maybe provide some more details on your installation?

  • How did you install ROOT and Geant4?
  • Which versions of the two are you using?
  • Did you compile Allpix Squared from source? Which version did you use?

And is there any error message printed before the core dump that could be useful?

Also, would it be possible to run the program in a debugger to get some more information? One possibility woould be gdb:

$ gdb --args allpix -c your_config.conf
$ run
<...crashes...>
$ thread apply all backtrace full

It’s not a system issue per say, I’m running and developing on Ubuntu 21.04 without issues.

All the best,
Simon

1 Like

Hi Simon,

Thank you a lot for the reply. So with regards to dependency installations:
I built both Geant4 and Root manually (without the use of any package managers), I closely followed these installation instructions for ROOT. The only additional thing that I did was to add the -DCMAKE_CXX_STANDARD=17 flag, to make it compatible with allpix. As for Geant4, I closely followed the instructions on the standard installation manual (I note that I did install a lot of additional requirded dependencies, e.g. qt5 and the Xerces library), with the additional flags suggested from the AllpixSquared User’s Guide. I used the latest version for both ROOT and Geant. For building AllpixSquared, I did:

$ git clone https://gitlab.cern.ch/allpix-squared/allpix-squared  
$ cd allpix-squared
$ source <root_install_dir>/bin/thisroot.sh  
$ source <geant4_install_dir>/bin/geant4.sh
$ mkdir build  
$ cd build  
$ cmake ..

And thus, I used the latest version for AllpixSquared as well. After,

$ make -j<number_of_cores>
$ make install

and running

bin/allpix -c examples/example.conf

I got:

I will try gdb and see what I can find from there.

Kind Regards,

Andreas

Hi Andreas,

that all seems to be completely in order and there is nothing I do differently. Indeed the C++17 flag is currently missing from the user manual I shall add that!

Let me know if gdb turns up anything useful!

Simon

1 Like

Hi everyone,

I am actually getting the same segmentation fault like Andrew. I followed @simonspa advice and this is what I got:

I have root 6.24/06 compiled with C++17 and geant4.10.06.p02.

Thanks a lot in advance
Lukas

1 Like

Hi @fajtak

so it seems to crash in Geant4 as soon as we try to instantiate a G4MTRunManager.

Could you confirm that your Geant4 is built with GEANT4_BUILD_MULTITHREADED=ON?

/Simon

1 Like

Hi,

thanks a lot for such a fast response. Since I followed the installation procedure in the AllPix2 manual:

I didn’t compile Geant4 with multithreading enabled. It solved the problem.

Thanks a lot
Lukas

1 Like

Hi @fajtak

great - that solves this mystery then - somehow our MT detection is broken then and we should check how to get it back working - we once had an error message displayed in case MT wasn’t available.

Thanks a lot for your digging!

Simon

1 Like

No, thanks a lot to you for your amazing tech support.

Lukas

1 Like

We are now properly checking for this and are printing a warning instead of attempting to instantiate the wrong run manager:

|13:57:25.682|   (ERROR) [C:GeometryBuilderGeant4] Geant4 has been built without multithreading support, forcing multithreading off.
                                                   To allow multithreading, rebuild Geant4 with the GEANT4_BUILD_MULTITHREADED option enabled.
|13:57:25.686|  (STATUS) Loaded 7 modules                     
|13:57:25.686|  (STATUS) Initializing 27 module instantiations
|13:57:25.893|  (STATUS) Initialized 27 module instantiations
|13:57:25.893|   (ERROR) Multithreading disabled since the current module configuration does not support it
|13:57:25.893|  (STATUS) Starting event loop

Also, the documentation has been updated to include not only the MULTIRHEADED flag but also the required CXX17 standard.

This will be part of 2.0.3.

Cheers,
Simon

1 Like

Hi @simonspa and @fajtak ,

I am happy to see that this is now resolved. Sorry for being inactive on this question, but CVMFS worked fine for me and I completely forgot investigating further with gdb. I will recompile Geant4 with the additional flag and I will let you know if it works for me as well (probably during the weekend). It is nice to see that this is going to the next user’s guide!

Yours,

Andrew

Hi @Andrew

you are welcome! The new patch release is online and the updated user manual available from the website as of now.

All the best,
Simon

1 Like

Hi @simonspa,

Just wanted to let you know that I followed closely the updated manual on an Ubuntu 21.04 Virtual Machine, with Geant4-10.07.p02 and ROOT 6.24/06 and everything works flawlessly for me as well. Again, thank you a lot for the fix!

Yours,

Andrew