Skip to content

Commit e6017c8

Browse files
author
rhc54
committed
Merge pull request #768 from rhc54/topic/segfault
Fix an annoying segfault caused by incorrect indentation in a loop th…
2 parents f86a0c9 + 9bc3842 commit e6017c8

File tree

1 file changed

+50
-50
lines changed

1 file changed

+50
-50
lines changed

orte/orted/pmix/pmix_server_process_msgs.c

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,8 @@ void pmix_server_process_message(pmix_server_peer_t *peer)
330330
* was actually provided so we don't hang if no modex data is being given */
331331
OPAL_LIST_FOREACH_SAFE(req, nextreq, &pmix_server_pending_dmx_reqs, pmix_server_dmx_req_t) {
332332
if (0 == opal_compare_proc(id, req->target)) {
333-
/* yes - deliver a copy */
334333
reply = OBJ_NEW(opal_buffer_t);
334+
/* yes - deliver a copy */
335335
if (NULL == req->proxy) {
336336
/* pack the status */
337337
ret = OPAL_SUCCESS;
@@ -370,59 +370,59 @@ void pmix_server_process_message(pmix_server_peer_t *peer)
370370
OBJ_DESTRUCT(&buf);
371371
/* pass the local blob(s) */
372372
opal_dss.copy_payload(reply, &blocal);
373-
}
374-
/* use the PMIX send to return the data */
375-
PMIX_SERVER_QUEUE_SEND(req->peer, req->tag, reply);
376-
} else {
377-
/* pack the id of the requested proc */
378-
if (OPAL_SUCCESS != (rc = opal_dss.pack(reply, &id, 1, OPAL_NAME))) {
379-
ORTE_ERROR_LOG(rc);
380-
OBJ_RELEASE(reply);
381-
OBJ_DESTRUCT(&xfer);
382-
OBJ_RELEASE(sig);
383-
return;
384-
}
385-
/* pack the status */
386-
ret = OPAL_SUCCESS;
387-
if (OPAL_SUCCESS != (rc = opal_dss.pack(reply, &ret, 1, OPAL_INT))) {
388-
ORTE_ERROR_LOG(rc);
389-
OBJ_RELEASE(reply);
390-
return;
391-
}
392-
/* always pass the hostname */
393-
OBJ_CONSTRUCT(&buf, opal_buffer_t);
394-
OBJ_CONSTRUCT(&kv, opal_value_t);
395-
kv.key = strdup(PMIX_HOSTNAME);
396-
kv.type = OPAL_STRING;
397-
kv.data.string = strdup(orte_process_info.nodename);
398-
kp = &kv;
399-
if (OPAL_SUCCESS != (rc = opal_dss.pack(&buf, &kp, 1, OPAL_VALUE))) {
400-
ORTE_ERROR_LOG(rc);
401-
OBJ_RELEASE(reply);
402-
OBJ_DESTRUCT(&buf);
373+
/* use the PMIX send to return the data */
374+
PMIX_SERVER_QUEUE_SEND(req->peer, req->tag, reply);
375+
} else {
376+
/* pack the id of the requested proc */
377+
if (OPAL_SUCCESS != (rc = opal_dss.pack(reply, &id, 1, OPAL_NAME))) {
378+
ORTE_ERROR_LOG(rc);
379+
OBJ_RELEASE(reply);
380+
OBJ_DESTRUCT(&xfer);
381+
OBJ_RELEASE(sig);
382+
return;
383+
}
384+
/* pack the status */
385+
ret = OPAL_SUCCESS;
386+
if (OPAL_SUCCESS != (rc = opal_dss.pack(reply, &ret, 1, OPAL_INT))) {
387+
ORTE_ERROR_LOG(rc);
388+
OBJ_RELEASE(reply);
389+
return;
390+
}
391+
/* always pass the hostname */
392+
OBJ_CONSTRUCT(&buf, opal_buffer_t);
393+
OBJ_CONSTRUCT(&kv, opal_value_t);
394+
kv.key = strdup(PMIX_HOSTNAME);
395+
kv.type = OPAL_STRING;
396+
kv.data.string = strdup(orte_process_info.nodename);
397+
kp = &kv;
398+
if (OPAL_SUCCESS != (rc = opal_dss.pack(&buf, &kp, 1, OPAL_VALUE))) {
399+
ORTE_ERROR_LOG(rc);
400+
OBJ_RELEASE(reply);
401+
OBJ_DESTRUCT(&buf);
402+
OBJ_DESTRUCT(&kv);
403+
return;
404+
}
403405
OBJ_DESTRUCT(&kv);
404-
return;
405-
}
406-
OBJ_DESTRUCT(&kv);
407-
/* pack the hostname blob */
408-
bptr = &buf;
409-
if (OPAL_SUCCESS != (rc = opal_dss.pack(reply, &bptr, 1, OPAL_BUFFER))) {
410-
ORTE_ERROR_LOG(rc);
411-
OBJ_RELEASE(reply);
412-
OBJ_DESTRUCT(&xfer);
406+
/* pack the hostname blob */
407+
bptr = &buf;
408+
if (OPAL_SUCCESS != (rc = opal_dss.pack(reply, &bptr, 1, OPAL_BUFFER))) {
409+
ORTE_ERROR_LOG(rc);
410+
OBJ_RELEASE(reply);
411+
OBJ_DESTRUCT(&xfer);
412+
OBJ_DESTRUCT(&buf);
413+
return;
414+
}
413415
OBJ_DESTRUCT(&buf);
414-
return;
416+
/* pass the remote blob(s) */
417+
opal_dss.copy_payload(reply, &bremote);
418+
/* use RML to send the response */
419+
orte_rml.send_buffer_nb(&req->proxy->name, reply,
420+
ORTE_RML_TAG_DIRECT_MODEX_RESP,
421+
orte_rml_send_callback, NULL);
415422
}
416-
OBJ_DESTRUCT(&buf);
417-
/* pass the remote blob(s) */
418-
opal_dss.copy_payload(reply, &bremote);
419-
/* use RML to send the response */
420-
orte_rml.send_buffer_nb(&req->proxy->name, reply,
421-
ORTE_RML_TAG_DIRECT_MODEX_RESP,
422-
orte_rml_send_callback, NULL);
423+
opal_list_remove_item(&pmix_server_pending_dmx_reqs, &req->super);
424+
OBJ_RELEASE(req);
423425
}
424-
opal_list_remove_item(&pmix_server_pending_dmx_reqs, &req->super);
425-
OBJ_RELEASE(req);
426426
}
427427
OBJ_DESTRUCT(&blocal);
428428
OBJ_DESTRUCT(&bremote);

0 commit comments

Comments
 (0)