Problem 752

Summary: modify the code will lead to segmentation fault
Product: Examples/Basic and Novice Reporter: enrico
Component: N01Assignee: Makoto.Asai
Status: RESOLVED INVALID    
Severity: normal CC: asai
Priority: P2    
Version: other   
Hardware: Other   
OS: Linux   

Description enrico 2005-06-12 19:04:06 CEST
environment: geant4 4.7.0.p01
OS Scientific Linux 4
problem:
change the particle "geantino" to other particle(ex. proton)
-----------
ExN01PrimaryGeneratorAction.cc: line 43
particleGun->SetParticleDefinition(particleTable->FindParticle(particleName="proton"));
ExN01PhysicsList.cc:  line 46
G4Proton::ProtonDefinition();

-----------

after recompile, the new executable will lead to segementation fault
after first-time core dump, program recompiled with the original
source(geantino) will always lead to segmentation fault.
the problem is found on the same environment on different machines.
but there is no problem doing such modification on FreeBSD system.
Comment 1 asai 2005-06-13 09:18:59 CEST
The physics list of exampleN01 has only geantino and its transportation
process. You cannot shoot other particle unless you modify the physics list.
Comment 2 enrico 2005-06-14 03:31:59 CEST
ExN01PrimaryGeneratorAction.cc: line 43
particleGun->SetParticleDefinition(particleTable->FindParticle(particleName="proton"));
ExN01PhysicsList.cc:  line 46
G4Proton::ProtonDefinition();

in fact i have changed the particle in physicslist and particle gun
this modification will lead segmentation fault under SL4.