Skip to content

Commit 0c63a1a

Browse files
authored
Merge pull request #12788 from tvegas1/sshmem_start_addr_fix_v4
oshmem/shmem: Fix sshmem start address and warn if inside data region - v4.1.x
2 parents 7256c81 + bcf37c9 commit 0c63a1a

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

oshmem/mca/memheap/base/memheap_base_static.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "oshmem/proc/proc.h"
1515
#include "oshmem/mca/memheap/memheap.h"
1616
#include "oshmem/mca/memheap/base/base.h"
17+
#include "oshmem/mca/sshmem/base/base.h"
1718
#include "oshmem/util/oshmem_util.h"
1819

1920
#include <stdio.h>
@@ -51,6 +52,14 @@ int mca_memheap_base_static_init(mca_memheap_map_t *map)
5152
return OSHMEM_ERROR;
5253
}
5354

55+
#ifdef __linux__
56+
extern unsigned _end;
57+
if (mca_sshmem_base_start_address < (uintptr_t)&_end) {
58+
MEMHEAP_WARN("sshmem base start address is inside data region"
59+
" (%p < %p)", mca_sshmem_base_start_address, &_end);
60+
}
61+
#endif
62+
5463
while (NULL != fgets(line, sizeof(line), fp)) {
5564
if (3 > sscanf(line,
5665
"%llx-%llx %s %llx %s %llx %s",

oshmem/mca/sshmem/base/sshmem_base_open.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
*/
3838
#if UINTPTR_MAX == 0xFFFFFFFF
3939
void *mca_sshmem_base_start_address = (void*)0;
40+
#elif defined(__aarch64__)
41+
void* mca_sshmem_base_start_address = (void*)0xAB0000000000;
4042
#else
4143
void* mca_sshmem_base_start_address = (void*)0xFF000000;
4244
#endif

0 commit comments

Comments
 (0)