Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |  

This web mail archive is frozen.

This page is part of a frozen web archive of this mailing list.

You can still navigate around this archive, but know that no new mails have been added to it since July of 2016.

Click here to be taken to the new web archives of this list; it includes all the mails that are in this frozen archive plus all new mails that have been sent to the list since it was migrated to the new archives.

From: Andreas Schäfer (gentryx_at_[hidden])
Date: 2006-11-12 21:00:32


Hi,

one of our projects recently exposed severe memory leakage when using
ROMIO to write a complex derived datatype (a struct made of other
structs) to a file. From our code we distilled the attached short
program to reproduce the leak.

After some Valgrind sessions, it appears as if the memcpy in
ompi_ddt_duplicate() is a bit overhasty, as it does copy the old
type's reference counter, too.

I don't know if this is the right way to fix it, but if I apply the
patch below to ompi the leak is fixed.

Cheers!
-Andreas

diff -ru openmpi-1.1.1/ompi/datatype/dt_create_dup.c
openmpi-1.1.1-fixed/ompi/datatype/dt_create_dup.c
--- openmpi-1.1.1/ompi/datatype/dt_create_dup.c 2006-06-14
21:56:41.000000000 +0200
+++ openmpi-1.1.1-fixed/ompi/datatype/dt_create_dup.c 2006-11-13
00:35:03.000000000 +0100
@@ -33,6 +33,7 @@
     int32_t old_index = pdt->d_f_to_c_index;

     memcpy( pdt, oldType, sizeof(ompi_datatype_t) );
+ ((opal_object_t *)pdt)->obj_reference_count = 1;
     pdt->desc.desc = temp;
     pdt->flags &= (~DT_FLAG_PREDEFINED);
     /* ompi_ddt_create() creates a new f_to_c index that was saved





  • application/pgp-signature attachment: stored