diff --git a/NEWS b/NEWS index d8c2c7683b..9f9a56e720 100644 --- a/NEWS +++ b/NEWS @@ -53,6 +53,8 @@ version 1.0. 1.0.3 ----- +- Fixed segmentation fault with 64 bit applications on Solaris when + using the shared memory transports. - Fixed MPI_COMM_SELF attributes to free properly at the beginning of MPI_FINALIZE. Thanks to Martin Audet for bringing this to our attention. diff --git a/ompi/mca/common/sm/common_sm_mmap.c b/ompi/mca/common/sm/common_sm_mmap.c index e2d60ccf1d..4fd050b9fa 100644 --- a/ompi/mca/common/sm/common_sm_mmap.c +++ b/ompi/mca/common/sm/common_sm_mmap.c @@ -288,9 +288,18 @@ void* mca_common_sm_mmap_seg_alloc( if(seg->seg_offset + *size > map->map_size) { addr = NULL; } else { + size_t fixup; + /* add base address to segment offset */ addr = map->data_addr + seg->seg_offset; seg->seg_offset += *size; + + /* fix up seg_offset so next allocation is aligned on a + sizeof(long) boundry. Do it here so that we don't have to + check before checking remaining size in buffer */ + if ((fixup = (seg->seg_offset & (sizeof(long) - 1))) > 0) { + seg->seg_offset += sizeof(long) - fixup; + } } if (NULL != registration) { *registration = NULL;