Hello! I have a problem running an example of radioactive decay (the second example). When starting the program in visualization mode and trying to launch the particles to start the decay (the green launch button in the interface), the program crashes.
G4WT2 > ### Run 0 starts on worker thread 2. Segmentation fault (core dumped)
Are you entering any macro commands in the visualization mode to do this? The default behavior of run in this or any other geant4 program is to fire a single Geantino of 3 MeV at the origin along the x-axis. This particle does not decay and will leave the world volume. That would cause issues with a module expecting decays to calculate various values.
in order to reproduce and diagnose the problem it is important to know EXACTLY what you did and how you did it.
If I try to compile and run rdecay2 without arguments (no macro). I get the GUI. When I press the “play“ button as you mention, I get the following message:
Geant4 kernel should be initialized
before the first BeamOn(). - BeamOn ignored.
So, you must have issued /run/initialize also. Anyways. The example by default shoots this ion (PrimaryGeneratorAction::GeneratePrimaries) :
G4int Z = 10, A = 24;
And the example is failing whenever a histogram is being filled. It does work when you use the intended and provided macros. I’ll look further into this.
I narrowed it down to the presence of the line /analysis/h1/set 6 100 0. 2. MeV . If you remove that line from the run.mac file. You get the same error. I see the histograms being defined… I am not sure why this is happening. Maybe @ivana can give some insight?
There is problem in the analysis manager, which fails in this particular situation when user inactivates all analysis objects and does not open a file. In this situation, an internal ntuple manager is not created and the program breaks on FillNtuple… call, which is delegated to this non-existing ntuple manager.
A work-around agains a crash is to call /analysis/openFile before run/beamOn and /analysis/closeFile after processing run.
I have proposed a fix in the development version, and I hope it will still get to the next release, and the next patch to 11.3. release.