[Trilinos-Users] EpetraExt_HDF5: segfault when object is distroyed after MPI_finalize

Simone Deparis simone.deparis at epfl.ch
Wed Aug 10 02:20:08 MDT 2011

Dear users,

There is a potential bug in EpetraExt_HDF5:

Symptoms: After MPI_finalize the execution aborts.

Reason: The destructor of EpetraExt_HDF5 makes a MPI call through the
method Close(). Therefore if you call MPI_finalize before the
EpetraExt_HDF5 is destroyed you have a segfault.

More details:
The class EpetraExt_HDF5 keeps a reference to the Epetra_Comm used to
construct the object. This Epetra_Comm is used in the Close() method
through calls to HDF5.
Therefore, when the original Epetra_Comm is destroyed, the reference in
EpetraExt_HDF5 is invalid. If the Close() method is called afterwards a
segfault is generated.

Cure: The Close method is called by the destructor only if the HDF5 is
not yet been closed. Therefore make sure that you call Close() or
destroy the EpetraExt_HDF5 before the original Epetra_Comm is destroyed
(in particular before MPI_finalize).

Best regards

                                     Simone Deparis, Dr.es Sc.
   .~.                               CMCS - MATHICSE
   /V\   L   I   N   U   X           SB - EPFL
  // \\  =================           CH - 1015 Lausanne
 /(   )\ L   I   F   E   V           Switzerland
 phone :  +41 -21 693 2547           mailto:Simone.Deparis at epfl.ch
 fax   :  +41 -21 693 2545           http://mathicse.epfl.ch/~deparis

More information about the Trilinos-Users mailing list