Does anyone have any opinions on this? If not, I'll go implement
option #1.
Len: can we add this to the agenda for tomorrow? It should take <5
minutes to discuss.
Begin forwarded message:
From: "Open MPI" <b...@open-mpi.org>
Date: July 23, 2007 9:13:47 PM EDT
Cc: b...@osl.iu.edu
Subject: [Open MPI] #1101: MPI_ALLOC_MEM with 0 size must be valid
#1101: MPI_ALLOC_MEM with 0 size must be valid
---------------------
+------------------------------------------------------
Reporter: jsquyres | Owner:
Type: defect | Status: new
Priority: minor | Milestone: Open MPI 1.2.4
Version: trunk | Keywords:
---------------------
+------------------------------------------------------
From http://www.open-mpi.org/community/lists/devel/2007/07/1977.php,
Lisandro Dalcin notes that MPI_ALLOC_MEM(0, ...) is a valid call,
but OMPI
returns a warning ("malloc debug: Request for 0 bytes
(base/mpool_base_alloc.c, 194)").
I see two choices for fixing this:
1. Have the MPI_ALLOC_MEM function itself realize that the
request was
for 0 bytes and return a pointer to a global char array of size
1. This
allows the user to dereference the pointer, but not store anything
there.
To match this, MPI_FREE_MEM will have to notice that the base
passed is to
this sentinel array and not actually free it.
1. Do pretty much the same thing as described above but in the
mpool base
(we cannot malloc(0), becuase that's what [sometimes] generates the
warning message).
Personally, I like the former because the lower layers of OMPI should
never be calling mpool_base_alloc(0, ...). Any other comments?
--
Ticket URL: <https://svn.open-mpi.org/trac/ompi/ticket/1101>
Open MPI <http://www.open-mpi.org/>
--
Jeff Squyres
Cisco Systems