I was trying to simulate some decay chains using G4VUserPhysicsList and G4RadioactiveDecay class. However, I keep getting segmentation faults and the backtrace seems to be related to radioactive decay. I am attaching my code snippet the handles the radioactive decay process for Generic Ions. Could you please let me know what I might have done wrong here? I am pretty sure the particle process for Generic Ion is the source of the problem because if I comment it out, everything else in my simulation runs fine.
Code:
else if (particleName == “GenericIon”) {
std::cout << "Generic Ion Activate: " << particleName << std::endl;
G4RadioactiveDecay* theRadioactiveDecay = new G4RadioactiveDecay();
pmanager->AddProcess(theRadioactiveDecay);
pmanager->SetProcessOrdering(theRadioactiveDecay, idxPostStep);
pmanager->SetProcessOrdering(theRadioactiveDecay, idxAtRest);
}
BackTrace:
Backtrace:
[PID=2367, TID=0][ 0/16]> /home/waly/software/geant4/geant4-mt-v11.0.3/lib/libG4processes.so(_ZN9G4ITDecay7DecayItEd+0x2aa) [0x7fe08a9695da]
[PID=2367, TID=0][ 1/16]> /home/waly/software/geant4/geant4-mt-v11.0.3/lib/libG4processes.so(_ZN18G4RadioactiveDecay7DoDecayERK20G4ParticleDefinition+0x7a) [0x7fe08a970aaa]
[PID=2367, TID=0][ 2/16]> /home/waly/software/geant4/geant4-mt-v11.0.3/lib/libG4processes.so(_ZN18G4RadioactiveDecay11DecayAnalogERK7G4Track+0x3e) [0x7fe08a970e5e]
[PID=2367, TID=0][ 3/16]> /home/waly/software/geant4/geant4-mt-v11.0.3/lib/libG4processes.so(_ZN18G4RadioactiveDecay7DecayItERK7G4TrackRK6G4Step+0x8a3) [0x7fe08a9721b3]
[PID=2367, TID=0][ 4/16]> /home/waly/software/geant4/geant4-mt-v11.0.3/lib/libG4tracking.so(_ZN17G4SteppingManager11InvokePSDIPEm+0x55) [0x7fe08b4d2b15]
[PID=2367, TID=0][ 5/16]> /home/waly/software/geant4/geant4-mt-v11.0.3/lib/libG4tracking.so(_ZN17G4SteppingManager23InvokePostStepDoItProcsEv+0x8b) [0x7fe08b4d32db]
[PID=2367, TID=0][ 6/16]> /home/waly/software/geant4/geant4-mt-v11.0.3/lib/libG4tracking.so(_ZN17G4SteppingManager8SteppingEv+0x46c) [0x7fe08b4cf81c]
[PID=2367, TID=0][ 7/16]> /home/waly/software/geant4/geant4-mt-v11.0.3/lib/libG4tracking.so(_ZN17G4TrackingManager15ProcessOneTrackEP7G4Track+0x118) [0x7fe08b4e5488]
[PID=2367, TID=0][ 8/16]> /home/waly/software/geant4/geant4-mt-v11.0.3/lib/libG4event.so(_ZN14G4EventManager12DoProcessingEP7G4Event+0x893) [0x7fe08b526303]
[PID=2367, TID=0][ 9/16]> /home/waly/software/geant4/geant4-mt-v11.0.3/lib/libG4run.so(_ZN18G4WorkerRunManager11DoEventLoopEiPKci+0x1cc) [0x7fe08b5eda7c]
[PID=2367, TID=0][10/16]> /home/waly/software/geant4/geant4-mt-v11.0.3/lib/libG4run.so(_ZN12G4RunManager6BeamOnEiPKci+0x62) [0x7fe08b5df272]
[PID=2367, TID=0][11/16]> /home/waly/software/geant4/geant4-mt-v11.0.3/lib/libG4run.so(_ZN18G4WorkerRunManager6DoWorkEv+0x36b) [0x7fe08b5f108b]
[PID=2367, TID=0][12/16]> /home/waly/software/geant4/geant4-mt-v11.0.3/lib/libG4run.so(_ZN20G4MTRunManagerKernel11StartThreadEP14G4WorkerThread+0x19e) [0x7fe08b614d2e]
[PID=2367, TID=0][13/16]> /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xd6de4) [0x7fe088b8cde4]
[PID=2367, TID=0][14/16]> /usr/lib/x86_64-linux-gnu/libpthread.so.0(+0x8609) [0x7fe08722e609]
[PID=2367, TID=0][15/16]> /usr/lib/x86_64-linux-gnu/libc.so.6(clone+0x43) [0x7fe088879133]
: Segmentation fault (Address not mapped to object [0x20])
Aborted
However, I would like to mention that if I use G4VmodularPhysicsList, I don’t get this error, but I wanted more control over my physics list, so wanted to switch to G4VUserPhysicsList. I am using Geant4 11.0.3 on Ubuntu