Problem 2035 - Segfault when deleting G4DormandPrinceRK78
Summary: Segfault when deleting G4DormandPrinceRK78
Status: RESOLVED WONTFIX
Alias: None
Product: Geant4
Classification: Unclassified
Component: geometry/magneticfield (show other problems)
Version: 10.3
Hardware: All All
: P4 minor
Assignee: John Apostolakis
URL:
Depends on:
Blocks:
 
Reported: 2018-02-15 15:27 CET by Laurie Nevay
Modified: 2018-03-05 08:05 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Laurie Nevay 2018-02-15 15:27:12 CET
I get a segfault when I delete an instance of G4DormandPrinceRK78 compiled with GCC4.9 on SLC6, however not on mac with Clang 8.  If I look in the source code for G4DormandPrinceRK78.cc, fAuxStepper is uninitialised for the daughter instance of itself.  

There is the code:

if( primary )
    {
        fAuxStepper = new G4DormandPrinceRK78(EqRhs, numberOfVariables,
                                            !primary);
    }

If it's not the primary though, this is left uninitialised. The deletion of this is I believe the cause of the segfault.  It's definitely due to deleting this object and I use a variety of integrators without problem.  If I look in G4DormandPrinceRK56.cc, fAuxStepper is initialised to 0 (could be nullptr).  Similarly for G4DormandPrince745, it's initialised.  Even if I don't delete, Geant4 does and causes a problem at exit.

This is fixed in Geant4.10.0 but this version is unusable for me because the constructor for G4ExtrudedSolid is broken.

Please can this be fixed for the next patch of Geant4.10.3.p0X.

Many thanks,
Laurie
Comment 1 Gabriele Cosmo 2018-03-05 08:05:42 CET
G4DormandPrince* steppers introduced in relese 10.3 are to be considered experimental.
We suggest you to upgrade to the latest version 10.4, where several improvements have
been introduced to these classes and one of the steppers of this family,
G4DormandPrince457, is now also set as the default.