Crash launch project with phase space file

Hello, I m a beginner with geant4 and i’ve to work on a project using a PSF. When i launch my project, my geometry appears and there is no problem on this level. But when i want my source of particle, i use this command :
“/run/beamOn 10” and i have a crash from geant4.

Run 0 starts.

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : Run10035
issued by : G4TaskRunManager::InitializeEventLoop()
Event modulo is reduced to 1 (was 3) to distribute events to all threads.
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : Run10035
issued by : G4TaskRunManager::InitializeEventLoop()
Event modulo is reduced to 1 (was 3) to distribute events to all threads.
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

=========================================================================================
→ G4TaskRunManager::CreateAndStartWorkers() → Creating 10 tasks with 1 events/task…

Adding task 0 to task-group…
Adding task 1 to task-group…
Adding task 2 to task-group…
Adding task 3 to task-group…
Adding task 4 to task-group…
Adding task 5 to task-group…
Adding task 6 to task-group…
Adding task 7 to task-group…
Adding task 8 to task-group…
Adding task 9 to task-group…
G4WT6 > ### Run 0 starts on worker thread 6.
G4WT1 > ### Run 0 starts on worker thread 1.
G4WT3 > ### Run 0 starts on worker thread 3.
G4WT2 > ### Run 0 starts on worker thread 2.
G4WT5 > ### Run 0 starts on worker thread 5.
G4WT0 > ### Run 0 starts on worker thread 0.
G4WT7 > ### Run 0 starts on worker thread 7.
G4WT4 > ### Run 0 starts on worker thread 4.
G4WT6 > [thread 6] Thread-local run terminated.
G4WT2 > [thread 2] Thread-local run terminated.
G4WT3 > [thread 3] Thread-local run terminated.
G4WT0 > [thread 0] Thread-local run terminated.
G4WT7 > [thread 7] Thread-local run terminated.
G4WT4 > [thread 4] Thread-local run terminated.
G4WT5 > [thread 5] Thread-local run terminated.
G4WT1 > [thread 1] Thread-local run terminated.
G4WT6 > [thread 6] Run Summary
G4WT6 > [thread 6] Number of events processed : 10
G4WT6 > [thread 6] User=0.380000s Real=0.415320s Sys=0.090000s [Cpu=113.2%]

CAUGHT SIGNAL: 11 ### address: 0x90, signal = SIGSEGV, value = 11, description = segmentation violation. Address not mapped to object.

Backtrace:
[PID=5940, TID=6][ 0/13]> /home/vincent/software/geant4/Geant4-Install/lib/libG4geometry.so(_ZN15G4LogicalVolume7GetMassEbbP10G4Material+0x42) [0x7f0fcb158ae2]
[PID=5940, TID=6][ 1/13]> ./exampleB1(+0x10678) [0x560aa9679678]
[PID=5940, TID=6][ 2/13]> /home/vincent/software/geant4/Geant4-Install/lib/libG4run.so(_ZN12G4RunManager14RunTerminationEv+0x42) [0x7f0fcbb6e492]
[PID=5940, TID=6][ 3/13]> /home/vincent/software/geant4/Geant4-Install/lib/libG4tasking.so(_ZN22G4WorkerTaskRunManager14RunTerminationEv+0x4e) [0x7f0fcbc306ee]
[PID=5940, TID=6][ 4/13]> /home/vincent/software/geant4/Geant4-Install/lib/libG4ptl.so.0(+0x1b543) [0x7f0fcad81543]
[PID=5940, TID=6][ 5/13]> /home/vincent/software/geant4/Geant4-Install/lib/libG4tasking.so(_ZNSt13__future_base13_State_baseV29_M_do_setEPSt8functionIFSt10unique_ptrINS_12_Result_baseENS3_8_DeleterEEvEEPb+0x2d) [0x7f0fcbc216fd]
[PID=5940, TID=6][ 6/13]> /lib/x86_64-linux-gnu/libpthread.so.0(+0x114df) [0x7f0fc780f4df]
[PID=5940, TID=6][ 7/13]> /home/vincent/software/geant4/Geant4-Install/lib/libG4ptl.so.0(+0x194e7) [0x7f0fcad7f4e7]
[PID=5940, TID=6][ 8/13]> /home/vincent/software/geant4/Geant4-Install/lib/libG4ptl.so.0(_ZN3PTL10ThreadPool14execute_threadEPNS_14VUserTaskQueueE+0x351) [0x7f0fcad7b6d1]
[PID=5940, TID=6][ 9/13]> /home/vincent/software/geant4/Geant4-Install/lib/libG4ptl.so.0(_ZN3PTL10ThreadPool12start_threadEPS0_PSt6vectorISt10shared_ptrINS_10ThreadDataEESaIS5_EEl+0x1a3) [0x7f0fcad7be33]
[PID=5940, TID=6][10/13]> /lib/x86_64-linux-gnu/libstdc++.so.6(+0xd6de4) [0x7f0fcac44de4]
[PID=5940, TID=6][11/13]> /lib/x86_64-linux-gnu/libpthread.so.0(+0x8609) [0x7f0fc7806609]
[PID=5940, TID=6][12/13]> /lib/x86_64-linux-gnu/libc.so.6(clone+0x43) [0x7f0fcaa7e133]

: Segmentation fault (Address not mapped to object [0x90])
Aborted (core dumped)

I have no idea where and what is my problem and i don’t know how to find it. Can someone help me ?

Thank you for your attention.

Are you using a messenger?
I cannot provide the solution, but I met a same problem applying detectormessenger on basic B1 example.

I have the same issue with the example code from the summer course.

--------------------End of Global Run----------------------- 
 The run was 100 events 
 * No secondary gammas produced
 * No secondary electrons produced
100 events have been kept for refreshing and/or reviewing.
  "/vis/reviewKeptEvents" to review them one by one.
  "/vis/enable", then "/vis/viewer/flush" or "/vis/viewer/rebuild" to see them accumulated.

G4WT7 > ... merge all H1 - done
G4WT7 > ... merge all H2 - done
G4WT7 > ... merge all H3 - done
G4WT7 > ... merge all P1 - done
G4WT7 > ... merge all P2 - done
G4WT3 > ... merge all H1 - done
G4WT3 > ... merge all H2 - done
G4WT8 > ... merge all H1 - done
G4WT8 > ... merge all H2 - done
G4WT8 > ... merge all H3 - done
G4WT4 > ... merge all H1 - done
G4WT4 > ... merge all H2 - done
G4WT4 > ... merge all H3 - done
G4WT4 > ... merge all P1 - done
G4WT4 > ... merge all P2 - done
G4WT8 > ... merge all P1 - done
G4WT8 > ... merge all P2 - done
G4WT9 > ... merge all H1 - done
G4WT9 > ... merge all H2 - done
G4WT9 > ... merge all H3 - done
G4WT9 > ... merge all P1 - done
G4WT9 > ... merge all P2 - done
G4WT3 > ... merge all H3 - done
G4WT3 > ... merge all P1 - done
G4WT3 > ... merge all P2 - done
G4WT0 > ... merge all H1 - done
G4WT0 > ... merge all H2 - done
G4WT0 > ... merge all H3 - done
G4WT0 > ... merge all P1 - done
G4WT0 > ... merge all P2 - done
G4WT1 > ... merge all H1 - done
G4WT1 > ... merge all H2 - done
G4WT1 > ... merge all H3 - done
G4WT1 > ... merge all P1 - done
G4WT1 > ... merge all P2 - done
G4WT6 > ... merge all H1 - done
G4WT6 > ... merge all H2 - done
G4WT6 > ... merge all H3 - done
G4WT6 > ... merge all P1 - done
G4WT6 > ... merge all P2 - done
G4WT2 > ... merge all H1 - done
G4WT2 > ... merge all H2 - done
G4WT2 > ... merge all H3 - done
G4WT2 > ... merge all P1 - done
G4WT2 > ... merge all P2 - done
G4WT5 > ... merge all H1 - done
G4WT5 > ... merge all H2 - done
G4WT5 > ... merge all H3 - done
G4WT5 > ... merge all P1 - done
G4WT5 > ... merge all P2 - done
Deleting G4ThreadLocalSingletons for type G4GeometryTolerance ...
Deleting G4ThreadLocalSingletons for type G4ProcessTable ...
Deleting G4ThreadLocalSingletons for type G4PhysicsListHelper ...
Deleting G4ThreadLocalSingletons for type G4AccumulableManager ...
Deleting G4ThreadLocalSingletons for type G4CsvAnalysisManager ...

### CAUGHT SIGNAL: 11 ### address: 0xe000000011ac738a,  signal =  SIGSEGV, value =   11, description = segmentation violation. Invalid permissions for mapped object.

Backtrace:
[PID=66301, TID=-1][0/7]> 0   ???                                 0xffff8001025aa638 0x0 + 18446603340555658808
[PID=66301, TID=-1][1/7]> 1   libG4analysis.dylib                 0x00000001025aa544 _ZNSt3__110__function6__funcIZN22G4ThreadLocalSingletonI20G4CsvAnalysisManagerEC1EvEUlvE_NS_9allocatorIS5_EEFvvEEclEv + 100
[PID=66301, TID=-1][2/7]> 2   libG4global.dylib                   0x00000001029f0d5c _ZN22G4ThreadLocalSingletonIvE5ClearEv + 232
[PID=66301, TID=-1][3/7]> 3   libG4tasking.dylib                  0x00000001012a9538 _ZN16G4TaskRunManagerD2Ev + 52
[PID=66301, TID=-1][4/7]> 4   libG4tasking.dylib                  0x00000001012a96e8 _ZN16G4TaskRunManagerD0Ev + 12
[PID=66301, TID=-1][5/7]> 5   task                                0x0000000100aff220 main + 1236
[PID=66301, TID=-1][6/7]> 6   dyld                                0x0000000100b9508c start + 520

zsh: abort      ./task

I can trace the code working up to the EventAction.cc file line:

analysis->FillH1(histogramId, x, energy / keV);

I have tested using multiple threads and a single one, and this has the same issue. Putting a manual entry of 1 in the GetHC instead of a fWaterTankId:

hitMapWaterTank = dynamic_cast<G4THitsMap<G4double>*>(hcofEvent->GetHC(1));

gives a similar error.

I am using a Mac 2020 M1 computer if that helps.

I am experiencing same issue, might be a problem with the multi-treaded RunManager. If instantiated in a single-threaded mode, program works fine:

auto* runManager = G4RunManagerFactory::CreateRunManager(G4RunManagerType::SerialOnly);