Skip to content

Commit e79debc

Browse files
committed
osc/rdma: fix overflow in offset calculation
This commit fixes a bug is osc/rdma that can occur if the total size of the shared memory segment gets larger than 4 GiB. The bug was caused by a typo. The type of my_base_offset should have been size_t not int. Signed-off-by: Nathan Hjelm <[email protected]>
1 parent f7faacc commit e79debc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

ompi/mca/osc/rdma/osc_rdma_component.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,11 +544,10 @@ static int allocate_state_shared (ompi_osc_rdma_module_t *module, void **base, s
544544
unsigned long offset, total_size;
545545
unsigned long state_base, data_base;
546546
int local_rank, local_size, ret;
547-
size_t local_rank_array_size, leader_peer_data_size;
547+
size_t local_rank_array_size, leader_peer_data_size, my_base_offset = 0;
548548
int my_rank = ompi_comm_rank (module->comm);
549549
int global_size = ompi_comm_size (module->comm);
550550
ompi_osc_rdma_region_t *state_region;
551-
int my_base_offset = 0;
552551
struct _local_data *temp;
553552
char *data_file;
554553

0 commit comments

Comments
 (0)