|  | 
| 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-2012 Cisco Systems, Inc.  All rights reserved. | 
|  | 13 | + * Copyright (c) 2007-2016 Cisco Systems, Inc.  All rights reserved. | 
| 14 | 14 |  * Copyright (c) 2007      Sun Microsystems, Inc.  All rights reserved. | 
| 15 | 15 |  * Copyright (c) 2009      Oak Ridge National Labs.  All rights reserved. | 
| 16 | 16 |  * Copyright (c) 2010-2015 Los Alamos National Security, LLC. | 
| @@ -265,6 +265,34 @@ opal_err2str(int errnum, const char **errmsg) | 
| 265 | 265 | } | 
| 266 | 266 | 
 | 
| 267 | 267 | 
 | 
|  | 268 | +int opal_init_psm(void) | 
|  | 269 | +{ | 
|  | 270 | +    /* Very early in the init sequence -- before *ANY* MCA components | 
|  | 271 | +       are opened -- we need to disable some behavior from the PSM and | 
|  | 272 | +       PSM2 libraries (by default): at least some old versions of | 
|  | 273 | +       these libraries hijack signal handlers during their library | 
|  | 274 | +       constructors and then do not un-hijack them when the libraries | 
|  | 275 | +       are unloaded. | 
|  | 276 | +
 | 
|  | 277 | +       It is a bit of an abstraction break that we have to put | 
|  | 278 | +       vendor/transport-specific code in the OPAL core, but we're | 
|  | 279 | +       out of options, unfortunately. | 
|  | 280 | +
 | 
|  | 281 | +       NOTE: We only disable this behavior if the corresponding | 
|  | 282 | +       environment variables are not already set (i.e., if the | 
|  | 283 | +       user/environment has indicated a preference for this behavior, | 
|  | 284 | +       we won't override it). */ | 
|  | 285 | +    if (NULL == getenv("IPATH_NO_BACKTRACE")) { | 
|  | 286 | +        opal_setenv("IPATH_NO_BACKTRACE", "1", true, &environ); | 
|  | 287 | +    } | 
|  | 288 | +    if (NULL == getenv("HFI_NO_BACKTRACE")) { | 
|  | 289 | +        opal_setenv("HFI_NO_BACKTRACE", "1", true, &environ); | 
|  | 290 | +    } | 
|  | 291 | + | 
|  | 292 | +    return OPAL_SUCCESS; | 
|  | 293 | +} | 
|  | 294 | + | 
|  | 295 | + | 
| 268 | 296 | int | 
| 269 | 297 | opal_init_util(int* pargc, char*** pargv) | 
| 270 | 298 | { | 
| @@ -328,6 +356,10 @@ opal_init_util(int* pargc, char*** pargv) | 
| 328 | 356 |         goto return_error; | 
| 329 | 357 |     } | 
| 330 | 358 | 
 | 
|  | 359 | +    // Disable PSM signal hijacking (see comment in function for more | 
|  | 360 | +    // details) | 
|  | 361 | +    opal_init_psm(); | 
|  | 362 | + | 
| 331 | 363 |     /* Setup the parameter system */ | 
| 332 | 364 |     if (OPAL_SUCCESS != (ret = mca_base_var_init())) { | 
| 333 | 365 |         error = "mca_base_var_init"; | 
|  | 
0 commit comments