Problem 752 - modify the code will lead to segmentation fault
Summary: modify the code will lead to segmentation fault
Status: RESOLVED INVALID
Alias: None
Product: Examples/Basic and Novice
Classification: Unclassified
Component: N01 (show other problems)
Version: other
Hardware: Other Linux
: P2 normal
Assignee: Makoto.Asai
URL:
Depends on:
Blocks:
 
Reported: 2005-06-12 19:04 CEST by enrico
Modified: 2007-04-08 18:42 CEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
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.