Geant4 Version: geant4.10.04.p02 and geant4.10.05.p01 Operating System: Ubuntu18 and Centos7 Compiler/Version: various CMake Version: various
Hi,
I get a segmentation fault in a geant4 call to G4ParameterisedNavigation::ComputeSafety(…).
Since it happens with a code on top of geant4 (gamos), I cannot produce any geant4 based examples (I can provide the gamos macros, if necessary). I have contacted the gamos group as well, but since the crash happens in geant4 code, I wondered if someone could provide some general answers about this.
It happens on different machines (mainly Ubuntu18 and Centos7) and at least with versions geant4.10.04.p02 and geant4.10.05.p01.
It happens during large jobs, of at least 1M events and never at the same moment. For a certain particular event, I would get a segmentation fault during a call to G4ParameterisedNavigation::ComputeSafety which is called by G4Navigation::ComputeSafety.
As far as I can see, it goes wrong with this line: curVoxelNode = fVoxelHeader->GetSlice(curVoxelNodeNo)->GetNode();
(I checked that the pointers are not 0)
In fact, it seems G4ParameterisedNavigation::ComputeSafety is only called when things go wrong, in all previous events it’s never called at all.
So my questions are:
What could cause this this code to crash? (A mistake in the geometry?)
Why is this code only called when things go wrong? (I put print statements in the code and they only occur just before the crash)
Would it be safe to just skip the call to this code and skip the event?
Calls to ComputeSafety() by G4ParameterisedNavigation can happen whenever a track intersects a portion of your geometry defined as a parameterisation. A crash (which crash? which error message?) may be due to a wrong geometry setup… Something you should investigate with the GAMOS developers, by providing all the details.
There’s no error message, it’s a direct segmentation fault, without warnings or error messages or anything (“*** Break *** segmentation violation”) and then a stack of the last function calls.. I am not sure what you mean with “geometry defined as a parametrisation”. I just have block of Silicon, divided into voxels. Nothing else.
Yes, I have contacted the GAMOS developers too, but since the segmentation fault happens in geant4 code and since the code only is called once (apparantly), and only in the particular event when things go wrong, I wondered if there was some general geant4 explanation for it.
GAMOS is based on Geant4 and is eventually using parameterised volumes to define your voxels… There is no general explanation why such a simple (?) geometry could lead to a segmentation fault in Geant4.
Okay, I think I see what you mean. “Parametrised volumes”, means subvolumes inside a bigger volume, created by some kind of function using parameters (stepsize, volume etc…). Thank you, I will re-check my geometry.
In any case, I think any code should never get “segmentation fault”. It should give some warning or error message instead. I checked all the pointers in the function and none of them were 0, but my guess one of them is faulty.