1
1

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
Этот коммит содержится в:
Josh Hursey 2008-05-28 19:37:20 +00:00
родитель f76240e7cc
Коммит 4ac7016200

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

@ -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);