1
1

* Ensure that mca_common_sm_mmap_seg_alloc() always returns a word-aligned

pointer.  Otherwise, we can end up segfaulting when the memory area is
  used by the caller.  Fixes a bug reported by Alex Spiegel.

This commit was SVN r9692.
Этот коммит содержится в:
Brian Barrett 2006-04-23 21:14:03 +00:00
родитель 9a65ddd788
Коммит 9befdc7d9f
2 изменённых файлов: 11 добавлений и 0 удалений

2
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.

Просмотреть файл

@ -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;