Problem 944 - G4 crash in G4ExcitationHandler.cc
Summary: G4 crash in G4ExcitationHandler.cc
Status: RESOLVED DUPLICATE of problem 947
Alias: None
Product: Geant4
Classification: Unclassified
Component: processes/hadronic/models/de_excitation (show other problems)
Version: 8.2
Hardware: All All
: P5 critical
Assignee: alexander.howard
URL:
Depends on:
Blocks:
 
Reported: 2007-05-10 06:42 CEST by porosev
Modified: 2007-05-16 18:35 CEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description porosev 2007-05-10 06:42:59 CEST
Hello all!

I have found strange place in G4ExcitationHandler.cc Ln.224 (function G4ExcitationHandler::BreakItUp(const G4Fragment &theInitialState) const)

.. 
 for (j = theResultList.begin(); j != theResultList.end(); j++) 
    {
      if ((*j)->GetA() > 1 && (*j)->GetExcitationEnergy() > 0.1*eV) 
        {
        ....
              // Remove excited fragment from the result 
              delete (*j);
              theResultList.erase(j--); <<<<BUG HAPPENS HERE!!!!!!!!
        ....
        }
     }

Description:
It happens when "theResultList" contains only ONE!!! element. The command delete(*j)
delete this element and after that when you try decrement "j--" in the command "theResultList.erase(j--)", the GEANT4 crash in "--" 

		_Myt_iter operator--(int)
			{	// postdecrement
			_Myt_iter _Tmp = *this;
			--*this;
			return (_Tmp);
                        }

because nothing to iterate!!!!!!

Sincerely Yours,
Viacheslav Porosev
Comment 1 alexander.howard 2007-05-16 18:28:02 CEST

*** This problem has been marked as a duplicate of problem 947 ***
Comment 2 alexander.howard 2007-05-16 18:35:20 CEST
Hi,
This is a duplicate bug as #947, however, could you indicate which platform and compiler you are running with?
Thanks,
Alex