-
- Downloads
Do not stream to std::cout in G4strstreambuf destructor
G4strstreambufs attached to the Geant4's logging streams are generally destructed post main by static destruction. ATLAS identified a case in testing with Geant4 11.2: https://its.cern.ch/jira/browse/SIM-839 that exposes an issue with G4strstreambuf's destructor here. It will stream any remaining characters to std::cout, but this may not exist at this point, resulting in a crash. It is however difficult to reproduce this issue outside of this case. Remove flushing to std::cout inside G4strstreambuf destructor. Explicitly flush G4cout etc ostreams in G4iosFinalization to ensure buffers are cleared. This function is explicitly called in the destructor of G4UImanager, which is destructed by G4RunManagerKernel's destructor. This should ensure clean destruction before static destruction. Also explicitly flush in Sequential mode
Please register or sign in to comment