Skip to content

Commit cfa784c

Browse files
author
Ralph Castain
committed
Since we changed storage to pointers in pmix_value_t, we need to allocate space for those values when unpacking
1 parent 99b2664 commit cfa784c

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

opal/mca/pmix/pmix3x/pmix/src/buffer_ops/unpack.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,11 @@ pmix_status_t pmix_bfrop_unpack_status(pmix_buffer_t *buffer, void *dest,
631631
}
632632
break;
633633
case PMIX_PROC:
634+
/* this field is now a pointer, so we must allocate storage for it */
635+
PMIX_PROC_CREATE(val->data.proc, 1);
636+
if (NULL == val->data.proc) {
637+
return PMIX_ERR_NOMEM;
638+
}
634639
if (PMIX_SUCCESS != (ret = pmix_bfrop_unpack_buffer(buffer, val->data.proc, &m, PMIX_PROC))) {
635640
return ret;
636641
}
@@ -666,11 +671,21 @@ pmix_status_t pmix_bfrop_unpack_status(pmix_buffer_t *buffer, void *dest,
666671
}
667672
break;
668673
case PMIX_PROC_INFO:
674+
/* this is now a pointer, so allocate storage for it */
675+
PMIX_PROC_INFO_CREATE(val->data.pinfo, 1);
676+
if (NULL == val->data.pinfo) {
677+
return PMIX_ERR_NOMEM;
678+
}
669679
if (PMIX_SUCCESS != (ret = pmix_bfrop_unpack_buffer(buffer, val->data.pinfo, &m, PMIX_PROC_INFO))) {
670680
return ret;
671681
}
672682
break;
673683
case PMIX_DATA_ARRAY:
684+
/* this is now a pointer, so allocate storage for it */
685+
val->data.darray = (pmix_data_array_t*)malloc(sizeof(val->data.darray));
686+
if (NULL == val->data.darray) {
687+
return PMIX_ERR_NOMEM;
688+
}
674689
if (PMIX_SUCCESS != (ret = pmix_bfrop_unpack_buffer(buffer, val->data.darray, &m, PMIX_DATA_ARRAY))) {
675690
return ret;
676691
}
@@ -682,6 +697,11 @@ pmix_status_t pmix_bfrop_unpack_status(pmix_buffer_t *buffer, void *dest,
682697
break;
683698
/**** DEPRECATED ****/
684699
case PMIX_INFO_ARRAY:
700+
/* this field is now a pointer, so we must allocate storage for it */
701+
val->data.array = (pmix_info_array_t*)malloc(sizeof(val->data.array));
702+
if (NULL == val->data.array) {
703+
return PMIX_ERR_NOMEM;
704+
}
685705
if (PMIX_SUCCESS != (ret = pmix_bfrop_unpack_buffer(buffer, val->data.array, &m, PMIX_INFO_ARRAY))) {
686706
return ret;
687707
}

orte/test/system/orte_notify.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ static void notification_fn(int status,
2727
{
2828
int peer_rank;
2929

30-
fprintf(stderr, "orte_notify: Name %s Host: %s Pid %ld source %s\n",
30+
fprintf(stderr, "orte_notify: Name %s Host: %s Pid %ld status %d source %s\n",
3131
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
32-
hostname, (long)pid, ORTE_NAME_PRINT(source));
32+
hostname, (long)pid, status, ORTE_NAME_PRINT(source));
3333

3434
/** let the notifier know we are done */
3535
if (cbfunc) {

0 commit comments

Comments
 (0)