Problem 337 - Segmentation fault when using G4NeutronHPElastic process
Summary: Segmentation fault when using G4NeutronHPElastic process
Status: CLOSED WORKSFORME
Alias: None
Product: Geant4
Classification: Unclassified
Component: processes/hadronic/models (show other problems)
Version: 4.0
Hardware: PC Linux
: P1 critical
Assignee: Hans-Peter.Wellisch
URL:
Depends on:
Blocks:
 
Reported: 2002-01-05 06:03 CET by joa
Modified: 2004-06-19 16:43 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 joa 2002-01-05 06:03:11 CET
Uppgrading from Geant4.3.2 to Geant4.4.0 caused problems with G4NeutronHPElastic
process. Since I'm simulating neutrons with E<20MeV this is some what of a
problem. Without G4NeutronHPElastic it works well (tried in two different
programs with only the physics in common). The part of PhysList that causes
problems look like

 theParticleIterator -> reset();
  while((*theParticleIterator)())
    {
      G4ParticleDefinition* particle = theParticleIterator -> value();
      G4ProcessManager* pmanager = particle -> GetProcessManager();
      G4String particleName = particle -> GetParticleName();
      if(particleName == "neutron")
        {
          //Construct elastic processes for neutrons
          G4HadronElasticProcess
	  *theNeutronElasticProcess = new G4HadronElasticProcess();
	  //Without G4NeutronHPElastic it works!!
	  G4NeutronHPElastic
          *aLENeutronElasticProcess = new G4NeutronHPElastic();
          theNeutronElasticProcess -> RegisterMe(aLENeutronElasticProcess);
          //Add elastic process
          pmanager -> AddDiscreteProcess(theNeutronElasticProcess);
          //Construct inelastic process for neutrons
	  G4NeutronInelasticProcess
          *theNeutronInelasticProcess = new G4NeutronInelasticProcess();
          //aLENeutronInelasticProcess = new G4NeutronHPInelastic();
	  G4LENeutronInelastic
          *aLENeutronInelasticProcess = new G4LENeutronInelastic();
          theNeutronInelasticProcess -> RegisterMe(aLENeutronInelasticProcess);
          //Add inelastic process
          pmanager -> AddDiscreteProcess(theNeutronInelasticProcess);
	  //Add capture
	  G4HadronCaptureProcess  *theNeutronCapture =
	    new G4HadronCaptureProcess();
	  G4LCapture *NeutronCapture = new G4LCapture();
	  theNeutronCapture -> RegisterMe(NeutronCapture);
	  pmanager->AddDiscreteProcess(theNeutronCapture);

        }

Running it through a debugger...
(gdb) run
Starting program: /home/joa/geant4.4.0/bin/Linux-g++/nordball
[New Thread 1024 (LWP 9057)]
**********************************************

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 9057)]
0x0808e376 in std::basic_ios<char, std::char_traits<char> >::rdstate() const ()
(gdb) s s
Single stepping until exit from function
_ZNKSt9basic_iosIcSt11char_traitsIcEE7rdstateEv,
which has no line number information.

 *** Break *** segmentation violation

Program received signal SIGABRT, Aborted.
0x4265b971 in kill () from /lib/libc.so.6
(gdb)

With a breakpoint on G4NeutronHPElastic::G4NeutronHPElastic() the segmentation
fault comes after that breakpoint (don't know whether it actually is in the
constructor of G4NeutronHPElastic or not). Some indications it might arise in
G4NeutronHPNames but not sure (my debugger claimed it did for a while but then
changed its mind when I rebuilt libG4hadronic_neu.so after having changed and
changed back something in G4NeutronHPNames.
Comment 1 Hans-Peter.Wellisch 2002-01-21 10:06:59 CET
Which data library did you use?

Many greetings,

Hans-Peter.
Comment 2 Hans-Peter.Wellisch 2002-04-23 03:34:59 CEST
I cannot reproduce this. If you still have it with patch-2, please let me know.
Please use G4NDL 3.7.

Many greetings,

Hans-Peter.
Comment 3 Hans-Peter.Wellisch 2002-09-06 02:25:59 CEST
Hi,

  a set of similar problem were traced back to compiler installation problems.
What happens is that there is a inconsistency between the libraries compiled
with the system, and those compiled with the compiler. It typically results in
seg.violations in the stream libraries.

Please make sure you use the recommended configuration on Linux.

Many greetings,

Hans-Peter.
Comment 4 m123m321mjab 2004-06-19 16:43:59 CEST
G4NeutronHPNames: Sorry, this material does not come near to any data