Problem 2586

Summary: Setting a neutron absorber with a Z > 92 and using EmStandardPhysics_option3 produces a segfault.
Product: Examples/Extended Reporter: txenglish
Component: hadronic/NeutronSourceAssignee: Vladimir.Ivantchenko
Status: RESOLVED FIXED    
Severity: normal CC: Alberto.Ribon, michel.maire
Priority: P4    
Version: 11.2   
Hardware: PC   
OS: Linux   
Attachments: gdb backtrace of segfault

Description txenglish 2024-01-19 18:52:35 CET
Created attachment 847 [details]
gdb backtrace of segfault

When running the NeutronSource example, after making a modification of the neutron absorber and changing the EM Physics List, the simulation runs into a segfault. The resulting gdb backtrace can be seen in the attached photo.

To reproduce the segfault:

Change the neutron absorber to AmBe (Needs to be some neutron absorber with a Z > 92 but needs more than 1 element). 

Change EM Physics list to G4EmStandardPhysics_option3

Compile the build and run:
./NeutronSource run1.mac

Given the information in the backtrace, it seems that the dE/dx information for Z materials greater than 92 are not loaded. But if you run just G4_Am the segfault is not produced meaning that G4IonICRU73Data::ReadElementData is missing an error checking step for a nullptr return. 

We believe that the following changes to G4IonICRU73Data.hh should fix the dE/dx issues:

Change "const G4Int ZTARGMAX=92;" to "const G4Int ZTARGMAX=98;"

And change “G4PhysicsLogVector* fElmData[81][93] = {{nullptr}};” to “G4PhysicsLogVector* fElmData[81][99] = {{nullptr}};”
Comment 1 Vladimir.Ivantchenko 2024-01-23 19:02:21 CET
Hello,

Thank you very much for this report! It is a real bug and the fix is under Geant4 testing. It will be available with the 1st patch to Geant4 11.2. This problem was not in the same form in previous G4 versions.

The fix is different from your proposal, because your proposal would likely work   for AmBe but not for all possible cases.

VI
Comment 2 Vladimir.Ivantchenko 2024-04-17 13:03:22 CEST
Hello,

is the problem fixed for you with the new version Geant4 11.2.1?

VI
Comment 3 Vladimir.Ivantchenko 2024-04-26 23:32:49 CEST
Hello,

the bug is fixed and is available in Geant4 11.2.1 and will be available in 11.3beta.

VI