G4RunManager throwing bad_alloc

Hello Geant4 Community,

I installed Geant4 on openSUSE via the source file following the basic instructions of the official guide. When I try to run example B1, I get the error

terminate called after throwing an instance of ‘std:bad_alloc’
what(): std::bad_alloc
Aborted (core dumped)

I found that this error occurs from the line

auto runManager = G4RunManagerFactory::CreateRunManager(G4RunManagerType::Default);

and also from

auto physicsList = new QBBC;

If I comment these line (and all references to runManager and physicsList) the example runs and prints some Geant4 prompts before aborting due to the commented lines.

The bad_alloc comes immediately and I have >6 GB RAM available, so for me it does not look like all memory is used up from the example.

Do you have an idea if the bad_alloc could come from a missing configuration or an untracked error during installation?

Any help is appreciated!

Thanks,
Lukas

_Geant4 Version:_11.2.0
_Operating System:_openSUSE Leap 15.3
_Compiler/Version:_gcc (SUSE Linux) 8.2.1
_CMake Version:_3.17.0


If this is in a pure B1 with zero modifications, then it’s impossible to say. The only way to determine this would be to build Geant4 and B1 in RelWithDebInfo mode, then run in gdb to find the location/cause.

Thank you for your reply, I was afraid that it would be difficult…

From gbd I get the following error:

Program received signal SIGSEGV, Segmentation fault.
std::filesystem::__cxx11::path::~path (this=0x0, __in_chrg=<optimized out>) at /usr/include/c++/8/bits/fs_path.h:207
207	    ~path() = default;

Google search indicates that this can happen from a missing link to with libstdc++, but I am really no expert in this.

A couple of quick things - what’s the backtrace from GDB, i.e. run bt after the seg fault is reached. Also, when you configured Geant4, what, if anything, di CMake print regarding checks for the Filesystem library, e.g.

-- Detecting CXX compile features - done
-- Checking C++ feature CXXSTDLIB_FILESYSTEM_NATIVE - Success

or similar (maybe in relation to CXXSTDLIB_FILESYSTEM_STDCXXFS)? If you run ldd on libG4global.so and exampleB1, do libstdc++fs or libstdc++ appear and what location are they resolved to?

I get the successfull check for Filesystem library and libstdc++ appears in the output of ldd for both files. I attach all outputs below.
From the output of bt in Line #2 I see the error comes from the nullpointer during the destruction of std::filesystem::path.
From this Forum I read that this is a known bug from gcc and can be resolved by linking -lstdc++fs. Is there a clean way to add this link to the installation of Geant4? (I suppose one had to modify the CMakeList somewhere)

Output of bt:

#0  std::filesystem::__cxx11::path::~path (this=0x0, __in_chrg=<optimized out>) at /usr/include/c++/8/bits/fs_path.h:207
#1  0x00007ffff6ac3804 in std::filesystem::__cxx11::path::_Cmpt::~_Cmpt (this=0x0, __in_chrg=<optimized out>) at /usr/include/c++/8/bits/fs_path.h:642
#2  std::_Destroy<std::filesystem::__cxx11::path::_Cmpt> (__pointer=0x0) at /usr/include/c++/8/bits/stl_construct.h:98
#3  std::_Destroy_aux<false>::__destroy<std::filesystem::__cxx11::path::_Cmpt*> (__last=<optimized out>, __first=0x0) at /usr/include/c++/8/bits/stl_construct.h:108
#4  std::_Destroy<std::filesystem::__cxx11::path::_Cmpt*> (__last=<optimized out>, __first=<optimized out>) at /usr/include/c++/8/bits/stl_construct.h:137
#5  std::_Destroy<std::filesystem::__cxx11::path::_Cmpt*, std::filesystem::__cxx11::path::_Cmpt> (__last=0x2, __first=<optimized out>) at /usr/include/c++/8/bits/stl_construct.h:206
#6  std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> >::~vector (this=0x6c71e0, __in_chrg=<optimized out>)
    at /usr/include/c++/8/bits/stl_vector.h:567
#7  std::filesystem::__cxx11::path::~path (this=0x6c71c0, __in_chrg=<optimized out>) at /usr/include/c++/8/bits/fs_path.h:207
#8  0x00007ffff0ee2b14 in std::filesystem::__cxx11::path::_Cmpt::~_Cmpt (this=0x6c71c0, __in_chrg=<optimized out>) at /usr/include/c++/8/bits/fs_path.h:642
#9  std::_Destroy<std::filesystem::__cxx11::path::_Cmpt> (__pointer=0x6c71c0) at /usr/include/c++/8/bits/stl_construct.h:98
#10 std::_Destroy_aux<false>::__destroy<std::filesystem::__cxx11::path::_Cmpt*> (__last=<optimized out>, __first=0x6c71c0) at /usr/include/c++/8/bits/stl_construct.h:108
#11 std::_Destroy<std::filesystem::__cxx11::path::_Cmpt*> (__last=<optimized out>, __first=<optimized out>) at /usr/include/c++/8/bits/stl_construct.h:137
#12 std::_Destroy<std::filesystem::__cxx11::path::_Cmpt*, std::filesystem::__cxx11::path::_Cmpt> (__last=0x0, __first=<optimized out>) at /usr/include/c++/8/bits/stl_construct.h:206
#13 std::vector<std::filesystem::__cxx11::path::_Cmpt, std::allocator<std::filesystem::__cxx11::path::_Cmpt> >::~vector (this=0x7fffffffcca0, __in_chrg=<optimized out>)
    at /usr/include/c++/8/bits/stl_vector.h:567
#14 std::filesystem::__cxx11::path::~path (this=0x7fffffffcc80, __in_chrg=<optimized out>) at /usr/include/c++/8/bits/fs_path.h:207
#15 G4FindDataDir (name=name@entry=0x7ffff2a4ce51 "G4ENSDFSTATEDATA") at /home/ams/Documents/geant4-v11.2.1/source/global/management/src/G4FindDataDir.cc:112
#16 0x00007ffff29cd0dc in G4NuclideTable::GenerateNuclide (this=0x7ffff2c74c80 <G4NuclideTable::GetInstance()::instance>)
    at /home/ams/Documents/geant4-v11.2.1/source/particles/management/src/G4NuclideTable.cc:165
#17 0x00007ffff29cd8fd in G4NuclideTable::G4NuclideTable (this=0x7ffff2c74c80 <G4NuclideTable::GetInstance()::instance>)
    at /home/ams/Documents/geant4-v11.2.1/source/particles/management/src/G4NuclideTable.cc:60
#18 0x00007ffff29cd964 in G4NuclideTable::GetInstance () at /home/ams/Documents/geant4-v11.2.1/source/particles/management/src/G4NuclideTable.cc:46
#19 0x00007ffff29bac79 in G4IonTable::PrepareNuclideTable (this=this@entry=0x6c5570) at /home/ams/Documents/geant4-v11.2.1/source/particles/management/src/G4IonTable.cc:1336
#20 0x00007ffff29bf8e5 in G4IonTable::G4IonTable (this=0x6c5570) at /home/ams/Documents/geant4-v11.2.1/source/particles/management/src/G4IonTable.cc:128
#21 0x00007ffff29d5cd8 in G4ParticleTable::G4ParticleTable (this=0x7ffff2c74ec0 <G4ParticleTable::GetParticleTable()::theParticleTable>)
    at /home/ams/Documents/geant4-v11.2.1/source/particles/management/src/G4ParticleTable.cc:123
#22 0x00007ffff29d71fc in G4ParticleTable::GetParticleTable () at /home/ams/Documents/geant4-v11.2.1/source/particles/management/src/G4ParticleTable.cc:85
#23 0x00007ffff532f681 in G4PrimaryTransformer::G4PrimaryTransformer (this=0x6c4820) at /home/ams/Documents/geant4-v11.2.1/source/event/src/G4PrimaryTransformer.cc:46
#24 0x00007ffff53163f6 in G4EventManager::G4EventManager (this=0x6a4b40) at /home/ams/Documents/geant4-v11.2.1/source/event/src/G4EventManager.cc:74
#25 0x00007ffff55f4f52 in G4RunManagerKernel::G4RunManagerKernel (this=0x6a7ee0, rmkType=G4RunManagerKernel::masterRMK)
    at /home/ams/Documents/geant4-v11.2.1/source/run/src/G4RunManagerKernel.cc:211
#26 0x00007ffff55ccc75 in G4MTRunManagerKernel::G4MTRunManagerKernel (this=0x6a7ee0) at /home/ams/Documents/geant4-v11.2.1/source/run/src/G4MTRunManagerKernel.cc:72
#27 0x00007ffff55da025 in G4RunManager::G4RunManager (this=0x6a79d0, rmType=G4RunManager::masterRM) at /home/ams/Documents/geant4-v11.2.1/source/run/src/G4RunManager.cc:157
#28 0x00007ffff55c95ee in G4MTRunManager::G4MTRunManager (this=0x6a79d0) at /home/ams/Documents/geant4-v11.2.1/source/run/src/G4MTRunManager.cc:121
#29 0x00007ffff55fd202 in G4TaskRunManager::G4TaskRunManager (this=0x6a79d0, task_queue=0x0, useTBB=<optimized out>, grainsize=0)
    at /home/ams/Documents/geant4-v11.2.1/source/run/src/G4TaskRunManager.cc:78
#30 0x00007ffff55de95e in G4RunManagerFactory::CreateRunManager (_type=G4RunManagerType::Tasking, _type@entry=G4RunManagerType::Default, _queue=_queue@entry=0x0, 
    fail_if_unavail=<optimized out>, fail_if_unavail@entry=true, nthreads=nthreads@entry=0) at /home/ams/Documents/geant4-v11.2.1/source/run/src/G4RunManagerFactory.cc:124
#31 0x0000000000406dac in main (argc=1, argv=0x7fffffffdef8) at /home/ams/Documents/B1/exampleB1.cc:63

Output of cmake config:

ams@localhorst:~/Documents/geant4-v11.2.1-build> cmake ../geant4-v11.2.1
-- Checking C++ feature CXXSTDLIB_FILESYSTEM_NATIVE - Success
-- Pre-configuring dataset G4NDL (4.7)
-- Pre-configuring dataset G4EMLOW (8.5)
-- Pre-configuring dataset PhotonEvaporation (5.7)
-- Pre-configuring dataset RadioactiveDecay (5.6)
-- Pre-configuring dataset G4PARTICLEXS (4.0)
-- Pre-configuring dataset G4PII (1.3)
-- Pre-configuring dataset RealSurface (2.2)
-- Pre-configuring dataset G4SAIDDATA (2.0)
-- Pre-configuring dataset G4ABLA (3.3)
-- Pre-configuring dataset G4INCL (1.2)
-- Pre-configuring dataset G4ENSDFSTATE (2.3)
  *WARNING*
    Geant4 has been pre-configured to look for datasets
    in the directory:
 
    /usr/local/share/Geant4/data
 
    but the following datasets are NOT present on disk at
    that location:
 
    G4NDL (4.7)
    G4EMLOW (8.5)
    PhotonEvaporation (5.7)
    RadioactiveDecay (5.6)
    G4PARTICLEXS (4.0)
    G4PII (1.3)
    RealSurface (2.2)
    G4SAIDDATA (2.0)
    G4ABLA (3.3)
    G4INCL (1.2)
    G4ENSDFSTATE (2.3)
 
    If you want to have these datasets installed automatically
    simply re-run cmake and set the GEANT4_INSTALL_DATA
    variable to ON. This will configure the build to download
    and install these datasets for you. For example, on the
    command line, do:
 
    cmake -DGEANT4_INSTALL_DATA=ON <otherargs>
 
    The variable can also be toggled in ccmake or cmake-gui.
    If you're running on a Windows system, this is the best
    solution as CMake will unpack the datasets for you
    without any further software being required
 
    Alternatively, you can install these datasets manually
    now or after you have installed Geant4. To do this,
    download the following files:
 
    https://cern.ch/geant4-data/datasets/G4NDL.4.7.tar.gz
    https://cern.ch/geant4-data/datasets/G4EMLOW.8.5.tar.gz
    https://cern.ch/geant4-data/datasets/G4PhotonEvaporation.5.7.tar.gz
    https://cern.ch/geant4-data/datasets/G4RadioactiveDecay.5.6.tar.gz
    https://cern.ch/geant4-data/datasets/G4PARTICLEXS.4.0.tar.gz
    https://cern.ch/geant4-data/datasets/G4PII.1.3.tar.gz
    https://cern.ch/geant4-data/datasets/G4RealSurface.2.2.tar.gz
    https://cern.ch/geant4-data/datasets/G4SAIDDATA.2.0.tar.gz
    https://cern.ch/geant4-data/datasets/G4ABLA.3.3.tar.gz
    https://cern.ch/geant4-data/datasets/G4INCL.1.2.tar.gz
    https://cern.ch/geant4-data/datasets/G4ENSDFSTATE.2.3.tar.gz
 
    and unpack them under the directory:
 
    /usr/local/share/Geant4/data
 
    As we supply the datasets packed in gzipped tar files,
    you will need the 'tar' utility to unpack them.
 
    Nota bene: Missing datasets will not affect or break
               compilation and installation of the Geant4
               libraries.
 
-- The following Geant4 features are enabled:
CMAKE_CXX_STANDARD: Compiling against C++ Standard '17'
GEANT4_BUILD_MULTITHREADED: Build multithread enabled libraries
GEANT4_BUILD_TLS_MODEL: Building with TLS model 'initial-exec'
GEANT4_USE_SYSTEM_EXPAT: Using system EXPAT library

-- Configuring done
-- Generating done
-- Build files have been written to: /home/ams/Documents/geant4-v11.2.1-build

Output of ldd

ams@localhorst:/usr/local/lib64> ldd libG4global.so 
	linux-vdso.so.1 (0x00007fffc2334000)
	libG4clhep.so => /usr/local/lib64/libG4clhep.so (0x00007f2ef36e7000)
	libG4ptl.so.2 => /usr/local/lib64/libG4ptl.so.2 (0x00007f2ef34ba000)
	libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f2ef30df000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f2ef2d9e000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f2ef2b85000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f2ef2965000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f2ef2590000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f2ef3c18000)

ams@localhorst:~/Documents/B1/build> ldd exampleB1
	linux-vdso.so.1 (0x00007ffd4a1b0000)
	libG4Tree.so => /usr/local/lib64/libG4Tree.so (0x00007f7489a30000)
	libG4FR.so => /usr/local/lib64/libG4FR.so (0x00007f748981b000)
	libG4GMocren.so => /usr/local/lib64/libG4GMocren.so (0x00007f74895d6000)
	libG4visHepRep.so => /usr/local/lib64/libG4visHepRep.so (0x00007f74893bc000)
	libG4RayTracer.so => /usr/local/lib64/libG4RayTracer.so (0x00007f7489190000)
	libG4VRML.so => /usr/local/lib64/libG4VRML.so (0x00007f7488f7f000)
	libG4ToolsSG.so => /usr/local/lib64/libG4ToolsSG.so (0x00007f7488bab000)
	libG4vis_management.so => /usr/local/lib64/libG4vis_management.so (0x00007f7488846000)
	libG4modeling.so => /usr/local/lib64/libG4modeling.so (0x00007f7488550000)
	libG4interfaces.so => /usr/local/lib64/libG4interfaces.so (0x00007f7488329000)
	libG4mctruth.so => /usr/local/lib64/libG4mctruth.so (0x00007f7488101000)
	libG4geomtext.so => /usr/local/lib64/libG4geomtext.so (0x00007f7487e78000)
	libG4error_propagation.so => /usr/local/lib64/libG4error_propagation.so (0x00007f7487c3b000)
	libG4readout.so => /usr/local/lib64/libG4readout.so (0x00007f7487a31000)
	libG4physicslists.so => /usr/local/lib64/libG4physicslists.so (0x00007f74876b9000)
	libG4run.so => /usr/local/lib64/libG4run.so (0x00007f74873e0000)
	libG4event.so => /usr/local/lib64/libG4event.so (0x00007f748715d000)
	libG4tracking.so => /usr/local/lib64/libG4tracking.so (0x00007f7486f07000)
	libG4parmodels.so => /usr/local/lib64/libG4parmodels.so (0x00007f7486cd8000)
	libG4processes.so => /usr/local/lib64/libG4processes.so (0x00007f7484fbd000)
	libG4digits_hits.so => /usr/local/lib64/libG4digits_hits.so (0x00007f7484d01000)
	libG4track.so => /usr/local/lib64/libG4track.so (0x00007f7484ae5000)
	libG4particles.so => /usr/local/lib64/libG4particles.so (0x00007f74847ba000)
	libG4geometry.so => /usr/local/lib64/libG4geometry.so (0x00007f748429d000)
	libG4materials.so => /usr/local/lib64/libG4materials.so (0x00007f7483fb7000)
	libG4graphics_reps.so => /usr/local/lib64/libG4graphics_reps.so (0x00007f7483d63000)
	libG4analysis.so => /usr/local/lib64/libG4analysis.so (0x00007f7483641000)
	libexpat.so.1 => /usr/lib64/libexpat.so.1 (0x00007f748340f000)
	libG4zlib.so => /usr/local/lib64/libG4zlib.so (0x00007f74831f7000)
	libG4intercoms.so => /usr/local/lib64/libG4intercoms.so (0x00007f7482f94000)
	libG4global.so => /usr/local/lib64/libG4global.so (0x00007f7482d09000)
	libG4clhep.so => /usr/local/lib64/libG4clhep.so (0x00007f7482a63000)
	libG4ptl.so.2 => /usr/local/lib64/libG4ptl.so.2 (0x00007f7482836000)
	libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f748245b000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f748211a000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f7481f01000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f7481ce1000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f748190c000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f7489c43000)

Thanks for the info - nominally the configure step of Geant4 should detect that stdc++fs is needed. The message that it’s found the “NATIVE” indicates that it thinks no further linking is needed so there may be a bug in that (note GCC 8 isn’t tested/supported for 11.2).

It should be sufficient to add stdc++fs as a PRIVATE link in any target_link_libraries that adds the Geant4 libraries in the relevant CMakeLists.txt as well.

That is an interesting info, because the installation guide names GNU 8 or higher as prerequisite!

However, I wasn´t exactly sure how to modify the target_link_libraries, so what I did was to modify the geant4/cmake/Modules/G4BuildSettings, where I just called set(GEANT4_CXX_FILESYSTEM_LIBRARY "stdc++fs") without the other if statements. The Geant4 build went fine and also the B1 build, where at the very end the -lstdc++fs flag is added. However, calling lld exampleB1 does NOT show libstdc++fs.a

Yet, the initial bad_alloc error is gone, just to be replace by another error coming from stdc++

I don´t want to take any more of your time away, you already helped me a lot! I will try again with a supported verion of GCC :slight_smile:

[100%] Linking CXX executable exampleB1
/usr/bin/cmake -E cmake_link_script CMakeFiles/exampleB1.dir/link.txt --verbose=1
/usr/bin/c++  CMakeFiles/exampleB1.dir/exampleB1.cc.o CMakeFiles/exampleB1.dir/src/ActionInitialization.cc.o CMakeFiles/exampleB1.dir/src/DetectorConstruction.cc.o CMakeFiles/exampleB1.dir/src/EventAction.cc.o CMakeFiles/exampleB1.dir/src/PrimaryGeneratorAction.cc.o CMakeFiles/exampleB1.dir/src/RunAction.cc.o CMakeFiles/exampleB1.dir/src/SteppingAction.cc.o  -o exampleB1  -Wl,-rpath,/home/ams/Documents/geant4-v11.2.1-install/lib64: /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4Tree.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4FR.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4GMocren.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4visHepRep.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4RayTracer.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4VRML.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4ToolsSG.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4vis_management.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4modeling.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4interfaces.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4mctruth.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4geomtext.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4error_propagation.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4readout.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4physicslists.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4run.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4event.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4tracking.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4parmodels.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4processes.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4digits_hits.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4track.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4particles.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4geometry.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4materials.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4graphics_reps.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4analysis.so /usr/lib64/libexpat.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4zlib.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4intercoms.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4global.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4clhep.so /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4ptl.so.2.3.3 -pthread -lstdc++fs 

make[2]: Leaving directory '/home/ams/Documents/B1/build'
[100%] Built target exampleB1
make[1]: Leaving directory '/home/ams/Documents/B1/build'
/usr/bin/cmake -E cmake_progress_start /home/ams/Documents/B1/build/CMakeFiles 0
ams@localhorst:~/Documents/B1/build> ldd exampleB1
	linux-vdso.so.1 (0x00007ffcf3f54000)
	libG4Tree.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4Tree.so (0x00007f8f68fa0000)
	libG4FR.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4FR.so (0x00007f8f68d8b000)
	libG4GMocren.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4GMocren.so (0x00007f8f68b44000)
	libG4visHepRep.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4visHepRep.so (0x00007f8f68929000)
	libG4RayTracer.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4RayTracer.so (0x00007f8f686fe000)
	libG4VRML.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4VRML.so (0x00007f8f684ed000)
	libG4ToolsSG.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4ToolsSG.so (0x00007f8f6810d000)
	libG4vis_management.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4vis_management.so (0x00007f8f67dae000)
	libG4modeling.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4modeling.so (0x00007f8f67ab8000)
	libG4interfaces.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4interfaces.so (0x00007f8f6788d000)
	libG4mctruth.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4mctruth.so (0x00007f8f67663000)
	libG4geomtext.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4geomtext.so (0x00007f8f673d7000)
	libG4error_propagation.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4error_propagation.so (0x00007f8f6719a000)
	libG4readout.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4readout.so (0x00007f8f66f90000)
	libG4physicslists.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4physicslists.so (0x00007f8f66c19000)
	libG4run.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4run.so (0x00007f8f6693e000)
	libG4event.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4event.so (0x00007f8f666bc000)
	libG4tracking.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4tracking.so (0x00007f8f66467000)
	libG4parmodels.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4parmodels.so (0x00007f8f66238000)
	libG4processes.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4processes.so (0x00007f8f644f8000)
	libG4digits_hits.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4digits_hits.so (0x00007f8f64234000)
	libG4track.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4track.so (0x00007f8f64019000)
	libG4particles.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4particles.so (0x00007f8f63ceb000)
	libG4geometry.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4geometry.so (0x00007f8f637c8000)
	libG4materials.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4materials.so (0x00007f8f634e8000)
	libG4graphics_reps.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4graphics_reps.so (0x00007f8f6328f000)
	libG4analysis.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4analysis.so (0x00007f8f62b48000)
	libexpat.so.1 => /usr/lib64/libexpat.so.1 (0x00007f8f62916000)
	libG4zlib.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4zlib.so (0x00007f8f626fa000)
	libG4intercoms.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4intercoms.so (0x00007f8f62490000)
	libG4global.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4global.so (0x00007f8f621e0000)
	libG4clhep.so => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4clhep.so (0x00007f8f61f34000)
	libG4ptl.so.2 => /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4ptl.so.2 (0x00007f8f61d07000)
	libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f8f6192c000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f8f615eb000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f8f613d2000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f8f611b2000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f8f60ddd000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f8f691b4000)
ams@localhorst:~/Documents/B1/build> gdb exampleB1
GNU gdb (GDB; SUSE Linux Enterprise 15) 10.1
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-suse-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://bugs.opensuse.org/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from exampleB1...
(gdb) run
Starting program: /home/ams/Documents/B1/build/exampleB1 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Available UI session types: [ tcsh, csh ]

**************************************************************
 Geant4 version Name: geant4-11-02-patch-01 [MT]   (16-February-2024)
  << in Multi-threaded mode >> 
                       Copyright : Geant4 Collaboration
                      References : NIM A 506 (2003), 250-303
                                 : IEEE-TNS 53 (2006), 270-278
                                 : NIM A 835 (2016), 186-225
                             WWW : http://geant4.org/
**************************************************************

<<< Reference Physics List QBBC 
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_M_construct null not valid

Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51	}
Missing separate debuginfos, use: zypper install libgcc_s1-debuginfo-10.3.0+git1587-1.6.4.x86_64 libstdc++6-debuginfo-10.3.0+git1587-1.6.4.x86_64
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007fffefa38585 in __GI_abort () at abort.c:79
#2  0x00007ffff05edfc6 in ?? () from /usr/lib64/libstdc++.so.6
#3  0x00007ffff05f977c in ?? () from /usr/lib64/libstdc++.so.6
#4  0x00007ffff05f97e7 in std::terminate() () from /usr/lib64/libstdc++.so.6
#5  0x00007ffff05f9a99 in __cxa_throw () from /usr/lib64/libstdc++.so.6
#6  0x00007ffff05f08e2 in std::__throw_logic_error(char const*) () from /usr/lib64/libstdc++.so.6
#7  0x00007ffff3a4557f in G4EmParameters::Initialise() () from /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4processes.so
#8  0x00007ffff3a455e5 in G4EmParameters::G4EmParameters() () from /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4processes.so
#9  0x00007ffff3a4b4dc in G4EmParameters::Instance() () from /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4processes.so
#10 0x00007ffff590b08f in G4EmStandardPhysics::G4EmStandardPhysics(int, G4String const&) () from /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4physicslists.so
#11 0x00007ffff595c5ac in QBBC::QBBC(int, G4String const&) () from /home/ams/Documents/geant4-v11.2.1-install/lib64/libG4physicslists.so
#12 0x000000000040810f in main ()
(gdb) 

Just for information I reinstalled Geant4 with gcc and g++ versions 9.3.1 and arrived at the same error as above. Running out of ideas now…

I forgot to copy the Geant4 data after reinstallation… That was the reason for SIGABRT.

Topic can be closed.

O.k., thanks for the info!

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