Problem 1648 - QGSP_BERT (and other?) destructors derference tpdata without checking for null pointer
Summary: QGSP_BERT (and other?) destructors derference tpdata without checking for nul...
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: physics_lists (show other problems)
Version: 10.0
Hardware: All All
: P5 trivial
Assignee: Andrea Dotti
URL:
Depends on:
Blocks:
 
Reported: 2014-06-29 08:28 CEST by Michael Kelsey
Modified: 2014-07-01 23:25 CEST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Michael Kelsey 2014-06-29 08:28:12 CEST
If an application exits from the PreInit state, the QGSP_BERT physics list causes a segfault because the G4HadronPhysicsQGSP_BERT dtor include deletion of model pointers contained in a "tpdata" object which has not yet been instantiated.  The dtor should test for (tpdata != 0) before deleting its contents.

NOTE:  I have fixed this problem in the hadron_inelastic/ physics constructors at the HEAD of the SVN repository.  Other constructors may have analogous issues with different object names.
Comment 1 Andrea Dotti 2014-07-01 23:25:08 CEST
Mike introduced fix. Verified that same strategy is not used in other constructors. 
Tag phys-ctor-hinelastic-V10-00-03 created.