From 4ac701620039dd417badf6531e857e8a390e22d4 Mon Sep 17 00:00:00 2001 From: Josh Hursey Date: Wed, 28 May 2008 19:37:20 +0000 Subject: [PATCH] Make sure to check "opal_list_get_last" instead of "opal_list_get_end". The former will return a valid item in the list, the latter will return an invalid item that marks the end of the list. It was happending that when oversubscribing by way of an appfile we would cause a segv because we tried to interpret the invalid item returned by "opal_list_get_end" instead of a valid item. We would then try to write to unallocated memory. This commit fixes trac:1279 This commit was SVN r18529. The following Trac tickets were found above: Ticket 1279 --> https://svn.open-mpi.org/trac/ompi/ticket/1279 --- orte/mca/rmaps/round_robin/rmaps_rr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/orte/mca/rmaps/round_robin/rmaps_rr.c b/orte/mca/rmaps/round_robin/rmaps_rr.c index 4e004db73c..90e24e37af 100644 --- a/orte/mca/rmaps/round_robin/rmaps_rr.c +++ b/orte/mca/rmaps/round_robin/rmaps_rr.c @@ -380,7 +380,7 @@ static int orte_rmaps_rr_map(orte_job_t *jdata) /* work down the list - is there another node that * would not be oversubscribed? */ - if (cur_node_item != opal_list_get_end(&node_list)) { + if (cur_node_item != opal_list_get_last(&node_list)) { item = opal_list_get_next(cur_node_item); } else { item = opal_list_get_first(&node_list); @@ -392,7 +392,7 @@ static int orte_rmaps_rr_map(orte_job_t *jdata) cur_node_item = item; goto proceed; } - if (item == opal_list_get_end(&node_list)) { + if (item == opal_list_get_last(&node_list)) { item = opal_list_get_first(&node_list); } else { item= opal_list_get_next(item);