| Summary: | Segmentation fault when using G4NeutronHPElastic process | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | joa |
| Component: | processes/hadronic/models | Assignee: | Hans-Peter.Wellisch |
| Status: | CLOSED WORKSFORME | ||
| Severity: | critical | ||
| Priority: | P1 | ||
| Version: | 4.0 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
Which data library did you use? Many greetings, Hans-Peter. 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. 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. G4NeutronHPNames: Sorry, this material does not come near to any data |
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.