Run crashed - WARNING - Attempt to delete the physical volume store while geometry closed!

Dear experts,
First, let me say that I’m a newbie, please sorry if not is a good question.
I’m trying to see the secondary radiation with a second volume when primaries, in this case protons, deposited dose in the first volume (see pic).
When I increase the energy of primary protons, that these pass throughout the first volume (box), these WARNINGS happen and the run crashed.
I searched for that but I can not find any solution. I’m running the code in sequential mode.
If anybody can help me I’ll appreciate it. Thank you in advance.

WARNING - Attempt to delete the physical volume store while geometry closed !
WARNING - Attempt to delete the logical volume store while geometry closed !
WARNING - Attempt to delete the solid store while geometry closed !
WARNING - Attempt to delete the region store while geometry closed !

There should have been some sort of FATAL error reported before those lines, or maybe you have an explicit “::exit()” somehwere in your application code. Those warning happen if the application attempts to quit out in the middle of a run (i.e., during a /run/beamOn event loop), and the static object cleanup deletes the geometry stores .

Thank you so much!! I’ll check

Yes, you are right, before given to me all those WARNINGS, give this:

*** Break *** segmentation violation

===========================================================
There was a crash.
This is the entire stack trace of all threads:

#0 0x00007f265a038dba in wait4 () from /usr/lib/x86_64-linux-gnu/libc.so.6
#1 0x00007f2659fa80e7 in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
#2 0x00007f265be7636e in TUnixSystem::StackTrace() () from /home/dayron/Apps/root/root-build/lib/libCore.so
#3 0x00007f265be7308c in TUnixSystem::DispatchSignals(ESignals) () from /home/dayron/Apps/root/root-build/lib/libCore.so
#4
#5 0x000055722078bdfd in SteppingAction::UserSteppingAction(G4Step const*) ()
#6 0x00007f265ac2e7d5 in G4SteppingManager::Stepping() () from /home/dayron/Apps/Geant4/geant4-install/lib/libG4tracking.so
#7 0x00007f265ac398ec in G4TrackingManager::ProcessOneTrack(G4Track*) () from /home/dayron/Apps/Geant4/geant4-install/lib/libG4tracking.so
#8 0x00007f265ac74b2a in G4EventManager::DoProcessing(G4Event*) () from /home/dayron/Apps/Geant4/geant4-install/lib/libG4event.so
#9 0x00007f265ad146c7 in G4RunManager::DoEventLoop(int, char const*, int) () from /home/dayron/Apps/Geant4/geant4-install/lib/libG4run.so
#10 0x00007f265ad12312 in G4RunManager::BeamOn(int, char const*, int) () from /home/dayron/Apps/Geant4/geant4-install/lib/libG4run.so
#11 0x00007f265ad2c0b7 in G4RunMessenger::SetNewValue(G4UIcommand*, G4String) () from /home/dayron/Apps/Geant4/geant4-install/lib/libG4run.so
#12 0x00007f265a68db83 in G4UIcommand::DoIt(G4String) () from /home/dayron/Apps/Geant4/geant4-install/lib/libG4intercoms.so
#13 0x00007f265a6ac9ef in G4UImanager::ApplyCommand(char const*) () from /home/dayron/Apps/Geant4/geant4-install/lib/libG4intercoms.so
#14 0x00007f265a67c4b1 in G4UIbatch::ExecCommand(G4String const&) () from /home/dayron/Apps/Geant4/geant4-install/lib/libG4intercoms.so
#15 0x00007f265a67e466 in G4UIbatch::SessionStart() () from /home/dayron/Apps/Geant4/geant4-install/lib/libG4intercoms.so
#16 0x00007f265a6ae260 in G4UImanager::ExecuteMacroFile(char const*) () from /home/dayron/Apps/Geant4/geant4-install/lib/libG4intercoms.so
#17 0x00007f265a69a426 in G4UIcontrolMessenger::SetNewValue(G4UIcommand*, G4String) () from /home/dayron/Apps/Geant4/geant4-install/lib/libG4intercoms.so
#18 0x00007f265a68db83 in G4UIcommand::DoIt(G4String) () from /home/dayron/Apps/Geant4/geant4-install/lib/libG4intercoms.so
#19 0x00007f265a6ac9ef in G4UImanager::ApplyCommand(char const*) () from /home/dayron/Apps/Geant4/geant4-install/lib/libG4intercoms.so
#20 0x000055722077ad15 in main ()

The lines below might hint at the cause of the crash.
You may get help by asking at the ROOT forum http://root.cern.ch/forum
Only if you are really convinced it is a bug in ROOT then please submit a
report at http://root.cern.ch/bugs Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.

#5 0x000055722078bdfd in SteppingAction::UserSteppingAction(G4Step const*) ()
#6 0x00007f265ac2e7d5 in G4SteppingManager::Stepping() () from /home/dayron/Apps/Geant4/geant4-install/lib/libG4tracking.so
#7 0x00007f265ac398ec in G4TrackingManager::ProcessOneTrack(G4Track*) () from /home/dayron/Apps/Geant4/geant4-install/lib/libG4tracking.so
#8 0x00007f265ac74b2a in G4EventManager::DoProcessing(G4Event*) () from /home/dayron/Apps/Geant4/geant4-install/lib/libG4event.so
#9 0x00007f265ad146c7 in G4RunManager::DoEventLoop(int, char const*, int) () from /home/dayron/Apps/Geant4/geant4-install/lib/libG4run.so
#10 0x00007f265ad12312 in G4RunManager::BeamOn(int, char const*, int) () from /home/dayron/Apps/Geant4/geant4-install/lib/libG4run.so
#11 0x00007f265ad2c0b7 in G4RunMessenger::SetNewValue(G4UIcommand*, G4String) () from /home/dayron/Apps/Geant4/geant4-install/lib/libG4run.so
#12 0x00007f265a68db83 in G4UIcommand::DoIt(G4String) () from /home/dayron/Apps/Geant4/geant4-install/lib/libG4intercoms.so
#13 0x00007f265a6ac9ef in G4UImanager::ApplyCommand(char const*) () from /home/dayron/Apps/Geant4/geant4-install/lib/libG4intercoms.so
#14 0x00007f265a67c4b1 in G4UIbatch::ExecCommand(G4String const&) () from /home/dayron/Apps/Geant4/geant4-install/lib/libG4intercoms.so
#15 0x00007f265a67e466 in G4UIbatch::SessionStart() () from /home/dayron/Apps/Geant4/geant4-install/lib/libG4intercoms.so
#16 0x00007f265a6ae260 in G4UImanager::ExecuteMacroFile(char const*) () from /home/dayron/Apps/Geant4/geant4-install/lib/libG4intercoms.so
#17 0x00007f265a69a426 in G4UIcontrolMessenger::SetNewValue(G4UIcommand*, G4String) () from /home/dayron/Apps/Geant4/geant4-install/lib/libG4intercoms.so
#18 0x00007f265a68db83 in G4UIcommand::DoIt(G4String) () from /home/dayron/Apps/Geant4/geant4-install/lib/libG4intercoms.so
#19 0x00007f265a6ac9ef in G4UImanager::ApplyCommand(char const*) () from /home/dayron/Apps/Geant4/geant4-install/lib/libG4intercoms.so
#20 0x000055722077ad15 in main ()

WARNING - Attempt to delete the physical volume store while geometry closed !
WARNING - Attempt to delete the logical volume store while geometry closed !
WARNING - Attempt to delete the solid store while geometry closed !
WARNING - Attempt to delete the region store while geometry closed !

And the problem is caused by this line:

G4String proName = step->GetTrack()->GetCreatorProcess()->GetProcessName();

In the UserSteppingAction().
Do you know how can I fix it??

Best, Dayron

The UserSteppingAction() is your own code, so you will need to debug it yourself. In the line you quote:

G4String proName = step->GetTrack()->GetCreatorProcess()->GetProcessName();

Notice that you are dereferencing a series of three pointers which are returned by function calls. More than likely, one of those functions returned a null pointer, which obviously can’t be dereferenced, since it doesn’t point to an object in memory.

Primary particles, for example, do not have a “creator process” since they’re instantiated by the PrimaryGeneratorAction, not as a secondary from a physics process. So if you happen to be processing a primary track, GetCreatorProcess() will return 0 (null pointer).

Thank you so much!! I already fixed it. The problem was that I was procesing primary tracks.
Thanks again.
Best, D

I’m facing the same but I don’t know how to identify the code line that causes it. When I’m running a simulation via the GUI no warning appears but via run.mac it does:

10 events have been kept for refreshing and/or reviewing.
(Note: No keep requests were made by the vis manager.
The kept events are those you have asked to be kept in your user action(s).)
“/vis/reviewKeptEvents” to review them one by one.
“/vis/enable”, then “/vis/viewer/flush” or “/vis/viewer/rebuild” to see them accumulated.
WARNING - Attempt to delete the physical volume store while geometry closed !
WARNING - Attempt to delete the logical volume store while geometry closed !
WARNING - Attempt to delete the solid store while geometry closed !
WARNING - Attempt to delete the region store while geometry closed !

The command in run.mac is only

/run/beamOn 1000

But on the other side the file is generated so I’m not sure whether I shall investigate in this anyway?