Problem 951

Summary: Segfault Bug G4RunManager::StackPreviousEvent
Product: Geant4 Reporter: robert.a.weller
Component: runAssignee: asai
Status: RESOLVED FIXED    
Severity: critical CC: asai
Priority: P5    
Version: 8.3   
Hardware: All   
OS: All   

Description robert.a.weller 2007-06-20 18:41:24 CEST
In the last line of the subject function the evt pointer is dereferenced without checking that it can be null. In fact it is null until the previousEvents vector gets full.
This code fixes the problem:
if(evt && !(evt->ToBeKept())) delete evt;
It replaces the last line of the function as it appears in Geant4.8.3.

In the absence of this fix, setting the number of events to be saved and running events produces a seg fault when evt->ToBeKept tries to do 0->ToBeKept.

Regards to all from Bob and Marcus.
Comment 1 asai 2007-06-20 19:12:24 CEST
Thanks Bob and Marcus for reporting this.
The fix is now committed to CVS and to be
included in the coming release.

Makoto