Problem 524 - Segmentation fault in retriving isotope information using neutron HP model
Summary: Segmentation fault in retriving isotope information using neutron HP model
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: processes/hadronic/models (show other problems)
Version: 5.2
Hardware: PC Linux
: P2 normal
Assignee: Hans-Peter.Wellisch
URL:
Depends on:
Blocks:
 
Reported: 2003-08-25 06:52 CEST by alex
Modified: 2004-04-16 05:03 CEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description alex 2003-08-25 06:52:46 CEST
Hi,

 I already posted this error in the user forum (#114 in the hadronic section)
and Hans-Peter advised me to place it here. So I'll just copy my report there:

" I'm trying to get information about the target isotope in a low energy
inelastic scattering using the neutron HP model.
 For that I cast the pointer to the process as a G4HadronicProcess pointer
and then I create a pointer to the G4IsoParticleChange using the
GetIsotopeProductionInfo(). This is done in my sensitive volume when I
analyse the secondaries created by the hit (I have a pointer to the
TrackingManager in my UserTrackInformation).
 It works fine, and I can access the info on the Z and N that I'm
interested in. The problem is that I get a segmentation fault a few tracks
after... Or a few events after... it depends if I create the pointer to
G4IsoParticleChange inside or outside the secondaries analysis. But
anyways, I allways get a segmentation fault if I create the pointer...
 I think this is a memory management problem, but I don't know
how to solve it...
 Thanks in advance

 Alex

P.S.: I'm using Geant4.5.2 and G4NDL3.7 "

Hans-Peter sugested it might be a problem of me deleting the pointer to the
object, but that is not the case...

 Thanks in advance. Best regards

 Alex
Comment 1 Hans-Peter.Wellisch 2003-09-16 07:23:59 CEST
Hi, I finally managed to get the code to link, and tried running. I reproduce
the problem in so far, as there is an exception thrown. Unfortunately, in my
case, this happens independent of the retrieval of isotope production info.

To make the case worse, it also crashes, when just running the geometry check UI
command:
Idle> /geometry/test/run
Abort

I am somewhat at a loss in this. Forward to Gabriele, who may be better able to
help.

Many greetings,

Hans-Peter.
Comment 2 Gabriele Cosmo 2003-09-16 09:14:59 CEST
Where can I find the code ?
It doesn't really look related to geometry .....
Comment 3 alex 2003-09-16 11:32:59 CEST
Hi,

Hans-Peter is right. I also tried to run /geometry/test/run and got an Abort.
But except for that and the segmentation fault that I described in my mail,
everything seems to work fine... And it doesn't crash if I remove the lines in
wich I create create the G4Nucleus object for the isotope information...
(lines 132-137 of neutraoSensitiveXenon.cc). You can find the code at
www-lip.fis.uc.pt/~alex/geant4

Best regards

Alex
Comment 4 Gabriele Cosmo 2003-09-18 09:09:59 CEST
The geometry test check crashes due to a logic error in a special case where
the test-line is coincident with the inner surface of a sphere shell (good
test case!). This problem will be fixed soon in the geometry-verification tool.
However, tracking is correct and the user's geometry appears correctly defined.
The problem reported though seems specific to hadronic physics, in particular,
the crash is originated from G4NeutronHPElasticFS::ApplyYourself() when looking
for a ion in the G4IonTable and in the dynamic creation of a new one. As such,
I hand this over again to Hans-Peter.
Comment 5 Hans-Peter.Wellisch 2004-04-16 05:03:59 CEST
This one came yup elsewhere as well, and I managed to trace it there.
the fix is included in geant4 6.1.

Many greetings,

Hans-Peter.