I just updated to 4.9.2 from 4.9.2.b01. A macro that runs fine on 4.9.2.b01 is now giving me a segmentation violation during the early phase of beamOn. I'm pasting the gdb stack trace below. It shows that the G4ProcessManager* "pm" accessed in G4LossTableManager.cc:363 is NULL. Examining the other key variables in the surrounding code, I find that "el" and "p" have name "hIoni", and the particle is a B+. After reading the Release Notes, including the "Items for migration of the user code" and the "Detailed list of changes and fixes", I couldn't find a mistake on my part. In fact, every instance of G4hIonization in my code is accompanied by a call to G4ProcessManager::AddProcess(process), which calls process->SetProcessManager(this). So it seems to me to be a bug that "pm" is NULL. Just to check, I tried running example N02, which uses hIoni in a similar way as my code. I again got the same segfault. This time gdb reported a very strange value for pm: 0xffffffff. So checking for NULL would not have helped here. Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_PROTECTION_FAILURE at address: 0x00000024 0x03ec118d in G4ProcessManager::GetProcessIndex (this=0x0, aProcess=0x98acc00) at G4ProcessManager.icc:58 58 G4int idx = theProcessList->index(aProcess); (gdb) where #0 0x03ec118d in G4ProcessManager::GetProcessIndex (this=0x0, aProcess=0x98acc00) at G4ProcessManager.icc:58 #1 0x03ebc4d8 in G4ProcessManager::GetProcessActivation (this=0x0, aProcess=0x98acc00) at src/G4ProcessManager.cc:1073 #2 0x03fb69ac in G4LossTableManager::EnergyLossProcessIsInitialised (this=0x576a6c0, particle=0x935b560, p=0x9883000) at src/G4LossTableManager.cc:363 #3 0x03fcafa6 in G4VEnergyLossProcess::PreparePhysicsTable (this=0x9883000, part=@0x935b560) at src/G4VEnergyLossProcess.cc:431 #4 0x03c06b3b in G4VUserPhysicsList::PreparePhysicsTable (this=0x93510f4, particle=0x935b560) at src/G4VUserPhysicsList.cc:513 #5 0x03c07c5b in G4VUserPhysicsList::BuildPhysicsTable (this=0x93510f4) at src/G4VUserPhysicsList.cc:396 #6 0x03bfa024 in G4RunManagerKernel::BuildPhysicsTables (this=0x933d210) at src/G4RunManagerKernel.cc:371 #7 0x03bfa3f6 in G4RunManagerKernel::RunInitialization (this=0x933d210) at src/G4RunManagerKernel.cc:313 #8 0x03bf62b1 in G4RunManager::RunInitialization (this=0x933d400) at src/G4RunManager.cc:179 #9 0x03bf49b3 in G4RunManager::BeamOn (this=0x933d400, n_event=100000, macroFile=0x0, n_select=-1) at src/G4RunManager.cc:139 #10 0x03bfc9ce in G4RunMessenger::SetNewValue (this=0x93470b0, command=0x9347330, newValue=@0xbfffd668) at src/G4RunMessenger.cc:288 #11 0x081575a1 in G4UIcommand::DoIt (this=0x9347330, parameterList=@0xbfffd71c) at src/G4UIcommand.cc:210 #12 0x081652de in G4UImanager::ApplyCommand (this=0x982a000, aCmd=0x948d7ac "/run/beamOn 100000") at src/G4UImanager.cc:410 #13 0x0816541c in G4UImanager::ApplyCommand (this=0x982a000, aCmd=@0xbfffd790) at src/G4UImanager.cc:354 #14 0x0814b2da in G4UIbatch::ExecCommand (this=0x9879600, command=@0xbfffd7d8) at src/G4UIbatch.cc:167 #15 0x0814bd93 in G4UIbatch::SessionStart (this=0x9879600) at src/G4UIbatch.cc:212 #16 0x081622f7 in G4UImanager::ExecuteMacroFile (this=0x982a000, fileName=0x941f21c "SPPC.mac") at src/G4UImanager.cc:222 #17 0x0815f169 in G4UIcontrolMessenger::SetNewValue (this=0x932f110, command=0x932f290, newValue=@0xbfffd978) at src/G4UIcontrolMessenger.cc:183 #18 0x081575a1 in G4UIcommand::DoIt (this=0x932f290, parameterList=@0xbfffda2c) at src/G4UIcommand.cc:210 #19 0x081652de in G4UImanager::ApplyCommand (this=0x982a000, aCmd=0x941f15c "/control/execute SPPC.mac") at src/G4UImanager.cc:410 #20 0x0816541c in G4UImanager::ApplyCommand (this=0x982a000, aCmd=@0xbfffdaf0) at src/G4UImanager.cc:354 #21 0x000043a6 in main (argc=2, argv=0xbfffdb70) at MaGe.cc:187
Hello, If N02 does not work, then you need to check your installation of the new Geant4 version. When one migrates to 9.2 from 9.2beta it is needed to take the code from the distribution and to recompile Geant4 from scratch - previous libraries must be removed. Example N02 used to run at all G4 supported platforms as many other tests and if any bug in any test is observed Geant4 is not released. VI
Although I did compile from scratch the first time, it does seem that something was wrong with my install. I recompiled again (more carefully this time) and indeed example N02 now runs properly. Thank you for your help and sorry for the false alarm.