Error segmentation fault (core dump)

Hi Dear Geant4 !
I’m trying to run my code but face to some issue (error segmentation fault (core dump)).
When the event is less than 8000, the code execute well. Increasing the number of event more than this value I have the core dump issue.
can someone help me to understand what can be the cause and how do I fix it ?


Thank

With segmentation faults the only real way to track these done is to build the application in Debug mode and run through a debugger like gdb which will help to locate origin of the problem. There are many threads on the Forum about using gdb so have a search for those, but in short:

  1. Configure/build the application in Debug mode, which can be done with CMake as:

    $ cmake -DCMAKE_BUILD_TYPE=Debug <otherargs>
    ...
    $ make
    
  2. Run the application inside gdb, e.g.

    $ gdb myapplication
    ... or if the application takes command line arguments, e.g. a macro ...
    $ gdb -- myapplication -m macro.mac
    

    this should load up the program into gdb and present a command prompt. Simply type

    > run
    

    to run. When the segfault occurs, use the bt (or backtrace) command to print a call stack which will show, as the first line or so, the source file and line where the issue occurred.

The above is usually just a first step, but provides the necessary guidance on where to look. As the segfault is occurring after a given number of events, I’d suspect you have a memory leak somewhere.

@bmorgan, Thank for see reply.
I’ll try to see

Please guide me on this
‘’’
*** G4Exception : GeomVol1002
issued by : G4PVPlacement::CheckOverlaps()
Overlap with mother volume !
Overlap is detected for volume HollowSphere:0 (G4Orb) with its mother volume Foam (G4Box)
protrusion at mother local point (26.7989,-15.0211,-5.05988) by 298.88 um (max of 65 cases)
NOTE: Reached maximum fixed number -1- of overlaps reports for this volume !
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

Checking overlaps for volume HollowSphere:0 (G4Orb) …
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomVol1002
issued by : G4PVPlacement::CheckOverlaps()
Overlap with mother volume !
Overlap is detected for volume HollowSphere:0 (G4Orb) with its mother volume Foam (G4Box)
protrusion at mother local point (26.7995,-14.9566,4.99714) by 299.474 um (max of 96 cases)
NOTE: Reached maximum fixed number -1- of overlaps reports for this volume !
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

Checking overlaps for volume HollowSphere:0 (G4Orb) …
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomVol1002
issued by : G4PVPlacement::CheckOverlaps()
Overlap with mother volume !
Overlap is detected for volume HollowSphere:0 (G4Orb) with its mother volume Foam (G4Box)
protrusion at mother local point (26.7953,-4.96803,-4.87375) by 295.283 um (max of 77 cases)
NOTE: Reached maximum fixed number -1- of overlaps reports for this volume !
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

Checking overlaps for volume HollowSphere:0 (G4Orb) …
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomVol1002
issued by : G4PVPlacement::CheckOverlaps()
Overlap with mother volume !
Overlap is detected for volume HollowSphere:0 (G4Orb) with its mother volume Foam (G4Box)
protrusion at mother local point (26.7988,-5.05684,4.96933) by 298.841 um (max of 89 cases)
NOTE: Reached maximum fixed number -1- of overlaps reports for this volume !
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

Checking overlaps for volume HollowSphere:0 (G4Orb) …
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomVol1002
issued by : G4PVPlacement::CheckOverlaps()
Overlap with mother volume !
Overlap is detected for volume HollowSphere:0 (G4Orb) with its mother volume Foam (G4Box)
protrusion at mother local point (26.7995,4.96503,-5.02143) by 299.533 um (max of 75 cases)
NOTE: Reached maximum fixed number -1- of overlaps reports for this volume !
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

Checking overlaps for volume HollowSphere:0 (G4Orb) …
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomVol1002
issued by : G4PVPlacement::CheckOverlaps()
Overlap with mother volume !
Overlap is detected for volume HollowSphere:0 (G4Orb) with its mother volume Foam (G4Box)
protrusion at mother local point (26.7975,5.00175,5.09531) by 297.474 um (max of 79 cases)
NOTE: Reached maximum fixed number -1- of overlaps reports for this volume !
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

Checking overlaps for volume HollowSphere:0 (G4Orb) …
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomVol1002
issued by : G4PVPlacement::CheckOverlaps()
Overlap with mother volume !
Overlap is detected for volume HollowSphere:0 (G4Orb) with its mother volume Foam (G4Box)
protrusion at mother local point (26.7996,14.9788,-4.97043) by 299.632 um (max of 82 cases)
NOTE: Reached maximum fixed number -1- of overlaps reports for this volume !
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

Checking overlaps for volume HollowSphere:0 (G4Orb) …
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomVol1002
issued by : G4PVPlacement::CheckOverlaps()
Overlap with mother volume !
Overlap is detected for volume HollowSphere:0 (G4Orb) with its mother volume Foam (G4Box)
protrusion at mother local point (26.7972,14.953,5.08808) by 297.231 um (max of 80 cases)
NOTE: Reached maximum fixed number -1- of overlaps reports for this volume !
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

Checking overlaps for volume Foam:0 (G4Box) … OK!
World is registered to the default region.
Segmentation fault (core dumped)
‘’’