In 11.2 G4PhotonEvaporation::GenerateGamma changed from having SpinTwo to TwoSpinParity to get the J2 value. The previous version (SpinTwo) would return the absolute value whereas the current version returns the signed value. This then produces a segfault in G4PolarizationTransition::SampleGammaTransition where the J2 value is used to set a vector length. We suggest changing "size_t newlength = fTwoJ2+1" to "size_t newlength = "std::abs(fTwoJ2)+1" to resolve that issue. Or setting the absolute value in G4PhotonEvaporation::GenerateGamma. Also, we are unsure if other issues are caused by the change as well.
Hello, thank you very much for this report. The second method you proposed is chosen. The fix is under testing and will be available with the 1st patch to 11.2. VI
Hello, I wanted to check back in because I noticed that the fix to this issue was not implemented in the 1st patch of 11.2. Is this being pushed to the next patch instead? -Trent
Hello Trent, please, check 11.2.1 - the fix should there. VI
Hello Vladimir, I did a diff comparison between Geant4/11.2.0 and Geant4/11.2.1 for G4PhotonEvaporation and G4PolarizationTransition respectively and no changes were implemented to those files. Was the fix implemented to a different part of the code? Best, Trent
Hello, Trent, the fix is inside G4PhotonEvaporation.cc, does the crash disappear in Geant4 11.2.1? VI
Hello Vladimir, I tested the simulations again and the problem still persists in Geant4-11.2.1. If I have correlated gammas turned off the simulation runs fine, but when they are turned on then it produces a segfault. You mention that the fix was put into G4PhotonEvaporation.cc, but I don't see any changes between 11.2.0 and 11.2.1. Was the change staged and never pushed into the 11.2.1? Best, Trent
Hi Folks, I'm seeing this as well when building off of master (which looks like a commit ahead of 11.2.1). And I've confirmed that this is because the twoJ1 (and twoJ2) parameters are coming in negative. I don't know the codebase well enough to comment deeply, so I have no doubt that addressing this GenerateGamma is the better fix. But since the twoJ1 and twoJ2 parameters to G4PolarizationTransition are (signed) G4ints, I wonder whether they're just tempting Murphy's law: might it be a good idea to *also* add an abs to the twoJ1 and twoJ2 parameters in G4PolarizationTransition? Cheers, -Isaac