A problem using phase space files

So the backtrace you’ve posted doesn’t have any information about which actual functions (or source lines) were involved. That’s the behaviour when you compile what CMake calls a “Release” build. I don’t think you need all the Geant4 debugging symbols, but you will find it useful to build your example with debugging enabled.

To do that, configure your exampleB1 with

cmake -DCMAKE_BUILD_TYPE=Debug ...

(where “…” means all your other normal CMake options), and rebuild it. You’ll still get the error and traceback, but the traceback will include function names and arguments, line numbers, etc.

If you build this way, you’ll also be able to run your code in the debugger (gdb) live, and step through functions, print out variables, etc.