Too many active Navigators / worlds

Hi all,

In our Geant4 based program we are taking advantage of the Scoring Meshes functionality. When the number of meshes defined in the code becomes more than G4PathFinder::fMaxNav (static const value of 16) then following exception is triggered:

-------- EEEE ------- G4Exception-START -------- EEEE -------
*** G4Exception : GeomNav0002
      issued by : G4PathFinder::PrepareNewTrack()
Too many active Navigators / worlds.
        Transportation Manager has 17 active navigators.
        This is more than the number allowed = 16 !
*** Fatal Exception *** core dump ***
G4WT2 > G4Track (0x7f9ab06abe20) - track ID = 1, parent ID = 0
G4WT2 >  Particle type : e- - creator process : not available
G4WT2 >  Kinetic energy : 1 GeV - Momentum direction : (0,0,1)
G4WT2 >  Step length : 0 fm  - total energy deposit : 0 eV 
G4WT2 >  Pre-step point : (0,0,-1010) - Physical volume : World (G4_AIR)
G4WT2 >  - defined by : not available
G4WT2 >  Post-step point : (0,0,-1010) - Physical volume : World (G4_AIR)
G4WT2 >  - defined by : not available
G4WT2 >  *** Note: Step information might not be properly updated.
G4WT2 > 
-------- EEEE -------- G4Exception-END --------- EEEE -------

Instead of posting our program code here I reproduced the issue in one of Geant4 examples. Namely, /extended/runAndEvent/RE03. Example takes advantage of a maximum of 3 scoring meshes. However, if we define more that 16 scoring meshes in the macro file the executable throws same exception.

I attach the modified macro file here:
run_my.txt (5.9 KB)

To reproduce the error please compile the above example and run RE03 run_my.txt

My questions are following:

  • Is having a maximum of 16 scoring meshes is intended or is a Geant4 bug?
  • If behavior is buggy can anyone suggest a workaround?

Issue reproduced on: Geant 4.10.07.p01, gcc 10.3.1, Fedora 33. Geant 4.10.06.p02, gcc 9.2.0, CentOS 7.7

P.S.: exception is fired from file G4PathFinder.cc:367. I tried to debug this issue but the IDE is not hitting my breakpoints - probably because G4TransportationManager has an inline definition file .icc.