| Summary: | GHAD segmentation fault with high energy neutrons (~950 MeV) | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | mmarino |
| Component: | processes/hadronic/models/neutron_hp | Assignee: | tkoi |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | dennis.herbert.wright |
| Priority: | P2 | ||
| Version: | 7.1 | ||
| Hardware: | All | ||
| OS: | Linux | ||
|
Description
mmarino
2005-11-11 01:48:07 CET
I have run the program (compiling with symbols) with valgrind and have seen the following message: ==28972== ==28972== Invalid read of size 4 ==28972== at 0x843B8A3: G4ParticleDefinition::GetPDGMass() const (/auto/common/majorana/simu/geant4.7.1.p01/include/G4ParticleDefinition.hh:111) ==28972== by 0x8594E81: G4NeutronHPContAngularPar::Sample(double, double, double, int, int) (G4NeutronHPContAngularPar.cc:95) ==28972== by 0x858ECB3: G4NeutronHPContEnergyAngular::Sample(double, double, double) (G4NeutronHPContEnergyAngular.cc:61) ==28972== by 0x859454B: G4NeutronHPProduct::Sample(double) (G4NeutronHPProduct.cc:47) ==28972== Address 0x10 is not stack'd, malloc'd or free'd Perhaps a read error from a data file? I have created a standalone geant4 program and have found a seed which will
reproduce the error. The error I receive this time:
GHAD_GHAD_GHAD_GHAD_GHAD_GHAD_GHAD_GHAD_GHAD_GHAD_GHAD_GHAD_GHAD_GHAD
Dumping the registered hadronic state information
Nucleus A, Z = 56 26
Projectile was a neutron
projectile momentum (px, py, pz) = (0, 0, 193.904)
Projectile energy = 959.366
GHAD_GHAD_GHAD_GHAD_GHAD_GHAD_GHAD_GHAD_GHAD_GHAD_GHAD_GHAD_GHAD_GHAD
I have some more debugging information garnered from gdb, which is slightly more
useful as it has the value of data members making the error more transparent:
[Switching to Thread 4135344352 (LWP 7106)]
0x082054e2 in G4ParticleDefinition::GetPDGMass (this=0x0) at
G4ParticleDefinition.hh:111
111 G4ParticleDefinition.hh: No such file or directory.
in G4ParticleDefinition.hh
(gdb) where
#0 0x082054e2 in G4ParticleDefinition::GetPDGMass (this=0x0) at
G4ParticleDefinition.hh:111
#1 0x08591f25 in G4ReactionProduct::SetDefinition (this=0xadeb830,
aParticleDefinition=0x0) at src/G4ReactionProduct.cc:154
#2 0x082812a7 in G4NeutronHPContAngularPar::Sample (this=0xa2e4ccc,
anEnergy=19.799897131918897, massCode=27026, angularRep=1)
at src/G4NeutronHPContAngularPar.cc:95
#3 0x0827b37e in G4NeutronHPContEnergyAngular::Sample (this=0xa2d3f48,
anEnergy=19.799897131918897, massCode=27026) at
src/G4NeutronHPContEnergyAngular.cc:61
#4 0x08280977 in G4NeutronHPProduct::Sample (this=0xa2d3a94,
anEnergy=19.799897131918897) at src/G4NeutronHPProduct.cc:47
#5 0x0827efae in G4NeutronHPEnAngCorrelation::Sample (this=0xa2d3800,
anEnergy=19.799897131918897) at src/G4NeutronHPEnAngCorrelation.cc:90
#6 0x0826cea8 in G4NeutronHPInelasticBaseFS::BaseApply (this=0xa2b8108,
theTrack=@0xffffc910, theDefs=0xffffc670, nDef=2) at
src/G4NeutronHPInelasticBaseFS.cc:226
#7 0x08250c53 in G4NeutronHPNPInelasticFS::ApplyYourself (this=0xa2b8108,
theTrack=@0xffffc910) at src/G4NeutronHPNPInelasticFS.cc:40
#8 0x082346cc in G4NeutronHPChannel::ApplyYourself (this=0xa2ad8d0,
theTrack=@0xffffc910, anIsotope=3) at src/G4NeutronHPChannel.cc:188
#9 0x08264881 in G4NeutronHPChannelList::ApplyYourself (this=0x991c8c4,
aTrack=@0xffffc910) at src/G4NeutronHPChannelList.cc:124
#10 0x08246da8 in G4NeutronHPInelastic::ApplyYourself (this=0x998a328,
aTrack=@0xffffc910) at src/G4NeutronHPInelastic.cc:140
#11 0x0828fc29 in G4HadronicInteractionWrapper::ApplyInteraction
(this=0xffffc90b, thePro=@0xffffc910, targetNucleus=@0x95b0950,
theInteraction=0x998a328)
at src/G4HadronicInteractionWrapper.cc:33
#12 0x08287f40 in G4HadronicProcess::GeneralPostStepDoIt (this=0x95b06c0,
aTrack=@0xade1ef0) at src/G4HadronicProcess.cc:394
#13 0x0828d559 in G4HadronInelasticProcess::PostStepDoIt (this=0x95b06c0,
aTrack=@0xade1ef0, aStep=@0x9599ab0) at src/G4HadronInelasticProcess.cc:77
#14 0x085d5bab in G4SteppingManager::InvokePSDIP (this=0x95999a0, np=2) at
src/G4SteppingManager2.cc:465
#15 0x085d5adc in G4SteppingManager::InvokePostStepDoItProcs (this=0x95999a0) at
src/G4SteppingManager2.cc:442
#16 0x085d7aed in G4SteppingManager::Stepping (this=0x95999a0) at
src/G4SteppingManager.cc:196
#17 0x085caea4 in G4TrackingManager::ProcessOneTrack (this=0x9599978,
apValueG4Track=0xade1ef0) at src/G4TrackingManager.cc:118
#18 0x085bbef3 in G4EventManager::DoProcessing (this=0x9599938,
anEvent=0xade0f10) at src/G4EventManager.cc:174
#19 0x085bc57a in G4EventManager::ProcessOneEvent (this=0x9599938,
anEvent=0xade0f10) at src/G4EventManager.cc:324
#20 0x0859782b in G4RunManager::DoEventLoop (this=0x9599870, n_event=10000,
macroFile=0x0, n_select=-1) at src/G4RunManager.cc:219
#21 0x08597305 in G4RunManager::BeamOn (this=0x9599870, n_event=10000,
macroFile=0x0, n_select=-1) at src/G4RunManager.cc:128
#22 0x0859d2ca in G4RunMessenger::SetNewValue (this=0x95a6a78,
command=0x95a6dd0, newValue=
{<std::basic_string<char,std::char_traits<char>,std::allocator<char> >> =
{static npos = 4294967295, _M_dataplus = {<std::allocator<char>> =
{<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p
= 0xad2287c "10000 ***NULL*** -1"}}, _vptr.G4String = 0x874d980}) at
src/G4RunMessenger.cc:248
#23 0x08720b56 in G4UIcommand::DoIt (this=0x95a6dd0, parameterList=
{<std::basic_string<char,std::char_traits<char>,std::allocator<char> >> =
{static npos = 4294967295, _M_dataplus = {<std::allocator<char>> =
{<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p
= 0xacf92dc "10000"}}, _vptr.G4String = 0x874d980}) at src/G4UIcommand.cc:206
#24 0x08728f8e in G4UImanager::ApplyCommand (this=0x9599f00, aCmd=0x874c870
"/run/beamOn 10000") at src/G4UImanager.cc:397
#25 0x081ff5be in main () at SLACBD.cc:63
Digging slightly deeper:
#2 0x082812a7 in G4NeutronHPContAngularPar::Sample (this=0xa2e4ccc,
anEnergy=19.799897131918897, massCode=27026, angularRep=1)
at src/G4NeutronHPContAngularPar.cc:95
95
result->SetDefinition(G4ParticleTable::GetParticleTable()->FindIon(Z,A,0,Z));
with A = 26, Z = 27. (values read out from gdb)
It looks as though the ParticleTable is unable to find the appropriate ion and
passes a NULL value which causes the Seg fault.
My standalone program essentially shoots neutrons of 19.8 Mev energy at steel
(which is mostly Iron (7/10) with a slight amount of Nickel (2/10) and Chromium
(1/10)). I am using basically the QGSP_HP Hadronic Physics List. I would be
happy to send the program along if that would be helpful. It usually takes
roughly 1000 events (< 5 minutes on an x86 ~2GHz) to find a seed which will
reproduce the error. Please feel free to email me.
I have done some more digging, and have found that the massCode (=27026) which generates the erroneous Z and A( < Z!) values comes from the directory /path/to/G4NDL3.7/Inelastic/F10. Grepping the directory for 27026 the file 28_62_Nickel comes up. I checked the file and values adjacent to this value correspond to the values that I can find (using gdb) which were read in to from a database file. I subsequently removed Nickel from my msterial (Steel) in the simulation, and this completely removed the GHAD problem. I ran 100 different processes (with different seeds of course) with 10000 events and found no GHAD errors. Previously, I expected ~20 errors (20 failures) when running that many processes. I imagine a new bug report should be opened for the database file: G4NDL3.7/Inelastic/F10/28_62_Nickel with special note to look for massCode 27026. This problems perhaps no longer applies, but was assigned to the wrong responsible. Assigning it to the responsible for the Neutron code for verification ... I just checked this problem by 1 GeV neutrons bombarding Iron slab. The problem does not happen with ~16k incidence neutrons. Therefore I changed status of this entry to “RESOLVED-FIXED”. The version of Geanrt4 which I checked is v9.3.p01 Tatsumi |