| Summary: | Bug in G4EmCorrections::InitialiseMaterial(const G4Material* mat) | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | porosev |
| Component: | processes/hadronic/processes | Assignee: | Vladimir.Ivantchenko |
| Status: | RESOLVED FIXED | ||
| Severity: | critical | CC: | Vladimir.Ivantchenko |
| Priority: | P5 | ||
| Version: | 8.2 | ||
| Hardware: | All | ||
| OS: | All | ||
Please, reproduce the bug using $G4INSTALL/example/extended/electromagnetic/TestEm7 There is a standrad macro TestEm7.in, also proton.mac These macros are regulary executed and bug does not show up. Hello, Thank you for poining to the bug. Your analysis was correct. It is fixed and submitted for testing. Fixed version will be available in Geant4 9.0. |
Hello all! I studed simple example.. 100MeV proton hit to cube made from G4_WATER... as the result G4 crashed :))) in "v->PutValue(i, dedx/dedx1)" in g4emcorrections.cc Ln. 758 G4PhysicsVector* G4EmCorrections::InitialiseMaterial(const G4Material* mat) { ... size_t nbins = v->GetVectorLength(); ... for(size_t i=0; i<nbins; i++) { ... v->PutValue(i, dedx/dedx1); ... } } return v; } the fuction "PutValue" is called with parameter "i" equals to "22"... but "v" array has a length "23" only and G4 crash when it try to write "dataVector[binNumber+1] = theValue" element behind last element in: inline void G4PhysicsVector::PutValue(size_t binNumber, G4double theValue) { dataVector[binNumber] = theValue; // Fill the bin which is hidden to user with theValue. This is to // handle correctly when Energy=theEmax in getValue. if(binNumber==numberOfBin-1) { dataVector[binNumber+1] = theValue; } } Please fix this strange place!!!! Sincerely Yours, Viacheslav Porosev