Physics List QBBC throwing 'std::logic_error'

Hello Geant4 Community,

I installed Geant4 on a Server(CentOs 7 without Desktop system)
When I try to run example B1, I get the error

Reference Physics List QBBC
terminate called after throwing an instance of ‘std::logic_error’ what(): basic_string: construction from null is not valid

And I use cmake by

cmake -DCMAKE_INSTALL_PREFIX=…/install -DGEANT4_BUILD_MULTITHREADED=ON -DCMAKE_C_COMPILER=/public/apps/gcc/13.2/bin/gcc -DCMAKE_CXX_COMPILER=/public/apps/gcc/13.2/bin/g++ -DGEANT4_USE_SYSTEM_EXPAT=OFF …/geant4-v11.2.1/

_Geant4 Version:11.2.1
_Operating System:CentOs 7 without Desktop system.
_Compiler/Version:13.2.0
_CMake Version:3.29

The best way to track down the source of this is to run in a debugger such as gdb. Usually, this should be as simple as

$ gdb exampleB1
> run
... runs until exception throw...
> bt
... should show where error occurred in code ...

You can also search the forum for “gbd” for several related posts, and there are many guides to use of gdb online.

Thanks, I get errors:

GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-120.el7
Copyright (C) 2013 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-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /public/home/CIAENSG/geant4/install/share/Geant4/examples/basic/B1/build/exampleB1...done.
(gdb) run.mac
Starting program: /public/home/CIAENSG/geant4/install/share/Geant4/examples/basic/B1/build/exampleB1 .mac
Dwarf Error: wrong version in compilation unit header (is 5, should be 2, 3, or 4) [in module /public/apps/gcc/13.2/lib64/libstdc++.so.6]
warning: File "/public/apps/gcc/13.2/lib64/libstdc++.so.6.0.32-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load:/usr/bin/mono-gdb.py".
To enable execution of this file add
        add-auto-load-safe-path /public/apps/gcc/13.2/lib64/libstdc++.so.6.0.32-gdb.py
line to your configuration file "/public/home/CIAENSG/.gdbinit".
To completely disable this security protection add
        set auto-load safe-path /
line to your configuration file "/public/home/CIAENSG/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
        info "(gdb)Auto-loading safe path"
Dwarf Error: wrong version in compilation unit header (is 5, should be 2, 3, or 4) [in module /public/apps/gcc/13.2/lib64/libgcc_s.so.1]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

**************************************************************
 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: construction from null is not valid

Program received signal SIGABRT, Aborted.
0x00002aaab2e87387 in raise () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install glibc-2.17-317.el7.x86_64

I think The problem mainly stems from the presence of multiple GCCs on the server.

It should still be possible to get a backtrace even in this case. Do you get a gdb prompt back after the

Program received signal SIGABRT, Aborted.
0x00002aaab2e87387 in raise () from /lib64/libc.so.6

? If so, then you can just type bt at that.

Otherwise, you’ll need to ask the sysadmins of the server to install and setup the packages needed for debugging properly.