|
10 | 10 | * University of Stuttgart. All rights reserved.
|
11 | 11 | * Copyright (c) 2004-2005 The Regents of the University of California.
|
12 | 12 | * All rights reserved.
|
13 |
| - * Copyright (c) 2007-2015 Cisco Systems, Inc. All rights reserved. |
| 13 | + * Copyright (c) 2007-2018 Cisco Systems, Inc. All rights reserved |
14 | 14 | * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
|
15 | 15 | * Copyright (c) 2012-2017 Los Alamos National Security, LLC. All rights
|
16 | 16 | * reserved.
|
@@ -348,13 +348,19 @@ int opal_infosubscribe_subscribe(opal_infosubscriber_t *object, char *key, char
|
348 | 348 | opal_list_t *list = NULL;
|
349 | 349 | opal_hash_table_t *table = &object->s_subscriber_table;
|
350 | 350 | opal_callback_list_item_t *callback_list_item;
|
| 351 | + size_t max_len = OPAL_MAX_INFO_KEY - strlen(OPAL_INFO_SAVE_PREFIX); |
351 | 352 |
|
352 |
| - if (strlen(key) > OPAL_MAX_INFO_KEY-strlen(OPAL_INFO_SAVE_PREFIX)) { |
353 |
| - fprintf(stderr, "DEVELOPER WARNING: Unexpected key length [%s]: " |
354 |
| - "OMPI internal callback keys are limited to %d chars\n", |
355 |
| - key, (int)(OPAL_MAX_INFO_KEY-strlen(OPAL_INFO_SAVE_PREFIX))); |
| 353 | + if (strlen(key) > max_len) { |
| 354 | + opal_output(0, "DEVELOPER WARNING: Unexpected MPI info key length [%s]: " |
| 355 | + "OMPI internal callback keys are limited to %" PRIsize_t " chars.", |
| 356 | + key, max_len); |
356 | 357 | #if OPAL_ENABLE_DEBUG
|
357 |
| - assert(!(strlen(key) > OPAL_MAX_INFO_KEY-strlen(OPAL_INFO_SAVE_PREFIX))); |
| 358 | + opal_output(0, "Aborting because this is a developer / debugging build. Go fix this error."); |
| 359 | + // Do not assert() / dump core. Just exit un-gracefully. |
| 360 | + exit(1); |
| 361 | +#else |
| 362 | + opal_output(0, "The \"%s\" MPI info key almost certainly will not work properly. You should inform an Open MPI developer about this.", key); |
| 363 | + key[max_len] = '\0'; |
358 | 364 | #endif
|
359 | 365 | }
|
360 | 366 |
|
|
0 commit comments