1
1

Stop a segfault that results in zombied processes by checking for NULL prior to object release

Этот коммит содержится в:
Ralph Castain 2016-02-18 13:48:41 -08:00
родитель 7b73c868d5
Коммит 1748f44147
3 изменённых файлов: 25 добавлений и 8 удалений

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

@ -379,19 +379,27 @@ static int hnp_close(const orte_process_name_t* peer,
OPAL_LIST_FOREACH(proct, &mca_iof_hnp_component.procs, orte_iof_proc_t) { OPAL_LIST_FOREACH(proct, &mca_iof_hnp_component.procs, orte_iof_proc_t) {
if (OPAL_EQUAL == orte_util_compare_name_fields(mask, &proct->name, peer)) { if (OPAL_EQUAL == orte_util_compare_name_fields(mask, &proct->name, peer)) {
if (ORTE_IOF_STDIN & source_tag) { if (ORTE_IOF_STDIN & source_tag) {
OBJ_RELEASE(proct->stdin); if (NULL != proct->stdin) {
OBJ_RELEASE(proct->stdin);
}
++cnt; ++cnt;
} }
if (ORTE_IOF_STDOUT & source_tag) { if (ORTE_IOF_STDOUT & source_tag) {
OBJ_RELEASE(proct->revstdout); if (NULL != proct->revstdout) {
OBJ_RELEASE(proct->revstdout);
}
++cnt; ++cnt;
} }
if (ORTE_IOF_STDERR & source_tag) { if (ORTE_IOF_STDERR & source_tag) {
OBJ_RELEASE(proct->revstderr); if (NULL != proct->revstderr) {
OBJ_RELEASE(proct->revstderr);
}
++cnt; ++cnt;
} }
if (ORTE_IOF_STDDIAG & source_tag) { if (ORTE_IOF_STDDIAG & source_tag) {
OBJ_RELEASE(proct->revstddiag); if (NULL != proct->revstddiag) {
OBJ_RELEASE(proct->revstddiag);
}
++cnt; ++cnt;
} }
/* if we closed them all, then remove this proc */ /* if we closed them all, then remove this proc */

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

@ -270,19 +270,27 @@ static int orted_close(const orte_process_name_t* peer,
OPAL_LIST_FOREACH(proct, &mca_iof_orted_component.procs, orte_iof_proc_t) { OPAL_LIST_FOREACH(proct, &mca_iof_orted_component.procs, orte_iof_proc_t) {
if (OPAL_EQUAL == orte_util_compare_name_fields(mask, &proct->name, peer)) { if (OPAL_EQUAL == orte_util_compare_name_fields(mask, &proct->name, peer)) {
if (ORTE_IOF_STDIN & source_tag) { if (ORTE_IOF_STDIN & source_tag) {
OBJ_RELEASE(proct->stdin); if (NULL != proct->stdin) {
OBJ_RELEASE(proct->stdin);
}
++cnt; ++cnt;
} }
if (ORTE_IOF_STDOUT & source_tag) { if (ORTE_IOF_STDOUT & source_tag) {
OBJ_RELEASE(proct->revstdout); if (NULL != proct->revstdout) {
OBJ_RELEASE(proct->revstdout);
}
++cnt; ++cnt;
} }
if (ORTE_IOF_STDERR & source_tag) { if (ORTE_IOF_STDERR & source_tag) {
OBJ_RELEASE(proct->revstderr); if (NULL != proct->revstderr) {
OBJ_RELEASE(proct->revstderr);
}
++cnt; ++cnt;
} }
if (ORTE_IOF_STDDIAG & source_tag) { if (ORTE_IOF_STDDIAG & source_tag) {
OBJ_RELEASE(proct->revstddiag); if (NULL != proct->revstddiag) {
OBJ_RELEASE(proct->revstddiag);
}
++cnt; ++cnt;
} }
/* if we closed them all, then remove this proc */ /* if we closed them all, then remove this proc */

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

@ -34,6 +34,7 @@ int main(int argc, char* argv[])
MPI_Abort(MPI_COMM_WORLD, errcode); MPI_Abort(MPI_COMM_WORLD, errcode);
} else { } else {
errcode = 0; errcode = 0;
sleep(99999999);
} }
} }