| Summary: | G4NumIntTwoBodyAngDst bug in std::fill call in ctor -- wrong dimension used | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | Sven Menke <menke> |
| Component: | processes/hadronic/models/cascade | Assignee: | Alberto.Ribon |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | P4 | ||
| Version: | 11.0 | ||
| Hardware: | All | ||
| OS: | All | ||
Dear Sven, thank you very much for the suggestion, which has been already integrated in our repository! Cheers, Alberto |
Dear Dennis, Mike, all, there is a bug in line 54 of source/processes/hadronic/models/cascade/cascade/include/G4NumIntTwoBodyAngDst.hh The std::fill call uses the offset nDists to the pointer angDist for setting the workspace initially to 0's. angDist has dimension nAngles not nDists! As far as I can tell currently nDists is always smaller than nAngles (I see nDists of 11 or 15 while nAngles seems to be always 19). So in practice it means that the last few angular bins are not initialized to 0 ... More severe would be if someone instantiates this class with nDists > nAngles. Then you'd get a segv. The fix is easy. Please replace line 54 with: std::fill(angDist, angDist+nAngles, 0.); // Initialize working buffer Thanks, --Sven