I wrote a program simulating a RPC detector detecting cosmic muons. The physics list used in the simulation is FTFP_BERT. The program is coded to run in single thread mode. My OS is Debian Stretch with GCC version 6.30 and linux kernel version 4.9.0-3-amd64 #1 SMP Debian 4.9.30-1 (2017-06-04) x86_64 GNU/Linux. The segmentation fault occurred after 13468 event. I used valgrind to check the problem and here is a report generated by valgrind: ---> Begin of event: 13468 ==3702== Invalid read of size 8 ==3702== at 0xD837AB0: G4VoxelNavigation::ComputeStep(CLHEP::Hep3Vector const&, CLHEP::Hep3Vector const&, double, double&, G4NavigationHistory&, bool&, CLHEP::Hep3Vector&, bool&, bool&, G4VPhysicalVolume**, int&) (in /home/hu/Stage/geant4/lib/libG4geometry.so) ==3702== by 0xD81411D: G4Navigator::ComputeStep(CLHEP::Hep3Vector const&, CLHEP::Hep3Vector const&, double, double&) (in /home/hu/Stage/geant4/lib/libG4geometry.so) ==3702== by 0xBA6B86F: G4Transportation::AlongStepGetPhysicalInteractionLength(G4Track const&, double, double, double&, G4GPILSelection*) (in /home/hu/Stage/geant4/lib/libG4processes.so) ==3702== by 0xA9C0BA1: G4SteppingManager::DefinePhysicalStepLength() (in /home/hu/Stage/geant4/lib/libG4tracking.so) ==3702== by 0xA9BED76: G4SteppingManager::Stepping() (in /home/hu/Stage/geant4/lib/libG4tracking.so) ==3702== by 0xA9CAA22: G4TrackingManager::ProcessOneTrack(G4Track*) (in /home/hu/Stage/geant4/lib/libG4tracking.so) ==3702== by 0xA73BBC7: G4EventManager::DoProcessing(G4Event*) (in /home/hu/Stage/geant4/lib/libG4event.so) ==3702== by 0xA4D5914: G4RunManager::ProcessOneEvent(int) (in /home/hu/Stage/geant4/lib/libG4run.so) ==3702== by 0xA4D38DA: G4RunManager::BeamOn(int, char const*, int) (in /home/hu/Stage/geant4/lib/libG4run.so) ==3702== by 0xA4EFF69: G4RunMessenger::SetNewValue(G4UIcommand*, G4String) (in /home/hu/Stage/geant4/lib/libG4run.so) ==3702== by 0xE0EDA2C: G4UIcommand::DoIt(G4String) (in /home/hu/Stage/geant4/lib/libG4intercoms.so) ==3702== by 0xE10AAF7: G4UImanager::ApplyCommand(char const*) (in /home/hu/Stage/geant4/lib/libG4intercoms.so) ==3702== Address 0x19c96fa8 is 24 bytes after a block of size 64 in arena "client" ==3702== ==3702== Invalid read of size 4 ==3702== at 0xD7E2D90: G4VPhysicalVolume::GetTranslation() const (in /home/hu/Stage/geant4/lib/libG4geometry.so) ==3702== by 0xD837AC2: G4VoxelNavigation::ComputeStep(CLHEP::Hep3Vector const&, CLHEP::Hep3Vector const&, double, double&, G4NavigationHistory&, bool&, CLHEP::Hep3Vector&, bool&, bool&, G4VPhysicalVolume**, int&) (in /home/hu/Stage/geant4/lib/libG4geometry.so) ==3702== by 0xD81411D: G4Navigator::ComputeStep(CLHEP::Hep3Vector const&, CLHEP::Hep3Vector const&, double, double&) (in /home/hu/Stage/geant4/lib/libG4geometry.so) ==3702== by 0xBA6B86F: G4Transportation::AlongStepGetPhysicalInteractionLength(G4Track const&, double, double, double&, G4GPILSelection*) (in /home/hu/Stage/geant4/lib/libG4processes.so) ==3702== by 0xA9C0BA1: G4SteppingManager::DefinePhysicalStepLength() (in /home/hu/Stage/geant4/lib/libG4tracking.so) ==3702== by 0xA9BED76: G4SteppingManager::Stepping() (in /home/hu/Stage/geant4/lib/libG4tracking.so) ==3702== by 0xA9CAA22: G4TrackingManager::ProcessOneTrack(G4Track*) (in /home/hu/Stage/geant4/lib/libG4tracking.so) ==3702== by 0xA73BBC7: G4EventManager::DoProcessing(G4Event*) (in /home/hu/Stage/geant4/lib/libG4event.so) ==3702== by 0xA4D5914: G4RunManager::ProcessOneEvent(int) (in /home/hu/Stage/geant4/lib/libG4run.so) ==3702== by 0xA4D38DA: G4RunManager::BeamOn(int, char const*, int) (in /home/hu/Stage/geant4/lib/libG4run.so) ==3702== by 0xA4EFF69: G4RunMessenger::SetNewValue(G4UIcommand*, G4String) (in /home/hu/Stage/geant4/lib/libG4run.so) ==3702== by 0xE0EDA2C: G4UIcommand::DoIt(G4String) (in /home/hu/Stage/geant4/lib/libG4intercoms.so) ==3702== Address 0x88 is not stack'd, malloc'd or (recently) free'd ==3702== ==3702== ==3702== Process terminating with default action of signal 11 (SIGSEGV) ==3702== Access not within mapped region at address 0x88 ==3702== at 0xD7E2D90: G4VPhysicalVolume::GetTranslation() const (in /home/hu/Stage/geant4/lib/libG4geometry.so) ==3702== by 0xD837AC2: G4VoxelNavigation::ComputeStep(CLHEP::Hep3Vector const&, CLHEP::Hep3Vector const&, double, double&, G4NavigationHistory&, bool&, CLHEP::Hep3Vector&, bool&, bool&, G4VPhysicalVolume**, int&) (in /home/hu/Stage/geant4/lib/libG4geometry.so) ==3702== by 0xD81411D: G4Navigator::ComputeStep(CLHEP::Hep3Vector const&, CLHEP::Hep3Vector const&, double, double&) (in /home/hu/Stage/geant4/lib/libG4geometry.so) ==3702== by 0xBA6B86F: G4Transportation::AlongStepGetPhysicalInteractionLength(G4Track const&, double, double, double&, G4GPILSelection*) (in /home/hu/Stage/geant4/lib/libG4processes.so) ==3702== by 0xA9C0BA1: G4SteppingManager::DefinePhysicalStepLength() (in /home/hu/Stage/geant4/lib/libG4tracking.so) ==3702== by 0xA9BED76: G4SteppingManager::Stepping() (in /home/hu/Stage/geant4/lib/libG4tracking.so) ==3702== by 0xA9CAA22: G4TrackingManager::ProcessOneTrack(G4Track*) (in /home/hu/Stage/geant4/lib/libG4tracking.so) ==3702== by 0xA73BBC7: G4EventManager::DoProcessing(G4Event*) (in /home/hu/Stage/geant4/lib/libG4event.so) ==3702== by 0xA4D5914: G4RunManager::ProcessOneEvent(int) (in /home/hu/Stage/geant4/lib/libG4run.so) ==3702== by 0xA4D38DA: G4RunManager::BeamOn(int, char const*, int) (in /home/hu/Stage/geant4/lib/libG4run.so) ==3702== by 0xA4EFF69: G4RunMessenger::SetNewValue(G4UIcommand*, G4String) (in /home/hu/Stage/geant4/lib/libG4run.so) ==3702== by 0xE0EDA2C: G4UIcommand::DoIt(G4String) (in /home/hu/Stage/geant4/lib/libG4intercoms.so) ==3702== If you believe this happened as a result of a stack ==3702== overflow in your program's main thread (unlikely but ==3702== possible), you can try to increase the size of the ==3702== main thread stack using the --main-stacksize= flag. ==3702== The main thread stack size used in this run was 8388608. ==3702== ==3702== HEAP SUMMARY: ==3702== in use at exit: 33,034,285 bytes in 100,776 blocks ==3702== total heap usage: 2,106,813 allocs, 2,006,037 frees, 305,186,916 bytes allocated ==3702== ==3702== LEAK SUMMARY: ==3702== definitely lost: 0 bytes in 0 blocks ==3702== indirectly lost: 0 bytes in 0 blocks ==3702== possibly lost: 0 bytes in 0 blocks ==3702== still reachable: 33,034,285 bytes in 100,776 blocks ==3702== of which reachable via heuristic: ==3702== multipleinheritance: 152 bytes in 2 blocks ==3702== suppressed: 0 bytes in 0 blocks ==3702== Rerun with --leak-check=full to see details of leaked memory ==3702== ==3702== For counts of detected and suppressed errors, rerun with: -v ==3702== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0) Segmentation fault
We have no elements for either reproducing or identify if indeed there is a problem from what reported here... You should verify how your application is set up and make sure geometry is properly configured.